Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 14 | apiVersion: apps/v1beta1 |
| 15 | kind: StatefulSet |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 16 | metadata: |
| 17 | name: {{ include "common.fullname" . }} |
| 18 | namespace: {{ include "common.namespace" . }} |
| 19 | labels: |
| 20 | app: {{ include "common.name" . }} |
| 21 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 22 | release: {{ include "common.release" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 23 | heritage: {{ .Release.Service }} |
| 24 | spec: |
| 25 | replicas: {{ .Values.replicaCount }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 26 | serviceName: {{ .Values.config.dmaapDrNode.name }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 27 | template: |
| 28 | metadata: |
| 29 | labels: |
| 30 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 31 | release: {{ include "common.release" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 32 | spec: |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 33 | initContainers: |
| 34 | - name: {{ include "common.name" . }}-readiness |
| 35 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 36 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 37 | command: |
| 38 | - /root/ready.py |
| 39 | args: |
| 40 | - --container-name |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 41 | - dmaap-dr-prov |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 42 | env: |
| 43 | - name: NAMESPACE |
| 44 | valueFrom: |
| 45 | fieldRef: |
| 46 | apiVersion: v1 |
| 47 | fieldPath: metadata.namespace |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 48 | {{- if .Values.global.aafEnabled }} |
efiacor | 0ccdd6c | 2020-02-05 20:42:47 +0000 | [diff] [blame] | 49 | - name: {{ include "common.name" . }}-aaf-readiness |
| 50 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 51 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 52 | command: |
| 53 | - /root/ready.py |
| 54 | args: |
| 55 | - --container-name |
| 56 | - aaf-locate |
| 57 | env: |
| 58 | - name: NAMESPACE |
| 59 | valueFrom: |
| 60 | fieldRef: |
| 61 | apiVersion: v1 |
| 62 | fieldPath: metadata.namespace |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 63 | - name: {{ include "common.name" . }}-dr-node-aaf-config |
| 64 | image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}" |
| 65 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 66 | volumeMounts: |
| 67 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 68 | name: {{ include "common.fullname" . }}-aaf-props |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 69 | command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"] |
| 70 | env: |
| 71 | - name: APP_FQI |
| 72 | value: "{{ .Values.aafConfig.fqi }}" |
| 73 | - name: aaf_locate_url |
| 74 | value: "https://aaf-locate.{{ .Release.Namespace }}:8095" |
| 75 | - name: aaf_locator_container |
| 76 | value: "{{ .Values.global.aafLocatorContainer }}" |
| 77 | - name: aaf_locator_container_ns |
| 78 | value: "{{ .Release.Namespace }}" |
| 79 | - name: aaf_locator_fqdn |
| 80 | value: "{{ .Values.aafConfig.fqdn }}" |
| 81 | - name: aaf_locator_public_fqdn |
| 82 | value: "{{.Values.aafConfig.publicFqdn}}" |
| 83 | - name: aaf_locator_app_ns |
| 84 | value: "{{ .Values.global.aafAppNs }}" |
| 85 | - name: DEPLOY_FQI |
| 86 | value: "{{ .Values.aafConfig.aafDeployFqi }}" |
| 87 | - name: DEPLOY_PASSWORD |
| 88 | value: "{{ .Values.aafConfig.aafDeployPass }}" |
| 89 | - name: cadi_longitude |
| 90 | value: "{{ .Values.aafConfig.cadiLongitude }}" |
| 91 | - name: cadi_latitude |
| 92 | value: "{{ .Values.aafConfig.cadiLatitude }}" |
| 93 | {{- end }} |
econwar | 4d9f35f | 2019-04-16 08:02:13 +0000 | [diff] [blame] | 94 | - name: {{ include "common.name" . }}-permission-fixer |
| 95 | image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" |
| 96 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 97 | volumeMounts: |
| 98 | - mountPath: {{ .Values.persistence.spoolPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 99 | name: {{ include "common.fullname" . }}-data |
econwar | 4d9f35f | 2019-04-16 08:02:13 +0000 | [diff] [blame] | 100 | - mountPath: {{ .Values.persistence.eventLogsPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 101 | name: {{ include "common.fullname" . }}-event-logs |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 102 | {{- if .Values.global.aafEnabled }} |
| 103 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 104 | name: {{ include "common.fullname" . }}-aaf-props |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 105 | {{- end }} |
| 106 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 107 | containers: |
| 108 | - name: {{ include "common.name" . }} |
| 109 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 110 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 111 | ports: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 112 | - containerPort: {{.Values.config.dmaapDrNode.externalPort}} |
| 113 | - containerPort: {{.Values.config.dmaapDrNode.externalPort2}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 114 | {{- if eq .Values.liveness.enabled true }} |
| 115 | livenessProbe: |
| 116 | tcpSocket: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 117 | port: {{.Values.config.dmaapDrNode.internalPort}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 118 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 119 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 120 | {{ end -}} |
| 121 | readinessProbe: |
| 122 | tcpSocket: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 123 | port: {{.Values.config.dmaapDrNode.internalPort}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 124 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 125 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 126 | volumeMounts: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 127 | {{- if .Values.global.aafEnabled }} |
| 128 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 129 | name: {{ include "common.fullname" . }}-aaf-props |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 130 | {{- end }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 131 | - mountPath: {{ .Values.persistence.spoolPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 132 | name: {{ include "common.fullname" . }}-data |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 133 | - mountPath: {{ .Values.persistence.eventLogsPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 134 | name: {{ include "common.fullname" . }}-event-logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 135 | - mountPath: /etc/localtime |
| 136 | name: localtime |
| 137 | readOnly: false |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 138 | - mountPath: /opt/app/datartr/etc/node.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 139 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 140 | subPath: node.properties |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 141 | - mountPath: /opt/app/datartr/etc/logback.xml |
| 142 | name: {{ include "common.fullname" . }}-log-conf |
| 143 | subPath: logback.xml |
| 144 | - mountPath: {{ .Values.global.loggingDirectory }} |
| 145 | name: {{ include "common.fullname" . }}-logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 146 | resources: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 147 | {{ include "common.resources" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 148 | {{- if .Values.nodeSelector }} |
| 149 | nodeSelector: |
| 150 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 151 | {{- end -}} |
| 152 | {{- if .Values.affinity }} |
| 153 | affinity: |
| 154 | {{ toYaml .Values.affinity | indent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 155 | {{- end -}} |
Krzysztof Opasiak | 03b1009 | 2020-01-24 22:45:16 +0100 | [diff] [blame] | 156 | # Filebeat sidecar container |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame] | 157 | - name: {{ include "common.name" . }}-filebeat-onap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 158 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 159 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 160 | volumeMounts: |
| 161 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 162 | mountPath: /usr/share/filebeat/filebeat.yml |
| 163 | subPath: filebeat.yml |
| 164 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 165 | mountPath: /usr/share/filebeat/data |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 166 | - name: {{ include "common.fullname" . }}-logs |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 167 | mountPath: /var/log/onap/datarouter-node |
Sylvain Desbureaux | 789d79a | 2018-12-20 11:04:34 +0100 | [diff] [blame] | 168 | imagePullSecrets: |
| 169 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 170 | volumes: |
| 171 | - name: localtime |
| 172 | hostPath: |
| 173 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 174 | - name: {{ include "common.fullname" . }}-config |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 175 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 176 | name: {{ include "common.fullname" . }}-configmap |
| 177 | items: |
| 178 | - key: node.properties |
| 179 | path: node.properties |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 180 | - name: {{ include "common.fullname" . }}-log-conf |
| 181 | configMap: |
| 182 | name: {{ include "common.fullname" . }}-log |
| 183 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 184 | configMap: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 185 | name: {{ include "common.fullname" . }}-dmaap-dr-node-filebeat-configmap |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 186 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 187 | emptyDir: {} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 188 | - name: {{ include "common.fullname" . }}-logs |
| 189 | emptyDir: {} |
| 190 | {{- if not .Values.persistence.enabled }} |
mprzybys | e1ea50d | 2020-01-31 10:09:02 +0000 | [diff] [blame] | 191 | - name: {{ include "common.fullname" . }}-event-logs |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 192 | emptyDir: {} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 193 | - name: {{ include "common.fullname" . }}-data |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 194 | emptyDir: {} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 195 | {{- if .Values.global.aafEnabled }} |
mprzybys | e1ea50d | 2020-01-31 10:09:02 +0000 | [diff] [blame] | 196 | - name: {{ include "common.fullname" . }}-aaf-props |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 197 | emptyDir: {} |
| 198 | {{- end }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 199 | {{- end }} |
| 200 | {{- if .Values.persistence.enabled }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 201 | volumeClaimTemplates: |
| 202 | - metadata: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 203 | name: {{ include "common.fullname" . }}-data |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 204 | labels: |
| 205 | name: {{ include "common.fullname" . }} |
| 206 | spec: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 207 | accessModes: |
| 208 | - {{ .Values.persistence.accessMode }} |
| 209 | storageClassName: {{ include "common.storageClass" . }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 210 | resources: |
| 211 | requests: |
| 212 | storage: {{ .Values.persistence.spoolSize }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 213 | - metadata: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 214 | name: {{ include "common.fullname" . }}-event-logs |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 215 | labels: |
| 216 | name: {{ include "common.fullname" . }} |
| 217 | spec: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 218 | accessModes: |
| 219 | - {{ .Values.persistence.accessMode }} |
| 220 | {{- if eq "True" (include "common.needPV" .) }} |
| 221 | storageClassName: "{{ include "common.fullname" . }}-data-event-logs" |
| 222 | {{- else }} |
| 223 | storageClassName: {{ include "common.storageClass" . }} |
| 224 | {{- end }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 225 | resources: |
| 226 | requests: |
| 227 | storage: {{ .Values.persistence.eventLogSize }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 228 | {{- if .Values.global.aafEnabled }} |
| 229 | - metadata: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 230 | name: {{ include "common.fullname" . }}-aaf-props |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 231 | labels: |
| 232 | name: {{ include "common.fullname" . }} |
| 233 | spec: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 234 | accessModes: |
| 235 | - {{ .Values.persistence.accessMode }} |
| 236 | {{- if eq "True" (include "common.needPV" .) }} |
| 237 | storageClassName: "{{ include "common.fullname" . }}-data-aaf-props" |
| 238 | {{- else }} |
| 239 | storageClassName: {{ include "common.storageClass" . }} |
| 240 | {{- end }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 241 | resources: |
| 242 | requests: |
| 243 | storage: {{ .Values.persistence.aafCredsSize }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 244 | {{- end }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 245 | {{- end }} |