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 |
efiacor | a03527b | 2020-02-07 19:02:15 +0000 | [diff] [blame] | 57 | - --container-name |
| 58 | - aaf-cm |
efiacor | 0ccdd6c | 2020-02-05 20:42:47 +0000 | [diff] [blame] | 59 | env: |
| 60 | - name: NAMESPACE |
| 61 | valueFrom: |
| 62 | fieldRef: |
| 63 | apiVersion: v1 |
| 64 | fieldPath: metadata.namespace |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 65 | - name: {{ include "common.name" . }}-dr-node-aaf-config |
| 66 | image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}" |
| 67 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 68 | volumeMounts: |
| 69 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 70 | name: {{ include "common.fullname" . }}-aaf-props |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 71 | command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"] |
| 72 | env: |
| 73 | - name: APP_FQI |
| 74 | value: "{{ .Values.aafConfig.fqi }}" |
| 75 | - name: aaf_locate_url |
| 76 | value: "https://aaf-locate.{{ .Release.Namespace }}:8095" |
| 77 | - name: aaf_locator_container |
| 78 | value: "{{ .Values.global.aafLocatorContainer }}" |
| 79 | - name: aaf_locator_container_ns |
| 80 | value: "{{ .Release.Namespace }}" |
| 81 | - name: aaf_locator_fqdn |
| 82 | value: "{{ .Values.aafConfig.fqdn }}" |
| 83 | - name: aaf_locator_public_fqdn |
| 84 | value: "{{.Values.aafConfig.publicFqdn}}" |
| 85 | - name: aaf_locator_app_ns |
| 86 | value: "{{ .Values.global.aafAppNs }}" |
| 87 | - name: DEPLOY_FQI |
| 88 | value: "{{ .Values.aafConfig.aafDeployFqi }}" |
| 89 | - name: DEPLOY_PASSWORD |
| 90 | value: "{{ .Values.aafConfig.aafDeployPass }}" |
| 91 | - name: cadi_longitude |
| 92 | value: "{{ .Values.aafConfig.cadiLongitude }}" |
| 93 | - name: cadi_latitude |
| 94 | value: "{{ .Values.aafConfig.cadiLatitude }}" |
| 95 | {{- end }} |
econwar | 4d9f35f | 2019-04-16 08:02:13 +0000 | [diff] [blame] | 96 | - name: {{ include "common.name" . }}-permission-fixer |
| 97 | image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" |
| 98 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 99 | volumeMounts: |
| 100 | - mountPath: {{ .Values.persistence.spoolPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 101 | name: {{ include "common.fullname" . }}-data |
econwar | 4d9f35f | 2019-04-16 08:02:13 +0000 | [diff] [blame] | 102 | - mountPath: {{ .Values.persistence.eventLogsPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 103 | name: {{ include "common.fullname" . }}-event-logs |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 104 | {{- if .Values.global.aafEnabled }} |
| 105 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 106 | name: {{ include "common.fullname" . }}-aaf-props |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 107 | {{- end }} |
| 108 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 109 | containers: |
| 110 | - name: {{ include "common.name" . }} |
| 111 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 112 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 113 | ports: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 114 | - containerPort: {{.Values.config.dmaapDrNode.externalPort}} |
| 115 | - containerPort: {{.Values.config.dmaapDrNode.externalPort2}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 116 | {{- if eq .Values.liveness.enabled true }} |
| 117 | livenessProbe: |
| 118 | tcpSocket: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 119 | port: {{.Values.config.dmaapDrNode.internalPort}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 120 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 121 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 122 | {{ end -}} |
| 123 | readinessProbe: |
| 124 | tcpSocket: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 125 | port: {{.Values.config.dmaapDrNode.internalPort}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 126 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 127 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 128 | volumeMounts: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 129 | {{- if .Values.global.aafEnabled }} |
| 130 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 131 | name: {{ include "common.fullname" . }}-aaf-props |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 132 | {{- end }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 133 | - mountPath: {{ .Values.persistence.spoolPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 134 | name: {{ include "common.fullname" . }}-data |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 135 | - mountPath: {{ .Values.persistence.eventLogsPath }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 136 | name: {{ include "common.fullname" . }}-event-logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 137 | - mountPath: /etc/localtime |
| 138 | name: localtime |
| 139 | readOnly: false |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 140 | - mountPath: /opt/app/datartr/etc/node.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 141 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 142 | subPath: node.properties |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 143 | - mountPath: /opt/app/datartr/etc/logback.xml |
| 144 | name: {{ include "common.fullname" . }}-log-conf |
| 145 | subPath: logback.xml |
| 146 | - mountPath: {{ .Values.global.loggingDirectory }} |
| 147 | name: {{ include "common.fullname" . }}-logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 148 | resources: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 149 | {{ include "common.resources" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 150 | {{- if .Values.nodeSelector }} |
| 151 | nodeSelector: |
| 152 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 153 | {{- end -}} |
| 154 | {{- if .Values.affinity }} |
| 155 | affinity: |
| 156 | {{ toYaml .Values.affinity | indent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 157 | {{- end -}} |
Krzysztof Opasiak | 03b1009 | 2020-01-24 22:45:16 +0100 | [diff] [blame] | 158 | # Filebeat sidecar container |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame] | 159 | - name: {{ include "common.name" . }}-filebeat-onap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 160 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 161 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 162 | volumeMounts: |
| 163 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 164 | mountPath: /usr/share/filebeat/filebeat.yml |
| 165 | subPath: filebeat.yml |
| 166 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 167 | mountPath: /usr/share/filebeat/data |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 168 | - name: {{ include "common.fullname" . }}-logs |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 169 | mountPath: /var/log/onap/datarouter-node |
Sylvain Desbureaux | 789d79a | 2018-12-20 11:04:34 +0100 | [diff] [blame] | 170 | imagePullSecrets: |
| 171 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 172 | volumes: |
| 173 | - name: localtime |
| 174 | hostPath: |
| 175 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 176 | - name: {{ include "common.fullname" . }}-config |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 177 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 178 | name: {{ include "common.fullname" . }}-configmap |
| 179 | items: |
| 180 | - key: node.properties |
| 181 | path: node.properties |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 182 | - name: {{ include "common.fullname" . }}-log-conf |
| 183 | configMap: |
| 184 | name: {{ include "common.fullname" . }}-log |
| 185 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 186 | configMap: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 187 | name: {{ include "common.fullname" . }}-dmaap-dr-node-filebeat-configmap |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 188 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 189 | emptyDir: {} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 190 | - name: {{ include "common.fullname" . }}-logs |
| 191 | emptyDir: {} |
| 192 | {{- if not .Values.persistence.enabled }} |
mprzybys | e1ea50d | 2020-01-31 10:09:02 +0000 | [diff] [blame] | 193 | - name: {{ include "common.fullname" . }}-event-logs |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 194 | emptyDir: {} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 195 | - name: {{ include "common.fullname" . }}-data |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 196 | emptyDir: {} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 197 | {{- if .Values.global.aafEnabled }} |
mprzybys | e1ea50d | 2020-01-31 10:09:02 +0000 | [diff] [blame] | 198 | - name: {{ include "common.fullname" . }}-aaf-props |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 199 | emptyDir: {} |
| 200 | {{- end }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 201 | {{- end }} |
| 202 | {{- if .Values.persistence.enabled }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 203 | volumeClaimTemplates: |
| 204 | - metadata: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 205 | name: {{ include "common.fullname" . }}-data |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 206 | labels: |
| 207 | name: {{ include "common.fullname" . }} |
| 208 | spec: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 209 | accessModes: |
| 210 | - {{ .Values.persistence.accessMode }} |
| 211 | storageClassName: {{ include "common.storageClass" . }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 212 | resources: |
| 213 | requests: |
| 214 | storage: {{ .Values.persistence.spoolSize }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 215 | - metadata: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 216 | name: {{ include "common.fullname" . }}-event-logs |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 217 | labels: |
| 218 | name: {{ include "common.fullname" . }} |
| 219 | spec: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 220 | accessModes: |
| 221 | - {{ .Values.persistence.accessMode }} |
| 222 | {{- if eq "True" (include "common.needPV" .) }} |
| 223 | storageClassName: "{{ include "common.fullname" . }}-data-event-logs" |
| 224 | {{- else }} |
| 225 | storageClassName: {{ include "common.storageClass" . }} |
| 226 | {{- end }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 227 | resources: |
| 228 | requests: |
| 229 | storage: {{ .Values.persistence.eventLogSize }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 230 | {{- if .Values.global.aafEnabled }} |
| 231 | - metadata: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 232 | name: {{ include "common.fullname" . }}-aaf-props |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 233 | labels: |
| 234 | name: {{ include "common.fullname" . }} |
| 235 | spec: |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 236 | accessModes: |
| 237 | - {{ .Values.persistence.accessMode }} |
| 238 | {{- if eq "True" (include "common.needPV" .) }} |
| 239 | storageClassName: "{{ include "common.fullname" . }}-data-aaf-props" |
| 240 | {{- else }} |
| 241 | storageClassName: {{ include "common.storageClass" . }} |
| 242 | {{- end }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 243 | resources: |
| 244 | requests: |
| 245 | storage: {{ .Values.persistence.aafCredsSize }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 246 | {{- end }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 247 | {{- end }} |