blob: b3f0ab05a3a750c72ed9225c3b0ed2744a8877ca [file] [log] [blame]
vaibhavjayasea9aee02018-08-31 06:22:26 +00001# Copyright © 2018 AT&T, Amdocs, Bell Canada
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Mike Elliott13fed112018-02-28 08:33:33 -050015apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010023 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050024 heritage: {{ .Release.Service }}
25spec:
26 replicas: {{ .Values.replicaCount }}
27 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010031 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050032 spec:
33 initContainers:
34 - command:
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010035 - sh
36 args:
37 - -c
38 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
39 env:
40 - name: DB_USER
41 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 10 }}
42 - name: DB_PASSWORD
43 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 10 }}
44 - name: HTTP_USER
45 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "http-user-creds" "key" "login") | indent 10 }}
46 - name: HTTP_PASSWORD
47 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "http-user-creds" "key" "password") | indent 10 }}
48 - name: HTTP_ADMIN_USER
49 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "admin-creds" "key" "login") | indent 10 }}
50 - name: HTTP_ADMIN_PASSWORD
51 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "admin-creds" "key" "password") | indent 10 }}
52 - name: HTTP_NODE_USER
53 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "node-creds" "key" "login") | indent 10 }}
54 - name: HTTP_NODE_PASSWORD
55 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "node-creds" "key" "password") | indent 10 }}
56 - name: REST_CONF_USER
57 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
58 - name: REST_CONF_PASSWORD
59 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
60 volumeMounts:
61 - mountPath: /config-input
62 name: config-input
63 - mountPath: /config
64 name: config
65 image: "{{ .Values.global.envsubstImage }}"
66 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67 name: {{ include "common.name" . }}-update-config
68 - command:
Mike Elliott13fed112018-02-28 08:33:33 -050069 - /root/ready.py
70 args:
71 - --container-name
jmac4f76af42018-03-28 20:36:47 +000072 - {{ .Values.config.dbPodName }}
Mike Elliott13fed112018-02-28 08:33:33 -050073 env:
74 - name: NAMESPACE
75 valueFrom:
76 fieldRef:
77 apiVersion: v1
78 fieldPath: metadata.namespace
79 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
80 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 name: {{ include "common.name" . }}-readiness
82 containers:
83 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000084 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Mike Elliott13fed112018-02-28 08:33:33 -050085 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
jmac4f76af42018-03-28 20:36:47 +000086 command: ["/bin/bash"]
87 args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait"]
Mike Elliott13fed112018-02-28 08:33:33 -050088 ports:
89 - containerPort: {{ .Values.service.internalPort }}
90 readinessProbe:
91 tcpSocket:
92 port: {{ .Values.service.internalPort }}
93 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.readiness.periodSeconds }}
95 env:
Mike Elliott13fed112018-02-28 08:33:33 -050096 - name: SDNC_CONFIG_DIR
97 value: /opt/onap/sdnc/data/properties
98 volumeMounts:
99 - mountPath: /etc/localtime
100 name: localtime
101 readOnly: true
102 - name: config
103 mountPath: /opt/app/application.properties
104 subPath: application.properties
105 - name: config
afenner291d7872018-05-23 14:19:55 +0000106 mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/conf/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500107 subPath: svclogic.properties
108 - name: config
afenner291d7872018-05-23 14:19:55 +0000109 mountPath: /opt/onap/ccsdk/dgbuilder/svclogic/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500110 subPath: svclogic.properties
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100111 - name: config
afenner291d7872018-05-23 14:19:55 +0000112 mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/customSettings.js
Mike Elliott13fed112018-02-28 08:33:33 -0500113 subPath: customSettings.js
114 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000115{{ include "common.resources" . | indent 12 }}
Mike Elliott13fed112018-02-28 08:33:33 -0500116 {{- if .Values.nodeSelector }}
117 nodeSelector:
118{{ toYaml .Values.nodeSelector | indent 10 }}
119 {{- end -}}
120 {{- if .Values.affinity }}
121 affinity:
122{{ toYaml .Values.affinity | indent 10 }}
123 {{- end }}
124 volumes:
125 - name: localtime
126 hostPath:
127 path: /etc/localtime
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100128 - name: config-input
Mike Elliott13fed112018-02-28 08:33:33 -0500129 configMap:
130 name: {{ include "common.fullname" . }}-config
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100131 - name: config
132 emptyDir:
133 medium: Memory
Mike Elliott13fed112018-02-28 08:33:33 -0500134 imagePullSecrets:
135 - name: "{{ include "common.namespace" . }}-docker-registry-key"