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