Jakub Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Jakub Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 16 | apiVersion: apps/v1 |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 17 | kind: StatefulSet |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 18 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 19 | spec: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 20 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 21 | serviceName: {{ include "common.servicename" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 22 | replicas: {{ .Values.replicaCount }} |
| 23 | template: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 25 | spec: |
Krzysztof Opasiak | 58685d0 | 2021-07-29 22:45:45 +0200 | [diff] [blame] | 26 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 8 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 27 | - name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 28 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 29 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 30 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 31 | - /app/ready.py |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 32 | args: |
| 33 | - --container-name |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 34 | - dmaap-dr-prov |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 35 | env: |
| 36 | - name: NAMESPACE |
| 37 | valueFrom: |
| 38 | fieldRef: |
| 39 | apiVersion: v1 |
| 40 | fieldPath: metadata.namespace |
econwar | 4d9f35f | 2019-04-16 08:02:13 +0000 | [diff] [blame] | 41 | - name: {{ include "common.name" . }}-permission-fixer |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 42 | image: {{ include "repositoryGenerator.image.busybox" . }} |
econwar | 4d9f35f | 2019-04-16 08:02:13 +0000 | [diff] [blame] | 43 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Krzysztof Opasiak | 58685d0 | 2021-07-29 22:45:45 +0200 | [diff] [blame] | 44 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 45 | - mountPath: {{ .Values.persistence.spool.path }} |
| 46 | name: {{ include "common.fullname" . }}-spool |
| 47 | - mountPath: {{ .Values.persistence.event.path }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 48 | name: {{ include "common.fullname" . }}-event-logs |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 49 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 50 | containers: |
| 51 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 52 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 54 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 55 | {{- if eq .Values.liveness.enabled true }} |
| 56 | livenessProbe: |
| 57 | tcpSocket: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 58 | port: {{.Values.liveness.port}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 59 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 60 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 61 | {{ end -}} |
| 62 | readinessProbe: |
| 63 | tcpSocket: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 64 | port: {{.Values.readiness.port}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 65 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 66 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Krzysztof Opasiak | 58685d0 | 2021-07-29 22:45:45 +0200 | [diff] [blame] | 67 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 68 | - mountPath: {{ .Values.persistence.spool.path }} |
| 69 | name: {{ include "common.fullname" . }}-spool |
| 70 | - mountPath: {{ .Values.persistence.event.path }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 71 | name: {{ include "common.fullname" . }}-event-logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 72 | - mountPath: /etc/localtime |
| 73 | name: localtime |
| 74 | readOnly: false |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 75 | - mountPath: /opt/app/datartr/etc/node.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 76 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 77 | subPath: node.properties |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 78 | - mountPath: /opt/app/datartr/etc/logback.xml |
| 79 | name: {{ include "common.fullname" . }}-log-conf |
| 80 | subPath: logback.xml |
| 81 | - mountPath: {{ .Values.global.loggingDirectory }} |
| 82 | name: {{ include "common.fullname" . }}-logs |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 83 | resources: {{ include "common.resources" . | nindent 12 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 84 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 85 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 86 | {{- end -}} |
| 87 | {{- if .Values.affinity }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 88 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
Sylvain Desbureaux | e615343 | 2021-02-04 18:26:23 +0100 | [diff] [blame] | 89 | {{- end }} |
Krzysztof Opasiak | 03b1009 | 2020-01-24 22:45:16 +0100 | [diff] [blame] | 90 | # Filebeat sidecar container |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame] | 91 | - name: {{ include "common.name" . }}-filebeat-onap |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 92 | image: {{ include "repositoryGenerator.image.logging" . }} |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 93 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 94 | volumeMounts: |
| 95 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 96 | mountPath: /usr/share/filebeat/filebeat.yml |
| 97 | subPath: filebeat.yml |
| 98 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 99 | mountPath: /usr/share/filebeat/data |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 100 | - name: {{ include "common.fullname" . }}-logs |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 101 | mountPath: /var/log/onap/datarouter-node |
Sylvain Desbureaux | 789d79a | 2018-12-20 11:04:34 +0100 | [diff] [blame] | 102 | imagePullSecrets: |
| 103 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
farida azmy | 13388ba | 2021-03-17 11:33:28 +0200 | [diff] [blame] | 104 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Krzysztof Opasiak | 58685d0 | 2021-07-29 22:45:45 +0200 | [diff] [blame] | 105 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 106 | - name: localtime |
| 107 | hostPath: |
| 108 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 109 | - name: {{ include "common.fullname" . }}-config |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 110 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 111 | name: {{ include "common.fullname" . }}-configmap |
| 112 | items: |
| 113 | - key: node.properties |
| 114 | path: node.properties |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 115 | - name: {{ include "common.fullname" . }}-log-conf |
| 116 | configMap: |
| 117 | name: {{ include "common.fullname" . }}-log |
| 118 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 119 | configMap: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 120 | name: {{ include "common.fullname" . }}-dmaap-dr-node-filebeat-configmap |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 121 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 122 | emptyDir: {} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 123 | - name: {{ include "common.fullname" . }}-logs |
| 124 | emptyDir: {} |
| 125 | {{- if not .Values.persistence.enabled }} |
mprzybys | e1ea50d | 2020-01-31 10:09:02 +0000 | [diff] [blame] | 126 | - name: {{ include "common.fullname" . }}-event-logs |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 127 | emptyDir: {} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 128 | - name: {{ include "common.fullname" . }}-spool |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 129 | emptyDir: {} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 130 | {{- end }} |
| 131 | {{- if .Values.persistence.enabled }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 132 | volumeClaimTemplates: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 133 | - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "spool" "persistenceInfos" .Values.persistence.spool) | indent 4 | trim }} |
| 134 | - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "event-logs" "persistenceInfos" .Values.persistence.event) | indent 4 | trim }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 135 | {{- end }} |