blob: 6538ad08369f3daec1244fc38acf1123ed97026e [file] [log] [blame]
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +01001{{/*
vaibhavjayasea9aee02018-08-31 06:22:26 +00002# 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 Opasiakc0a57f82020-03-23 15:50:13 +010015*/}}
vaibhavjayasea9aee02018-08-31 06:22:26 +000016
milaszki326a5e72020-07-07 11:59:35 +000017apiVersion: apps/v1
Mike Elliott13fed112018-02-28 08:33:33 -050018kind: Deployment
19metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050026 heritage: {{ .Release.Service }}
27spec:
28 replicas: {{ .Values.replicaCount }}
milaszki326a5e72020-07-07 11:59:35 +000029 selector:
30 matchLabels:
31 app: {{ include "common.name" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050032 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050037 spec:
38 initContainers:
39 - command:
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010040 - 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 Opasiakc0a57f82020-03-23 15:50:13 +010046 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010047 - name: DB_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010048 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010049 - name: HTTP_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010050 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "http-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010051 - name: HTTP_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010052 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "http-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010053 - name: HTTP_ADMIN_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010054 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "admin-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010055 - name: HTTP_ADMIN_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010056 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "admin-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010057 - name: HTTP_NODE_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010058 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "node-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010059 - name: HTTP_NODE_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010060 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "node-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010061 - name: REST_CONF_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010062 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010063 - name: REST_CONF_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010064 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010065 volumeMounts:
66 - mountPath: /config-input
67 name: config-input
68 - mountPath: /config
69 name: config
Sylvain Desbureauxd9ede772020-11-19 17:04:40 +010070 image: {{ include "repositoryGenerator.image.envsubst" . }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010071 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72 name: {{ include "common.name" . }}-update-config
Dan Timoneycb0a81f2020-07-15 17:31:43 -040073{{ include "common.certInitializer.initContainer" . | indent 6 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010074 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020075 - /app/ready.py
Mike Elliott13fed112018-02-28 08:33:33 -050076 args:
77 - --container-name
jmac4f76af42018-03-28 20:36:47 +000078 - {{ .Values.config.dbPodName }}
Mike Elliott13fed112018-02-28 08:33:33 -050079 env:
80 - name: NAMESPACE
81 valueFrom:
82 fieldRef:
83 apiVersion: v1
84 fieldPath: metadata.namespace
Sylvain Desbureauxd9ede772020-11-19 17:04:40 +010085 image: {{ include "repositoryGenerator.image.readiness" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050086 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
87 name: {{ include "common.name" . }}-readiness
88 containers:
89 - name: {{ include "common.name" . }}
Sylvain Desbureauxd9ede772020-11-19 17:04:40 +010090 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Mike Elliott13fed112018-02-28 08:33:33 -050091 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
jmac4f76af42018-03-28 20:36:47 +000092 command: ["/bin/bash"]
Dan Timoneycb0a81f2020-07-15 17:31:43 -040093 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 Elliott13fed112018-02-28 08:33:33 -050094 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 Elliott13fed112018-02-28 08:33:33 -0500102 - name: SDNC_CONFIG_DIR
103 value: /opt/onap/sdnc/data/properties
104 volumeMounts:
Dan Timoneycb0a81f2020-07-15 17:31:43 -0400105{{ include "common.certInitializer.volumeMount" . | indent 10 }}
Mike Elliott13fed112018-02-28 08:33:33 -0500106 - 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
afenner291d7872018-05-23 14:19:55 +0000113 mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/conf/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500114 subPath: svclogic.properties
115 - name: config
afenner291d7872018-05-23 14:19:55 +0000116 mountPath: /opt/onap/ccsdk/dgbuilder/svclogic/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500117 subPath: svclogic.properties
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100118 - name: config
afenner291d7872018-05-23 14:19:55 +0000119 mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/customSettings.js
Mike Elliott13fed112018-02-28 08:33:33 -0500120 subPath: customSettings.js
121 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000122{{ include "common.resources" . | indent 12 }}
Mike Elliott13fed112018-02-28 08:33:33 -0500123 {{- if .Values.nodeSelector }}
124 nodeSelector:
125{{ toYaml .Values.nodeSelector | indent 10 }}
126 {{- end -}}
127 {{- if .Values.affinity }}
128 affinity:
129{{ toYaml .Values.affinity | indent 10 }}
130 {{- end }}
farida azmydc9aef02021-04-07 17:07:09 +0200131 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Mike Elliott13fed112018-02-28 08:33:33 -0500132 volumes:
Dan Timoneycb0a81f2020-07-15 17:31:43 -0400133{{ include "common.certInitializer.volumes" . | nindent 8 }}
Mike Elliott13fed112018-02-28 08:33:33 -0500134 - name: localtime
135 hostPath:
136 path: /etc/localtime
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100137 - name: config-input
Mike Elliott13fed112018-02-28 08:33:33 -0500138 configMap:
139 name: {{ include "common.fullname" . }}-config
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100140 - name: config
141 emptyDir:
142 medium: Memory
Mike Elliott13fed112018-02-28 08:33:33 -0500143 imagePullSecrets:
144 - name: "{{ include "common.namespace" . }}-docker-registry-key"