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: extensions/v1beta1 |
| 16 | kind: Deployment |
| 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: |
| 26 | replicas: {{ .Values.replicaCount }} |
| 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" . }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 32 | spec: |
| 33 | initContainers: |
| 34 | - command: |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 35 | - sh |
| 36 | args: |
| 37 | - -c |
| 38 | - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 39 | env: |
| 40 | - name: SDNC_DB_USER |
| 41 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
| 42 | - name: SDNC_DB_PASSWORD |
| 43 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} |
| 44 | - name: DB_FABRIC_USER |
| 45 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "fabric-db-creds" "key" "login") | indent 10 }} |
| 46 | - name: DB_FABRIC_PASSWORD |
| 47 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "fabric-db-creds" "key" "password") | indent 10 }} |
| 48 | - name: ODL_USER |
| 49 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }} |
| 50 | - name: ODL_PASSWORD |
| 51 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }} |
| 52 | - name: KEYSTORE_PASSWORD |
| 53 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "keystore-password" "key" "password") | indent 10 }} |
| 54 | volumeMounts: |
| 55 | - mountPath: /config-input |
| 56 | name: config-input |
| 57 | - mountPath: /config |
| 58 | name: properties |
| 59 | image: "{{ .Values.global.envsubstImage }}" |
| 60 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 61 | name: {{ include "common.name" . }}-update-config |
| 62 | |
| 63 | - command: |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 64 | - /root/ready.py |
| 65 | args: |
| 66 | - --container-name |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 67 | - {{ include "common.mariadbService" . }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 68 | - --container-name |
| 69 | - {{ .Values.config.sdncChartName }} |
| 70 | env: |
| 71 | - name: NAMESPACE |
| 72 | valueFrom: |
| 73 | fieldRef: |
| 74 | apiVersion: v1 |
| 75 | fieldPath: metadata.namespace |
| 76 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 77 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 78 | name: {{ include "common.name" . }}-readiness |
| 79 | containers: |
| 80 | - name: {{ include "common.name" . }} |
| 81 | command: ["/bin/bash"] |
| 82 | args: ["-c", "cd /opt/onap/sdnc/admportal/shell && ./start_portal.sh"] |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 83 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 84 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 85 | ports: |
| 86 | - containerPort: {{ .Values.service.internalPort }} |
| 87 | # disable liveness probe when breakpoints set in debugger |
| 88 | # so K8s doesn't restart unresponsive container |
jmac | 2d276e0 | 2018-04-18 01:25:38 +0000 | [diff] [blame] | 89 | {{ if .Values.liveness.enabled }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 90 | livenessProbe: |
| 91 | tcpSocket: |
| 92 | port: {{ .Values.service.internalPort }} |
| 93 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 94 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
jmac | 2d276e0 | 2018-04-18 01:25:38 +0000 | [diff] [blame] | 95 | {{ end }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 96 | readinessProbe: |
| 97 | tcpSocket: |
| 98 | port: {{ .Values.service.internalPort }} |
| 99 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 100 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 101 | env: |
| 102 | - name: MYSQL_ROOT_PASSWORD |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 103 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-root-password" "key" "password") | indent 14 }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 104 | - name: SDNC_CONFIG_DIR |
| 105 | value: "{{ .Values.config.configDir }}" |
| 106 | volumeMounts: |
| 107 | - mountPath: /etc/localtime |
| 108 | name: localtime |
| 109 | readOnly: true |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 110 | - mountPath: {{ .Values.config.configDir }}/admportal.json |
| 111 | name: properties |
| 112 | subPath: admportal.json |
| 113 | - mountPath: {{ .Values.config.configDir }}/dblib.properties |
| 114 | name: properties |
| 115 | subPath: dblib.properties |
| 116 | - mountPath: {{ .Values.config.configDir }}/svclogic.properties |
| 117 | name: properties |
| 118 | subPath: svclogic.properties |
| 119 | - mountPath: {{ .Values.config.configDir }}/svclogic.properties.sdnctldb01 |
| 120 | name: properties |
| 121 | subPath: svclogic.properties |
| 122 | - mountPath: {{ .Values.config.configDir }}/svclogic.properties.sdnctldb02 |
| 123 | name: properties |
| 124 | subPath: svclogic.properties.sdnctldb02 |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 125 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 126 | {{ include "common.resources" . | indent 12 }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 127 | {{- if .Values.nodeSelector }} |
| 128 | nodeSelector: |
| 129 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 130 | {{- end -}} |
| 131 | {{- if .Values.affinity }} |
| 132 | affinity: |
| 133 | {{ toYaml .Values.affinity | indent 10 }} |
| 134 | {{- end }} |
| 135 | volumes: |
| 136 | - name: localtime |
| 137 | hostPath: |
| 138 | path: /etc/localtime |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 139 | - name: config-input |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 140 | configMap: |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 141 | name: {{ include "common.fullname" . }} |
| 142 | defaultMode: 0644 |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 143 | - name: properties |
| 144 | emptyDir: |
| 145 | medium: Memory |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 146 | imagePullSecrets: |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 147 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |