Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame^] | 1 | {{/* |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame^] | 15 | */}} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 16 | |
| 17 | apiVersion: extensions/v1beta1 |
| 18 | kind: Deployment |
| 19 | metadata: |
| 20 | name: {{ include "common.fullname" . }} |
| 21 | namespace: {{ include "common.namespace" . }} |
| 22 | labels: |
| 23 | app: {{ include "common.name" . }} |
| 24 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
| 28 | replicas: {{ .Values.replicaCount }} |
| 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: |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 37 | - sh |
| 38 | args: |
| 39 | - -c |
| 40 | - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 41 | env: |
| 42 | - name: SDNC_DB_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame^] | 43 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 44 | - name: SDNC_DB_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame^] | 45 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 46 | - name: DB_FABRIC_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame^] | 47 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "fabric-db-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 48 | - name: DB_FABRIC_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame^] | 49 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "fabric-db-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 50 | - name: ODL_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame^] | 51 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 52 | - name: ODL_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame^] | 53 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 54 | - name: KEYSTORE_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame^] | 55 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-password" "key" "password") | indent 10 }} |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 56 | volumeMounts: |
| 57 | - mountPath: /config-input |
| 58 | name: config-input |
| 59 | - mountPath: /config |
| 60 | name: properties |
| 61 | image: "{{ .Values.global.envsubstImage }}" |
| 62 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 63 | name: {{ include "common.name" . }}-update-config |
| 64 | |
| 65 | - command: |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 66 | - /root/ready.py |
| 67 | args: |
| 68 | - --container-name |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 69 | - {{ include "common.mariadbService" . }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 70 | - --container-name |
| 71 | - {{ .Values.config.sdncChartName }} |
| 72 | env: |
| 73 | - name: NAMESPACE |
| 74 | valueFrom: |
| 75 | fieldRef: |
| 76 | apiVersion: v1 |
| 77 | fieldPath: metadata.namespace |
| 78 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 79 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 80 | name: {{ include "common.name" . }}-readiness |
| 81 | containers: |
| 82 | - name: {{ include "common.name" . }} |
| 83 | command: ["/bin/bash"] |
| 84 | args: ["-c", "cd /opt/onap/sdnc/admportal/shell && ./start_portal.sh"] |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 85 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 86 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 87 | ports: |
| 88 | - containerPort: {{ .Values.service.internalPort }} |
| 89 | # disable liveness probe when breakpoints set in debugger |
| 90 | # so K8s doesn't restart unresponsive container |
jmac | 2d276e0 | 2018-04-18 01:25:38 +0000 | [diff] [blame] | 91 | {{ if .Values.liveness.enabled }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 92 | livenessProbe: |
| 93 | tcpSocket: |
| 94 | port: {{ .Values.service.internalPort }} |
| 95 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 96 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
jmac | 2d276e0 | 2018-04-18 01:25:38 +0000 | [diff] [blame] | 97 | {{ end }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 98 | readinessProbe: |
| 99 | tcpSocket: |
| 100 | port: {{ .Values.service.internalPort }} |
| 101 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 102 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 103 | env: |
| 104 | - name: MYSQL_ROOT_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame^] | 105 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 14 }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 106 | - name: SDNC_CONFIG_DIR |
| 107 | value: "{{ .Values.config.configDir }}" |
| 108 | volumeMounts: |
| 109 | - mountPath: /etc/localtime |
| 110 | name: localtime |
| 111 | readOnly: true |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 112 | - mountPath: {{ .Values.config.configDir }}/admportal.json |
| 113 | name: properties |
| 114 | subPath: admportal.json |
| 115 | - mountPath: {{ .Values.config.configDir }}/dblib.properties |
| 116 | name: properties |
| 117 | subPath: dblib.properties |
| 118 | - mountPath: {{ .Values.config.configDir }}/svclogic.properties |
| 119 | name: properties |
| 120 | subPath: svclogic.properties |
| 121 | - mountPath: {{ .Values.config.configDir }}/svclogic.properties.sdnctldb01 |
| 122 | name: properties |
| 123 | subPath: svclogic.properties |
| 124 | - mountPath: {{ .Values.config.configDir }}/svclogic.properties.sdnctldb02 |
| 125 | name: properties |
| 126 | subPath: svclogic.properties.sdnctldb02 |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 127 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 128 | {{ include "common.resources" . | indent 12 }} |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 129 | {{- if .Values.nodeSelector }} |
| 130 | nodeSelector: |
| 131 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 132 | {{- end -}} |
| 133 | {{- if .Values.affinity }} |
| 134 | affinity: |
| 135 | {{ toYaml .Values.affinity | indent 10 }} |
| 136 | {{- end }} |
| 137 | volumes: |
| 138 | - name: localtime |
| 139 | hostPath: |
| 140 | path: /etc/localtime |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 141 | - name: config-input |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 142 | configMap: |
jmac | a68f4cb | 2018-05-10 22:44:19 +0000 | [diff] [blame] | 143 | name: {{ include "common.fullname" . }} |
| 144 | defaultMode: 0644 |
Krzysztof Opasiak | 71c8098 | 2020-02-22 02:12:02 +0100 | [diff] [blame] | 145 | - name: properties |
| 146 | emptyDir: |
| 147 | medium: Memory |
jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 148 | imagePullSecrets: |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 149 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |