Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 1 | {{/* |
vaibhavjayas | ea9aee0 | 2018-08-31 06:22:26 +0000 | [diff] [blame] | 2 | # Copyright © 2018 AT&T, 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 | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 15 | */}} |
vaibhavjayas | ea9aee0 | 2018-08-31 06:22:26 +0000 | [diff] [blame] | 16 | |
milaszki | 326a5e7 | 2020-07-07 11:59:35 +0000 | [diff] [blame] | 17 | apiVersion: apps/v1 |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 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" . }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
| 28 | replicas: {{ .Values.replicaCount }} |
milaszki | 326a5e7 | 2020-07-07 11:59:35 +0000 | [diff] [blame] | 29 | selector: |
| 30 | matchLabels: |
| 31 | app: {{ include "common.name" . }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 32 | template: |
| 33 | metadata: |
| 34 | labels: |
| 35 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 36 | release: {{ include "common.release" . }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 37 | spec: |
| 38 | initContainers: |
| 39 | - command: |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 40 | - sh |
| 41 | args: |
| 42 | - -c |
| 43 | - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 44 | env: |
| 45 | - name: DB_USER |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 46 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 47 | - name: DB_PASSWORD |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 48 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 49 | - name: HTTP_USER |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 50 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "http-user-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 51 | - name: HTTP_PASSWORD |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 52 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "http-user-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 53 | - name: HTTP_ADMIN_USER |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 54 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "admin-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 55 | - name: HTTP_ADMIN_PASSWORD |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 56 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "admin-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 57 | - name: HTTP_NODE_USER |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 58 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "node-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 59 | - name: HTTP_NODE_PASSWORD |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 60 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "node-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 61 | - name: REST_CONF_USER |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 62 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 63 | - name: REST_CONF_PASSWORD |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 64 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 65 | volumeMounts: |
| 66 | - mountPath: /config-input |
| 67 | name: config-input |
| 68 | - mountPath: /config |
| 69 | name: config |
| 70 | image: "{{ .Values.global.envsubstImage }}" |
| 71 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 72 | name: {{ include "common.name" . }}-update-config |
| 73 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 74 | - /app/ready.py |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 75 | args: |
| 76 | - --container-name |
jmac | 4f76af4 | 2018-03-28 20:36:47 +0000 | [diff] [blame] | 77 | - {{ .Values.config.dbPodName }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 78 | env: |
| 79 | - name: NAMESPACE |
| 80 | valueFrom: |
| 81 | fieldRef: |
| 82 | apiVersion: v1 |
| 83 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 84 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 85 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 86 | name: {{ include "common.name" . }}-readiness |
| 87 | containers: |
| 88 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 89 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 90 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
jmac | 4f76af4 | 2018-03-28 20:36:47 +0000 | [diff] [blame] | 91 | command: ["/bin/bash"] |
| 92 | args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait"] |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 93 | ports: |
| 94 | - containerPort: {{ .Values.service.internalPort }} |
| 95 | readinessProbe: |
| 96 | tcpSocket: |
| 97 | port: {{ .Values.service.internalPort }} |
| 98 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 99 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 100 | env: |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 101 | - name: SDNC_CONFIG_DIR |
| 102 | value: /opt/onap/sdnc/data/properties |
| 103 | volumeMounts: |
| 104 | - mountPath: /etc/localtime |
| 105 | name: localtime |
| 106 | readOnly: true |
| 107 | - name: config |
| 108 | mountPath: /opt/app/application.properties |
| 109 | subPath: application.properties |
| 110 | - name: config |
afenner | 291d787 | 2018-05-23 14:19:55 +0000 | [diff] [blame] | 111 | mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/conf/svclogic.properties |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 112 | subPath: svclogic.properties |
| 113 | - name: config |
afenner | 291d787 | 2018-05-23 14:19:55 +0000 | [diff] [blame] | 114 | mountPath: /opt/onap/ccsdk/dgbuilder/svclogic/svclogic.properties |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 115 | subPath: svclogic.properties |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 116 | - name: config |
afenner | 291d787 | 2018-05-23 14:19:55 +0000 | [diff] [blame] | 117 | mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/customSettings.js |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 118 | subPath: customSettings.js |
| 119 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 120 | {{ include "common.resources" . | indent 12 }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 121 | {{- if .Values.nodeSelector }} |
| 122 | nodeSelector: |
| 123 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 124 | {{- end -}} |
| 125 | {{- if .Values.affinity }} |
| 126 | affinity: |
| 127 | {{ toYaml .Values.affinity | indent 10 }} |
| 128 | {{- end }} |
| 129 | volumes: |
| 130 | - name: localtime |
| 131 | hostPath: |
| 132 | path: /etc/localtime |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 133 | - name: config-input |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 134 | configMap: |
| 135 | name: {{ include "common.fullname" . }}-config |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 136 | - name: config |
| 137 | emptyDir: |
| 138 | medium: Memory |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 139 | imagePullSecrets: |
| 140 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |