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 |
Sylvain Desbureaux | d9ede77 | 2020-11-19 17:04:40 +0100 | [diff] [blame] | 70 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 71 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 72 | name: {{ include "common.name" . }}-update-config |
Dan Timoney | cb0a81f | 2020-07-15 17:31:43 -0400 | [diff] [blame] | 73 | {{ include "common.certInitializer.initContainer" . | indent 6 }} |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 74 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 75 | - /app/ready.py |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 76 | args: |
| 77 | - --container-name |
jmac | 4f76af4 | 2018-03-28 20:36:47 +0000 | [diff] [blame] | 78 | - {{ .Values.config.dbPodName }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 79 | env: |
| 80 | - name: NAMESPACE |
| 81 | valueFrom: |
| 82 | fieldRef: |
| 83 | apiVersion: v1 |
| 84 | fieldPath: metadata.namespace |
Sylvain Desbureaux | d9ede77 | 2020-11-19 17:04:40 +0100 | [diff] [blame] | 85 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 86 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 87 | name: {{ include "common.name" . }}-readiness |
| 88 | containers: |
| 89 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | d9ede77 | 2020-11-19 17:04:40 +0100 | [diff] [blame] | 90 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 91 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
jmac | 4f76af4 | 2018-03-28 20:36:47 +0000 | [diff] [blame] | 92 | command: ["/bin/bash"] |
Dan Timoney | cb0a81f | 2020-07-15 17:31:43 -0400 | [diff] [blame] | 93 | args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && {{ if .Values.global.aafEnabled}} cp /opt/app/osaaf/local/node-*.pem certs && {{end}}./start.sh sdnc1.0 && wait"] |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 94 | ports: |
| 95 | - containerPort: {{ .Values.service.internalPort }} |
| 96 | readinessProbe: |
| 97 | tcpSocket: |
| 98 | port: {{ .Values.service.internalPort }} |
| 99 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 100 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 101 | env: |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 102 | - name: SDNC_CONFIG_DIR |
| 103 | value: /opt/onap/sdnc/data/properties |
| 104 | volumeMounts: |
Dan Timoney | cb0a81f | 2020-07-15 17:31:43 -0400 | [diff] [blame] | 105 | {{ include "common.certInitializer.volumeMount" . | indent 10 }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 106 | - mountPath: /etc/localtime |
| 107 | name: localtime |
| 108 | readOnly: true |
| 109 | - name: config |
| 110 | mountPath: /opt/app/application.properties |
| 111 | subPath: application.properties |
| 112 | - name: config |
afenner | 291d787 | 2018-05-23 14:19:55 +0000 | [diff] [blame] | 113 | mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/conf/svclogic.properties |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 114 | subPath: svclogic.properties |
| 115 | - name: config |
afenner | 291d787 | 2018-05-23 14:19:55 +0000 | [diff] [blame] | 116 | mountPath: /opt/onap/ccsdk/dgbuilder/svclogic/svclogic.properties |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 117 | subPath: svclogic.properties |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 118 | - name: config |
afenner | 291d787 | 2018-05-23 14:19:55 +0000 | [diff] [blame] | 119 | mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/customSettings.js |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 120 | subPath: customSettings.js |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 121 | resources: {{ include "common.resources" . | nindent 12 }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 122 | {{- if .Values.nodeSelector }} |
| 123 | nodeSelector: |
| 124 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 125 | {{- end -}} |
| 126 | {{- if .Values.affinity }} |
| 127 | affinity: |
| 128 | {{ toYaml .Values.affinity | indent 10 }} |
| 129 | {{- end }} |
farida azmy | dc9aef0 | 2021-04-07 17:07:09 +0200 | [diff] [blame] | 130 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 131 | volumes: |
Dan Timoney | cb0a81f | 2020-07-15 17:31:43 -0400 | [diff] [blame] | 132 | {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 133 | - name: localtime |
| 134 | hostPath: |
| 135 | path: /etc/localtime |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 136 | - name: config-input |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 137 | configMap: |
| 138 | name: {{ include "common.fullname" . }}-config |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 139 | - name: config |
| 140 | emptyDir: |
| 141 | medium: Memory |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 142 | imagePullSecrets: |
| 143 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |