blob: 9f8cdf2cc0c6b7d6a93e80be32a39943c9ffd242 [file] [log] [blame]
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +01001{{/*
jmac065e2ce2018-03-29 01:18:02 +00002# Copyright © 2017 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 Opasiakab7a6bb2020-03-24 03:30:51 +010015*/}}
jmac065e2ce2018-03-29 01:18:02 +000016
17apiVersion: 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" . }}
jmac065e2ce2018-03-29 01:18:02 +000026 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" . }}
jmac065e2ce2018-03-29 01:18:02 +000034 spec:
35 initContainers:
36 - command:
Krzysztof Opasiak71c80982020-02-22 02:12:02 +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: SDNC_DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010043 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
Krzysztof Opasiak71c80982020-02-22 02:12:02 +010044 - name: SDNC_DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010045 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Krzysztof Opasiak71c80982020-02-22 02:12:02 +010046 - name: DB_FABRIC_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010047 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "fabric-db-creds" "key" "login") | indent 10 }}
Krzysztof Opasiak71c80982020-02-22 02:12:02 +010048 - name: DB_FABRIC_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010049 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "fabric-db-creds" "key" "password") | indent 10 }}
Krzysztof Opasiak71c80982020-02-22 02:12:02 +010050 - name: ODL_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010051 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
Krzysztof Opasiak71c80982020-02-22 02:12:02 +010052 - name: ODL_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010053 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
Krzysztof Opasiak71c80982020-02-22 02:12:02 +010054 - name: KEYSTORE_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010055 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-password" "key" "password") | indent 10 }}
Krzysztof Opasiak71c80982020-02-22 02:12:02 +010056 volumeMounts:
57 - mountPath: /config-input
58 name: config-input
59 - mountPath: /config
60 name: properties
61 image: "{{ .Values.global.envsubstImage }}"
62 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63 name: {{ include "common.name" . }}-update-config
64
65 - command:
jmac065e2ce2018-03-29 01:18:02 +000066 - /root/ready.py
67 args:
68 - --container-name
Krzysztof Opasiak71c80982020-02-22 02:12:02 +010069 - {{ include "common.mariadbService" . }}
jmac065e2ce2018-03-29 01:18:02 +000070 - --container-name
71 - {{ .Values.config.sdncChartName }}
72 env:
73 - name: NAMESPACE
74 valueFrom:
75 fieldRef:
76 apiVersion: v1
77 fieldPath: metadata.namespace
78 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
79 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
80 name: {{ include "common.name" . }}-readiness
81 containers:
82 - name: {{ include "common.name" . }}
83 command: ["/bin/bash"]
84 args: ["-c", "cd /opt/onap/sdnc/admportal/shell && ./start_portal.sh"]
BorislavGdf11cd52018-05-06 12:55:20 +000085 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
jmac065e2ce2018-03-29 01:18:02 +000086 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
87 ports:
88 - containerPort: {{ .Values.service.internalPort }}
89 # disable liveness probe when breakpoints set in debugger
90 # so K8s doesn't restart unresponsive container
jmac2d276e02018-04-18 01:25:38 +000091 {{ if .Values.liveness.enabled }}
jmac065e2ce2018-03-29 01:18:02 +000092 livenessProbe:
93 tcpSocket:
94 port: {{ .Values.service.internalPort }}
95 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
96 periodSeconds: {{ .Values.liveness.periodSeconds }}
jmac2d276e02018-04-18 01:25:38 +000097 {{ end }}
jmac065e2ce2018-03-29 01:18:02 +000098 readinessProbe:
99 tcpSocket:
100 port: {{ .Values.service.internalPort }}
101 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
102 periodSeconds: {{ .Values.readiness.periodSeconds }}
103 env:
104 - name: MYSQL_ROOT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100105 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 14 }}
jmac065e2ce2018-03-29 01:18:02 +0000106 - name: SDNC_CONFIG_DIR
107 value: "{{ .Values.config.configDir }}"
108 volumeMounts:
109 - mountPath: /etc/localtime
110 name: localtime
111 readOnly: true
jmaca68f4cb2018-05-10 22:44:19 +0000112 - mountPath: {{ .Values.config.configDir }}/admportal.json
113 name: properties
114 subPath: admportal.json
115 - mountPath: {{ .Values.config.configDir }}/dblib.properties
116 name: properties
117 subPath: dblib.properties
118 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
119 name: properties
120 subPath: svclogic.properties
121 - mountPath: {{ .Values.config.configDir }}/svclogic.properties.sdnctldb01
122 name: properties
123 subPath: svclogic.properties
124 - mountPath: {{ .Values.config.configDir }}/svclogic.properties.sdnctldb02
125 name: properties
126 subPath: svclogic.properties.sdnctldb02
jmac065e2ce2018-03-29 01:18:02 +0000127 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000128{{ include "common.resources" . | indent 12 }}
jmac065e2ce2018-03-29 01:18:02 +0000129 {{- if .Values.nodeSelector }}
130 nodeSelector:
131{{ toYaml .Values.nodeSelector | indent 10 }}
132 {{- end -}}
133 {{- if .Values.affinity }}
134 affinity:
135{{ toYaml .Values.affinity | indent 10 }}
136 {{- end }}
137 volumes:
138 - name: localtime
139 hostPath:
140 path: /etc/localtime
Krzysztof Opasiak71c80982020-02-22 02:12:02 +0100141 - name: config-input
jmac065e2ce2018-03-29 01:18:02 +0000142 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000143 name: {{ include "common.fullname" . }}
144 defaultMode: 0644
Krzysztof Opasiak71c80982020-02-22 02:12:02 +0100145 - name: properties
146 emptyDir:
147 medium: Memory
jmac065e2ce2018-03-29 01:18:02 +0000148 imagePullSecrets:
BorislavGdf11cd52018-05-06 12:55:20 +0000149 - name: "{{ include "common.namespace" . }}-docker-registry-key"