blob: e1fac77a97426c470c983fb5076c55e796db9b1a [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
Mike Elliott13fed112018-02-28 08:33:33 -050017apiVersion: extensions/v1beta1
18kind: 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 }}
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010033 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050034 spec:
35 initContainers:
36 - command:
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010037 - sh
38 args:
39 - -c
40 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
41 env:
42 - name: DB_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010043 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010044 - name: DB_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010045 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010046 - name: HTTP_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010047 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "http-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010048 - name: HTTP_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010049 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "http-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010050 - name: HTTP_ADMIN_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010051 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "admin-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010052 - name: HTTP_ADMIN_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010053 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "admin-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010054 - name: HTTP_NODE_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010055 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "node-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010056 - name: HTTP_NODE_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010057 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "node-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010058 - name: REST_CONF_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010059 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010060 - name: REST_CONF_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010061 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010062 volumeMounts:
63 - mountPath: /config-input
64 name: config-input
65 - mountPath: /config
66 name: config
67 image: "{{ .Values.global.envsubstImage }}"
68 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
69 name: {{ include "common.name" . }}-update-config
70 - command:
Mike Elliott13fed112018-02-28 08:33:33 -050071 - /root/ready.py
72 args:
73 - --container-name
jmac4f76af42018-03-28 20:36:47 +000074 - {{ .Values.config.dbPodName }}
Mike Elliott13fed112018-02-28 08:33:33 -050075 env:
76 - name: NAMESPACE
77 valueFrom:
78 fieldRef:
79 apiVersion: v1
80 fieldPath: metadata.namespace
81 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
82 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
83 name: {{ include "common.name" . }}-readiness
84 containers:
85 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000086 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Mike Elliott13fed112018-02-28 08:33:33 -050087 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
jmac4f76af42018-03-28 20:36:47 +000088 command: ["/bin/bash"]
89 args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait"]
Mike Elliott13fed112018-02-28 08:33:33 -050090 ports:
91 - containerPort: {{ .Values.service.internalPort }}
92 readinessProbe:
93 tcpSocket:
94 port: {{ .Values.service.internalPort }}
95 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
96 periodSeconds: {{ .Values.readiness.periodSeconds }}
97 env:
Mike Elliott13fed112018-02-28 08:33:33 -050098 - name: SDNC_CONFIG_DIR
99 value: /opt/onap/sdnc/data/properties
100 volumeMounts:
101 - mountPath: /etc/localtime
102 name: localtime
103 readOnly: true
104 - name: config
105 mountPath: /opt/app/application.properties
106 subPath: application.properties
107 - name: config
afenner291d7872018-05-23 14:19:55 +0000108 mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/conf/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500109 subPath: svclogic.properties
110 - name: config
afenner291d7872018-05-23 14:19:55 +0000111 mountPath: /opt/onap/ccsdk/dgbuilder/svclogic/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500112 subPath: svclogic.properties
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100113 - name: config
afenner291d7872018-05-23 14:19:55 +0000114 mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/customSettings.js
Mike Elliott13fed112018-02-28 08:33:33 -0500115 subPath: customSettings.js
116 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000117{{ include "common.resources" . | indent 12 }}
Mike Elliott13fed112018-02-28 08:33:33 -0500118 {{- if .Values.nodeSelector }}
119 nodeSelector:
120{{ toYaml .Values.nodeSelector | indent 10 }}
121 {{- end -}}
122 {{- if .Values.affinity }}
123 affinity:
124{{ toYaml .Values.affinity | indent 10 }}
125 {{- end }}
126 volumes:
127 - name: localtime
128 hostPath:
129 path: /etc/localtime
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100130 - name: config-input
Mike Elliott13fed112018-02-28 08:33:33 -0500131 configMap:
132 name: {{ include "common.fullname" . }}-config
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100133 - name: config
134 emptyDir:
135 medium: Memory
Mike Elliott13fed112018-02-28 08:33:33 -0500136 imagePullSecrets:
137 - name: "{{ include "common.namespace" . }}-docker-registry-key"