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 "+" "_" }} |
| 23 | release: {{ .Release.Name }} |
| 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" . }} |
| 33 | release: {{ .Release.Name }} |
| 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 }} |
Timoney, Dan (dt5972) | ba4d2eb | 2019-05-07 13:32:42 -0400 | [diff] [blame^] | 49 | name: {{ include "common.name" . }}-readiness |
| 50 | - name: {{ include "common.name" . }}-chown |
| 51 | image: "busybox" |
| 52 | 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 }}"] |
| 53 | volumeMounts: |
| 54 | - mountPath: {{ .Values.persistence.mdsalPath }} |
| 55 | name: {{ include "common.fullname" . }}-mdsal |
| 56 | - mountPath: {{ .Values.certpersistence.certPath }} |
| 57 | name: {{ include "common.fullname" . }}-certs |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 58 | containers: |
| 59 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 60 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 61 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 62 | command: ["/bin/bash"] |
| 63 | args: ["-c", "/opt/sdnc/bin/startODL.sh"] |
| 64 | ports: |
| 65 | - containerPort: {{ .Values.service.internalPort }} |
| 66 | - containerPort: {{ .Values.service.internalPort2 }} |
| 67 | - containerPort: {{ .Values.service.internalPort3 }} |
| 68 | - containerPort: {{ .Values.service.clusterPort }} |
| 69 | readinessProbe: |
| 70 | tcpSocket: |
| 71 | port: {{ .Values.service.internalPort }} |
| 72 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 73 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 74 | env: |
| 75 | - name: MYSQL_ROOT_PASSWORD |
| 76 | valueFrom: |
| 77 | secretKeyRef: |
| 78 | name: {{ template "common.fullname" . }} |
| 79 | key: db-root-password |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 80 | - name: ODL_ADMIN_PASSWORD |
| 81 | valueFrom: |
| 82 | secretKeyRef: |
| 83 | name: {{ template "common.fullname" . }}-odl |
| 84 | key: odl-password |
jmac | 70863e1 | 2018-05-16 14:53:03 +0000 | [diff] [blame] | 85 | - name: SDNC_DB_PASSWORD |
| 86 | valueFrom: |
| 87 | secretKeyRef: |
| 88 | name: {{ template "common.fullname" . }}-sdnctl |
| 89 | key: db-sdnctl-password |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 90 | - name: SDNC_CONFIG_DIR |
| 91 | value: "{{ .Values.config.configDir }}" |
| 92 | - name: ENABLE_ODL_CLUSTER |
| 93 | value: "{{ .Values.config.enableClustering }}" |
Trevor Tait | 567ff1e | 2018-05-01 16:20:54 -0400 | [diff] [blame] | 94 | - name: MY_ODL_CLUSTER |
| 95 | value: "{{ .Values.config.myODLCluster }}" |
| 96 | - name: PEER_ODL_CLUSTER |
| 97 | value: "{{ .Values.config.peerODLCluster }}" |
| 98 | - name: IS_PRIMARY_CLUSTER |
| 99 | value: "{{ .Values.config.isPrimaryCluster }}" |
| 100 | - name: GEO_ENABLED |
| 101 | value: "{{ .Values.config.geoEnabled}}" |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 102 | - name: SDNC_REPLICAS |
| 103 | value: "{{ .Values.replicaCount }}" |
| 104 | - name: MYSQL_HOST |
Mahendra Raghuwanshi | b76cb28 | 2019-04-09 10:13:07 +0000 | [diff] [blame] | 105 | value: "{{.Values.config.mariadbGalera.serviceName}}.{{.Release.Namespace}}" |
Timoney, Dan (dt5972) | 6819bc9 | 2019-02-12 13:30:49 -0500 | [diff] [blame] | 106 | - name: JAVA_HOME |
| 107 | value: "{{ .Values.config.javaHome}}" |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 108 | volumeMounts: |
| 109 | - mountPath: /etc/localtime |
| 110 | name: localtime |
| 111 | readOnly: true |
| 112 | - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg |
| 113 | name: sdnc-logging-cfg-config |
| 114 | subPath: org.ops4j.pax.logging.cfg |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 115 | - mountPath: {{ .Values.config.binDir }}/startODL.sh |
| 116 | name: bin |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 117 | subPath: startODL.sh |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 118 | - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh |
| 119 | name: bin |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 120 | subPath: installSdncDb.sh |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 121 | - mountPath: {{ .Values.config.configDir }}/aaiclient.properties |
| 122 | name: properties |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 123 | subPath: aaiclient.properties |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 124 | - mountPath: {{ .Values.config.configDir }}/dblib.properties |
| 125 | name: properties |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 126 | subPath: dblib.properties |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 127 | - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties |
| 128 | name: properties |
| 129 | subPath: lcm-dg.properties |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 130 | - mountPath: {{ .Values.config.configDir }}/svclogic.properties |
| 131 | name: properties |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 132 | subPath: svclogic.properties |
| 133 | - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 134 | name: properties |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 135 | subPath: svclogic.properties |
Alexis de Talhouët | 43c67e0 | 2018-09-20 16:49:16 -0400 | [diff] [blame] | 136 | - mountPath: {{ .Values.config.configDir }}/netbox.properties |
| 137 | name: properties |
| 138 | subPath: netbox.properties |
| 139 | - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties |
| 140 | name: properties |
| 141 | subPath: blueprints-processor-adaptor.properties |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 142 | - mountPath: {{ .Values.persistence.mdsalPath }} |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 143 | name: {{ include "common.fullname" . }}-mdsal |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 144 | - mountPath: /var/log/onap |
| 145 | name: logs |
Rahul Tyagi | 44cc1ac | 2019-03-02 06:15:35 +0000 | [diff] [blame] | 146 | - mountPath: {{ .Values.certpersistence.certPath }} |
| 147 | name: {{ include "common.fullname" . }}-certs |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 148 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 149 | {{ include "common.resources" . | indent 12 }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [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 }} |
| 157 | {{- end }} |
| 158 | |
| 159 | # side car containers |
| 160 | - name: filebeat-onap |
| 161 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 162 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 163 | volumeMounts: |
| 164 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 165 | name: filebeat-conf |
| 166 | subPath: filebeat.yml |
| 167 | - mountPath: /var/log/onap |
| 168 | name: logs |
| 169 | - mountPath: /usr/share/filebeat/data |
| 170 | name: data-filebeat |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 171 | imagePullSecrets: |
| 172 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 173 | volumes: |
| 174 | - name: localtime |
| 175 | hostPath: |
| 176 | path: /etc/localtime |
| 177 | - name: logs |
| 178 | emptyDir: {} |
| 179 | - name: data-filebeat |
| 180 | emptyDir: {} |
| 181 | - name: filebeat-conf |
| 182 | configMap: |
| 183 | name: {{ include "common.fullname" . }}-filebeat-configmap |
| 184 | - name: sdnc-logging-cfg-config |
| 185 | configMap: |
| 186 | name: {{ include "common.fullname" . }}-log-configmap |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 187 | - name: bin |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 188 | configMap: |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 189 | name: {{ include "common.fullname" . }}-bin |
| 190 | defaultMode: 0755 |
| 191 | - name: properties |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 192 | configMap: |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 193 | name: {{ include "common.fullname" . }}-properties |
| 194 | defaultMode: 0644 |
Rahul Tyagi | 44cc1ac | 2019-03-02 06:15:35 +0000 | [diff] [blame] | 195 | - name: {{ include "common.fullname" . }}-certs |
| 196 | {{ if .Values.certpersistence.enabled }} |
| 197 | persistentVolumeClaim: |
| 198 | claimName: {{ include "common.fullname" . }}-pvc-certs |
| 199 | {{ else }} |
| 200 | emptyDir: {} |
| 201 | {{ end }} |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 202 | {{ if not .Values.persistence.enabled }} |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 203 | - name: {{ include "common.fullname" . }}-mdsal |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 204 | emptyDir: {} |
| 205 | {{ else }} |
| 206 | volumeClaimTemplates: |
| 207 | - metadata: |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 208 | name: {{ include "common.fullname" . }}-mdsal |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 209 | labels: |
| 210 | name: {{ include "common.fullname" . }} |
| 211 | spec: |
| 212 | accessModes: [ {{ .Values.persistence.accessMode }} ] |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 213 | storageClassName: {{ include "common.fullname" . }}-mdsal |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 214 | resources: |
| 215 | requests: |
| 216 | storage: {{ .Values.persistence.size }} |
Alexis de Talhouët | 634b455 | 2018-10-28 21:56:33 -0400 | [diff] [blame] | 217 | selector: |
| 218 | matchLabels: |
| 219 | name: {{ include "common.fullname" . }} |
Mahendra Raghuwanshi | b76cb28 | 2019-04-09 10:13:07 +0000 | [diff] [blame] | 220 | {{ end }} |