blob: 3a728ad92f45d964b1cf280ed2236b13689c5ca9 [file] [log] [blame]
jmac065e2ce2018-03-29 01:18:02 +00001# Copyright © 2017 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
15apiVersion: 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" . }}
jmac065e2ce2018-03-29 01:18:02 +000024 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" . }}
jmac065e2ce2018-03-29 01:18:02 +000032 spec:
33 initContainers:
34 - command:
Krzysztof Opasiak71c80982020-02-22 02:12:02 +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: SDNC_DB_USER
41 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
42 - name: SDNC_DB_PASSWORD
43 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
44 - name: DB_FABRIC_USER
45 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "fabric-db-creds" "key" "login") | indent 10 }}
46 - name: DB_FABRIC_PASSWORD
47 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "fabric-db-creds" "key" "password") | indent 10 }}
48 - name: ODL_USER
49 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
50 - name: ODL_PASSWORD
51 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
52 - name: KEYSTORE_PASSWORD
53 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "keystore-password" "key" "password") | indent 10 }}
54 volumeMounts:
55 - mountPath: /config-input
56 name: config-input
57 - mountPath: /config
58 name: properties
59 image: "{{ .Values.global.envsubstImage }}"
60 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
61 name: {{ include "common.name" . }}-update-config
62
63 - command:
jmac065e2ce2018-03-29 01:18:02 +000064 - /root/ready.py
65 args:
66 - --container-name
Krzysztof Opasiak71c80982020-02-22 02:12:02 +010067 - {{ include "common.mariadbService" . }}
jmac065e2ce2018-03-29 01:18:02 +000068 - --container-name
69 - {{ .Values.config.sdncChartName }}
70 env:
71 - name: NAMESPACE
72 valueFrom:
73 fieldRef:
74 apiVersion: v1
75 fieldPath: metadata.namespace
76 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 name: {{ include "common.name" . }}-readiness
79 containers:
80 - name: {{ include "common.name" . }}
81 command: ["/bin/bash"]
82 args: ["-c", "cd /opt/onap/sdnc/admportal/shell && ./start_portal.sh"]
BorislavGdf11cd52018-05-06 12:55:20 +000083 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
jmac065e2ce2018-03-29 01:18:02 +000084 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
85 ports:
86 - containerPort: {{ .Values.service.internalPort }}
87 # disable liveness probe when breakpoints set in debugger
88 # so K8s doesn't restart unresponsive container
jmac2d276e02018-04-18 01:25:38 +000089 {{ if .Values.liveness.enabled }}
jmac065e2ce2018-03-29 01:18:02 +000090 livenessProbe:
91 tcpSocket:
92 port: {{ .Values.service.internalPort }}
93 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.liveness.periodSeconds }}
jmac2d276e02018-04-18 01:25:38 +000095 {{ end }}
jmac065e2ce2018-03-29 01:18:02 +000096 readinessProbe:
97 tcpSocket:
98 port: {{ .Values.service.internalPort }}
99 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
100 periodSeconds: {{ .Values.readiness.periodSeconds }}
101 env:
102 - name: MYSQL_ROOT_PASSWORD
Krzysztof Opasiak71c80982020-02-22 02:12:02 +0100103 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-root-password" "key" "password") | indent 14 }}
jmac065e2ce2018-03-29 01:18:02 +0000104 - name: SDNC_CONFIG_DIR
105 value: "{{ .Values.config.configDir }}"
106 volumeMounts:
107 - mountPath: /etc/localtime
108 name: localtime
109 readOnly: true
jmaca68f4cb2018-05-10 22:44:19 +0000110 - mountPath: {{ .Values.config.configDir }}/admportal.json
111 name: properties
112 subPath: admportal.json
113 - mountPath: {{ .Values.config.configDir }}/dblib.properties
114 name: properties
115 subPath: dblib.properties
116 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
117 name: properties
118 subPath: svclogic.properties
119 - mountPath: {{ .Values.config.configDir }}/svclogic.properties.sdnctldb01
120 name: properties
121 subPath: svclogic.properties
122 - mountPath: {{ .Values.config.configDir }}/svclogic.properties.sdnctldb02
123 name: properties
124 subPath: svclogic.properties.sdnctldb02
jmac065e2ce2018-03-29 01:18:02 +0000125 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000126{{ include "common.resources" . | indent 12 }}
jmac065e2ce2018-03-29 01:18:02 +0000127 {{- if .Values.nodeSelector }}
128 nodeSelector:
129{{ toYaml .Values.nodeSelector | indent 10 }}
130 {{- end -}}
131 {{- if .Values.affinity }}
132 affinity:
133{{ toYaml .Values.affinity | indent 10 }}
134 {{- end }}
135 volumes:
136 - name: localtime
137 hostPath:
138 path: /etc/localtime
Krzysztof Opasiak71c80982020-02-22 02:12:02 +0100139 - name: config-input
jmac065e2ce2018-03-29 01:18:02 +0000140 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000141 name: {{ include "common.fullname" . }}
142 defaultMode: 0644
Krzysztof Opasiak71c80982020-02-22 02:12:02 +0100143 - name: properties
144 emptyDir:
145 medium: Memory
jmac065e2ce2018-03-29 01:18:02 +0000146 imagePullSecrets:
BorislavGdf11cd52018-05-06 12:55:20 +0000147 - name: "{{ include "common.namespace" . }}-docker-registry-key"