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