blob: 031bb7ef357d4a0fb7e6685d7399f7371faaaf79 [file] [log] [blame]
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +01001{{/*
jmac7c434672018-05-11 20:14:17 +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*/}}
jmac7c434672018-05-11 20:14:17 +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" . }}
jmac7c434672018-05-11 20:14:17 +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" . }}
jmac7c434672018-05-11 20:14:17 +000034 spec:
35 initContainers:
36 - command:
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +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 Opasiakab7a6bb2020-03-24 03:30:51 +010043 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010044 - name: DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010045 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010046 - name: REST_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010047 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "rest-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010048 - name: REST_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010049 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "rest-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010050 volumeMounts:
51 - mountPath: /config-input
52 name: config-input
53 - mountPath: /config
54 name: config
55 image: "{{ .Values.global.envsubstImage }}"
56 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57 name: {{ include "common.name" . }}-update-config
58
59 - command:
jmac7c434672018-05-11 20:14:17 +000060 - /root/ready.py
61 args:
62 - --container-name
63 - {{ .Values.config.sdncChartName }}
64 env:
65 - name: NAMESPACE
66 valueFrom:
67 fieldRef:
68 apiVersion: v1
69 fieldPath: metadata.namespace
70 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
71 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72 name: {{ include "common.name" . }}-readiness
73 containers:
74 - name: {{ include "common.name" . }}
Timoney, Dan (dt5972)3a2802f2019-02-20 13:58:24 -050075 command: ["/bin/bash"]
76 args: ["-c", "cd /opt/onap/ccsdk && ./startAnsibleServer.sh"]
77
jmac7c434672018-05-11 20:14:17 +000078 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
79 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
80 ports:
81 - containerPort: {{ .Values.service.internalPort }}
82 # disable liveness probe when breakpoints set in debugger
83 # so K8s doesn't restart unresponsive container
84 {{ if .Values.liveness.enabled }}
85 livenessProbe:
86 tcpSocket:
87 port: {{ .Values.service.internalPort }}
88 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
89 periodSeconds: {{ .Values.liveness.periodSeconds }}
90 {{ end }}
91 readinessProbe:
92 tcpSocket:
93 port: {{ .Values.service.internalPort }}
94 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
95 periodSeconds: {{ .Values.readiness.periodSeconds }}
96 volumeMounts:
97 - mountPath: /etc/localtime
98 name: localtime
99 readOnly: true
100 - mountPath: {{ .Values.config.configDir }}/RestServer_config
101 name: config
102 subPath: RestServer_config
103 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000104{{ include "common.resources" . | indent 12 }}
jmac7c434672018-05-11 20:14:17 +0000105 {{- if .Values.nodeSelector }}
106 nodeSelector:
107{{ toYaml .Values.nodeSelector | indent 10 }}
108 {{- end -}}
109 {{- if .Values.affinity }}
110 affinity:
111{{ toYaml .Values.affinity | indent 10 }}
112 {{- end }}
113 volumes:
114 - name: localtime
115 hostPath:
116 path: /etc/localtime
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +0100117 - name: config-input
jmac7c434672018-05-11 20:14:17 +0000118 configMap:
119 name: {{ include "common.fullname" . }}
120 defaultMode: 0644
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +0100121 - name: config
122 emptyDir:
123 medium: Memory
jmac7c434672018-05-11 20:14:17 +0000124 imagePullSecrets:
toshrajbhardwaj72b5f0f2018-09-13 02:45:22 +0000125 - name: "{{ include "common.namespace" . }}-docker-registry-key"