jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [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. |
| 14 | |
| 15 | apiVersion: apps/v1beta1 |
| 16 | kind: StatefulSet |
| 17 | metadata: |
| 18 | name: {{ include "common.fullname" . }} |
| 19 | namespace: {{ include "common.namespace" . }} |
| 20 | labels: |
| 21 | app: {{ include "common.name" . }} |
| 22 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 23 | release: {{ include "common.release" . }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 24 | heritage: {{ .Release.Service }} |
| 25 | spec: |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 26 | serviceName: {{ include "common.servicename" . }}-cluster |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 27 | replicas: {{ .Values.replicaCount }} |
| 28 | podManagementPolicy: Parallel |
| 29 | template: |
| 30 | metadata: |
| 31 | labels: |
| 32 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 33 | release: {{ include "common.release" . }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 34 | spec: |
| 35 | initContainers: |
| 36 | - command: |
| 37 | - /root/ready.py |
| 38 | args: |
| 39 | - --container-name |
Mahendra Raghuwanshi | b76cb28 | 2019-04-09 10:13:07 +0000 | [diff] [blame] | 40 | - {{ .Values.config.mariadbGalera.chartName }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 41 | env: |
| 42 | - name: NAMESPACE |
| 43 | valueFrom: |
| 44 | fieldRef: |
| 45 | apiVersion: v1 |
| 46 | fieldPath: metadata.namespace |
| 47 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 48 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 25e01d5 | 2019-12-09 11:06:39 +0100 | [diff] [blame] | 49 | name: {{ include "common.name" . }}-readiness |
Agarwal, Ruchira (ra1926) | ec7c75e | 2019-10-01 17:36:24 +0000 | [diff] [blame] | 50 | {{ if .Values.global.aafEnabled }} |
| 51 | - name: {{ include "common.name" . }}-aaf-readiness |
| 52 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 54 | command: |
| 55 | - /root/ready.py |
| 56 | args: |
| 57 | - --container-name |
| 58 | - aaf-locate |
| 59 | env: |
| 60 | - name: NAMESPACE |
| 61 | valueFrom: |
| 62 | fieldRef: |
| 63 | apiVersion: v1 |
| 64 | fieldPath: metadata.namespace |
| 65 | - name: {{ include "common.name" . }}-aaf |
| 66 | image: {{ .Values.global.repository }}/{{ .Values.aaf_init.agentImage }} |
| 67 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 68 | volumeMounts: |
| 69 | - mountPath: {{ .Values.certpersistence.certPath }} |
| 70 | name: {{ include "common.fullname" . }}-certs |
| 71 | command: |
| 72 | - bash |
| 73 | - -c |
| 74 | - | |
| 75 | /opt/app/aaf_config/bin/agent.sh && |
| 76 | cd /opt/app/osaaf/local && |
| 77 | /opt/app/aaf_config/bin/agent.sh local showpass | grep cadi_keystore_password= | cut -d= -f 2 > /opt/app/osaaf/local/.pass 2>&1 |
| 78 | env: |
| 79 | - name: APP_FQI |
| 80 | value: "{{ .Values.aaf_init.fqi }}" |
| 81 | - name: aaf_locate_url |
| 82 | value: "https://aaf-locate.{{ .Release.Namespace}}:8095" |
| 83 | - name: aaf_locator_container |
| 84 | value: "oom" |
| 85 | - name: aaf_locator_container_ns |
| 86 | value: "{{ .Release.Namespace }}" |
| 87 | - name: aaf_locator_fqdn |
| 88 | value: "{{ .Values.aaf_init.fqdn }}" |
| 89 | - name: aaf_locator_app_ns |
| 90 | value: "{{ .Values.aaf_init.app_ns }}" |
| 91 | - name: DEPLOY_FQI |
| 92 | value: "{{ .Values.aaf_init.deploy_fqi }}" |
| 93 | - name: DEPLOY_PASSWORD |
| 94 | valueFrom: |
| 95 | secretKeyRef: |
| 96 | name: {{ template "common.fullname" .}}-aaf |
| 97 | key: aaf-password |
| 98 | - name: cadi_longitude |
| 99 | value: "{{ .Values.aaf_init.cadi_longitude }}" |
| 100 | - name: cadi_latitude |
| 101 | value: "{{ .Values.aaf_init.cadi_latitude }}" |
| 102 | {{ end }} |
Timoney, Dan (dt5972) | ba4d2eb | 2019-05-07 13:32:42 -0400 | [diff] [blame] | 103 | - name: {{ include "common.name" . }}-chown |
| 104 | image: "busybox" |
| 105 | command: ["sh", "-c", "chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }} ; chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.certpersistence.certPath }}"] |
| 106 | volumeMounts: |
| 107 | - mountPath: {{ .Values.persistence.mdsalPath }} |
Sylvain Desbureaux | 25e01d5 | 2019-12-09 11:06:39 +0100 | [diff] [blame] | 108 | name: {{ include "common.fullname" . }}-data |
Timoney, Dan (dt5972) | ba4d2eb | 2019-05-07 13:32:42 -0400 | [diff] [blame] | 109 | - mountPath: {{ .Values.certpersistence.certPath }} |
| 110 | name: {{ include "common.fullname" . }}-certs |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 111 | containers: |
| 112 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 113 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 114 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 115 | command: ["/bin/bash"] |
| 116 | args: ["-c", "/opt/sdnc/bin/startODL.sh"] |
| 117 | ports: |
| 118 | - containerPort: {{ .Values.service.internalPort }} |
| 119 | - containerPort: {{ .Values.service.internalPort2 }} |
| 120 | - containerPort: {{ .Values.service.internalPort3 }} |
| 121 | - containerPort: {{ .Values.service.clusterPort }} |
| 122 | readinessProbe: |
| 123 | tcpSocket: |
| 124 | port: {{ .Values.service.internalPort }} |
| 125 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 126 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 127 | env: |
| 128 | - name: MYSQL_ROOT_PASSWORD |
| 129 | valueFrom: |
| 130 | secretKeyRef: |
| 131 | name: {{ template "common.fullname" . }} |
| 132 | key: db-root-password |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 133 | - name: ODL_ADMIN_PASSWORD |
| 134 | valueFrom: |
| 135 | secretKeyRef: |
| 136 | name: {{ template "common.fullname" . }}-odl |
| 137 | key: odl-password |
jmac | 70863e1 | 2018-05-16 14:53:03 +0000 | [diff] [blame] | 138 | - name: SDNC_DB_PASSWORD |
| 139 | valueFrom: |
| 140 | secretKeyRef: |
| 141 | name: {{ template "common.fullname" . }}-sdnctl |
| 142 | key: db-sdnctl-password |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 143 | - name: SDNC_CONFIG_DIR |
| 144 | value: "{{ .Values.config.configDir }}" |
| 145 | - name: ENABLE_ODL_CLUSTER |
| 146 | value: "{{ .Values.config.enableClustering }}" |
Trevor Tait | 567ff1e | 2018-05-01 16:20:54 -0400 | [diff] [blame] | 147 | - name: MY_ODL_CLUSTER |
| 148 | value: "{{ .Values.config.myODLCluster }}" |
| 149 | - name: PEER_ODL_CLUSTER |
| 150 | value: "{{ .Values.config.peerODLCluster }}" |
| 151 | - name: IS_PRIMARY_CLUSTER |
| 152 | value: "{{ .Values.config.isPrimaryCluster }}" |
| 153 | - name: GEO_ENABLED |
| 154 | value: "{{ .Values.config.geoEnabled}}" |
Agarwal, Ruchira (ra1926) | ec7c75e | 2019-10-01 17:36:24 +0000 | [diff] [blame] | 155 | - name: SDNC_AAF_ENABLED |
| 156 | value: "{{ .Values.global.aafEnabled}}" |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 157 | - name: SDNC_REPLICAS |
| 158 | value: "{{ .Values.replicaCount }}" |
| 159 | - name: MYSQL_HOST |
Mahendra Raghuwanshi | b76cb28 | 2019-04-09 10:13:07 +0000 | [diff] [blame] | 160 | value: "{{.Values.config.mariadbGalera.serviceName}}.{{.Release.Namespace}}" |
Timoney, Dan (dt5972) | 6819bc9 | 2019-02-12 13:30:49 -0500 | [diff] [blame] | 161 | - name: JAVA_HOME |
| 162 | value: "{{ .Values.config.javaHome}}" |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 163 | volumeMounts: |
| 164 | - mountPath: /etc/localtime |
| 165 | name: localtime |
| 166 | readOnly: true |
| 167 | - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg |
| 168 | name: sdnc-logging-cfg-config |
| 169 | subPath: org.ops4j.pax.logging.cfg |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 170 | - mountPath: {{ .Values.config.binDir }}/startODL.sh |
| 171 | name: bin |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 172 | subPath: startODL.sh |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 173 | - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh |
| 174 | name: bin |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 175 | subPath: installSdncDb.sh |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 176 | - mountPath: {{ .Values.config.configDir }}/aaiclient.properties |
| 177 | name: properties |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 178 | subPath: aaiclient.properties |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 179 | - mountPath: {{ .Values.config.configDir }}/dblib.properties |
| 180 | name: properties |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 181 | subPath: dblib.properties |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 182 | - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties |
| 183 | name: properties |
| 184 | subPath: lcm-dg.properties |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 185 | - mountPath: {{ .Values.config.configDir }}/svclogic.properties |
| 186 | name: properties |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 187 | subPath: svclogic.properties |
| 188 | - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 189 | name: properties |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 190 | subPath: svclogic.properties |
Alexis de Talhouët | 43c67e0 | 2018-09-20 16:49:16 -0400 | [diff] [blame] | 191 | - mountPath: {{ .Values.config.configDir }}/netbox.properties |
| 192 | name: properties |
| 193 | subPath: netbox.properties |
| 194 | - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties |
| 195 | name: properties |
| 196 | subPath: blueprints-processor-adaptor.properties |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 197 | - mountPath: {{ .Values.persistence.mdsalPath }} |
Sylvain Desbureaux | 25e01d5 | 2019-12-09 11:06:39 +0100 | [diff] [blame] | 198 | name: {{ include "common.fullname" . }}-data |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 199 | - mountPath: /var/log/onap |
| 200 | name: logs |
Rahul Tyagi | 44cc1ac | 2019-03-02 06:15:35 +0000 | [diff] [blame] | 201 | - mountPath: {{ .Values.certpersistence.certPath }} |
| 202 | name: {{ include "common.fullname" . }}-certs |
Timoney, Dan (dt5972) | 5877477 | 2019-08-21 16:50:54 -0400 | [diff] [blame] | 203 | - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml |
| 204 | name: properties |
| 205 | subPath: akka.conf |
| 206 | - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg |
| 207 | name: properties |
| 208 | subPath: org.opendaylight.controller.cluster.datastore.cfg |
| 209 | - mountPath: {{ .Values.config.odl.binDir }}/setenv |
| 210 | name: properties |
| 211 | subPath: setenv |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 212 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 213 | {{ include "common.resources" . | indent 12 }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 214 | {{- if .Values.nodeSelector }} |
| 215 | nodeSelector: |
| 216 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 217 | {{- end -}} |
| 218 | {{- if .Values.affinity }} |
| 219 | affinity: |
| 220 | {{ toYaml .Values.affinity | indent 10 }} |
| 221 | {{- end }} |
| 222 | |
| 223 | # side car containers |
| 224 | - name: filebeat-onap |
| 225 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 226 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 227 | volumeMounts: |
| 228 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 229 | name: filebeat-conf |
| 230 | subPath: filebeat.yml |
| 231 | - mountPath: /var/log/onap |
| 232 | name: logs |
| 233 | - mountPath: /usr/share/filebeat/data |
| 234 | name: data-filebeat |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 235 | imagePullSecrets: |
| 236 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 237 | volumes: |
| 238 | - name: localtime |
| 239 | hostPath: |
| 240 | path: /etc/localtime |
| 241 | - name: logs |
| 242 | emptyDir: {} |
| 243 | - name: data-filebeat |
| 244 | emptyDir: {} |
| 245 | - name: filebeat-conf |
| 246 | configMap: |
| 247 | name: {{ include "common.fullname" . }}-filebeat-configmap |
| 248 | - name: sdnc-logging-cfg-config |
| 249 | configMap: |
| 250 | name: {{ include "common.fullname" . }}-log-configmap |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 251 | - name: bin |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 252 | configMap: |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 253 | name: {{ include "common.fullname" . }}-bin |
| 254 | defaultMode: 0755 |
| 255 | - name: properties |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 256 | configMap: |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 257 | name: {{ include "common.fullname" . }}-properties |
| 258 | defaultMode: 0644 |
Rahul Tyagi | 44cc1ac | 2019-03-02 06:15:35 +0000 | [diff] [blame] | 259 | - name: {{ include "common.fullname" . }}-certs |
| 260 | {{ if .Values.certpersistence.enabled }} |
| 261 | persistentVolumeClaim: |
Sylvain Desbureaux | 25e01d5 | 2019-12-09 11:06:39 +0100 | [diff] [blame] | 262 | claimName: {{ include "common.fullname" . }}-certs |
Rahul Tyagi | 44cc1ac | 2019-03-02 06:15:35 +0000 | [diff] [blame] | 263 | {{ else }} |
| 264 | emptyDir: {} |
| 265 | {{ end }} |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 266 | {{ if not .Values.persistence.enabled }} |
Sylvain Desbureaux | 25e01d5 | 2019-12-09 11:06:39 +0100 | [diff] [blame] | 267 | - name: {{ include "common.fullname" . }}-data |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 268 | emptyDir: {} |
| 269 | {{ else }} |
| 270 | volumeClaimTemplates: |
| 271 | - metadata: |
Sylvain Desbureaux | 25e01d5 | 2019-12-09 11:06:39 +0100 | [diff] [blame] | 272 | name: {{ include "common.fullname" . }}-data |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 273 | labels: |
| 274 | name: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 25e01d5 | 2019-12-09 11:06:39 +0100 | [diff] [blame] | 275 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 276 | release: "{{ include "common.release" . }}" |
Sylvain Desbureaux | 25e01d5 | 2019-12-09 11:06:39 +0100 | [diff] [blame] | 277 | heritage: "{{ .Release.Service }}" |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 278 | spec: |
Sylvain Desbureaux | 25e01d5 | 2019-12-09 11:06:39 +0100 | [diff] [blame] | 279 | accessModes: |
| 280 | - {{ .Values.persistence.accessMode }} |
| 281 | storageClassName: {{ include "common.storageClass" . }} |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 282 | resources: |
| 283 | requests: |
| 284 | storage: {{ .Values.persistence.size }} |
Sylvain Desbureaux | 25e01d5 | 2019-12-09 11:06:39 +0100 | [diff] [blame] | 285 | {{- end }} |