blob: 18963f94f0d17b42e76b5e13353a6f1171db36a3 [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
milaszki326a5e72020-07-07 11:59:35 +000017apiVersion: apps/v1
Mike Elliott13fed112018-02-28 08:33:33 -050018kind: Deployment
Andreas Geissler2af50792023-03-27 17:11:27 +020019metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Mike Elliott13fed112018-02-28 08:33:33 -050020spec:
Andreas Geissler2af50792023-03-27 17:11:27 +020021 selector: {{- include "common.selectors" . | nindent 4 }}
Mike Elliott13fed112018-02-28 08:33:33 -050022 replicas: {{ .Values.replicaCount }}
23 template:
Andreas Geissler2af50792023-03-27 17:11:27 +020024 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Mike Elliott13fed112018-02-28 08:33:33 -050025 spec:
26 initContainers:
27 - command:
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010028 - sh
29 args:
30 - -c
31 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
32 env:
33 - name: DB_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010034 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010035 - name: DB_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010036 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010037 - name: HTTP_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010038 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "http-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010039 - name: HTTP_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010040 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "http-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010041 - name: HTTP_ADMIN_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010042 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "admin-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010043 - name: HTTP_ADMIN_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010044 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "admin-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010045 - name: HTTP_NODE_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010046 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "node-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010047 - name: HTTP_NODE_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010048 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "node-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010049 - name: REST_CONF_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010050 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010051 - name: REST_CONF_PASSWORD
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010052 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010053 volumeMounts:
54 - mountPath: /config-input
55 name: config-input
56 - mountPath: /config
57 name: config
Sylvain Desbureauxd9ede772020-11-19 17:04:40 +010058 image: {{ include "repositoryGenerator.image.envsubst" . }}
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +010059 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 name: {{ include "common.name" . }}-update-config
61 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020062 - /app/ready.py
Mike Elliott13fed112018-02-28 08:33:33 -050063 args:
Andreas Geisslercfd84342023-08-16 17:18:49 +020064 - --app-name
jmac4f76af42018-03-28 20:36:47 +000065 - {{ .Values.config.dbPodName }}
Mike Elliott13fed112018-02-28 08:33:33 -050066 env:
67 - name: NAMESPACE
68 valueFrom:
69 fieldRef:
70 apiVersion: v1
71 fieldPath: metadata.namespace
Sylvain Desbureauxd9ede772020-11-19 17:04:40 +010072 image: {{ include "repositoryGenerator.image.readiness" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050073 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
74 name: {{ include "common.name" . }}-readiness
Andreas Geissler47537432024-02-27 08:55:23 +010075 resources:
76 limits:
77 cpu: "100m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010078 memory: "500Mi"
Andreas Geissler47537432024-02-27 08:55:23 +010079 requests:
80 cpu: "3m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010081 memory: "20Mi"
Mike Elliott13fed112018-02-28 08:33:33 -050082 containers:
83 - name: {{ include "common.name" . }}
Sylvain Desbureauxd9ede772020-11-19 17:04:40 +010084 image: {{ include "repositoryGenerator.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"]
Andreas Geissler2af50792023-03-27 17:11:27 +020087 args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait"]
88 ports: {{- include "common.containerPorts" . | indent 10 }}
Mike Elliott13fed112018-02-28 08:33:33 -050089 readinessProbe:
90 tcpSocket:
91 port: {{ .Values.service.internalPort }}
92 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
93 periodSeconds: {{ .Values.readiness.periodSeconds }}
94 env:
Mike Elliott13fed112018-02-28 08:33:33 -050095 - name: SDNC_CONFIG_DIR
96 value: /opt/onap/sdnc/data/properties
97 volumeMounts:
98 - mountPath: /etc/localtime
99 name: localtime
100 readOnly: true
101 - name: config
102 mountPath: /opt/app/application.properties
103 subPath: application.properties
104 - name: config
afenner291d7872018-05-23 14:19:55 +0000105 mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/conf/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500106 subPath: svclogic.properties
107 - name: config
afenner291d7872018-05-23 14:19:55 +0000108 mountPath: /opt/onap/ccsdk/dgbuilder/svclogic/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500109 subPath: svclogic.properties
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100110 - name: config
afenner291d7872018-05-23 14:19:55 +0000111 mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/customSettings.js
Mike Elliott13fed112018-02-28 08:33:33 -0500112 subPath: customSettings.js
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100113 resources: {{ include "common.resources" . | nindent 12 }}
Mike Elliott13fed112018-02-28 08:33:33 -0500114 {{- if .Values.nodeSelector }}
115 nodeSelector:
116{{ toYaml .Values.nodeSelector | indent 10 }}
117 {{- end -}}
118 {{- if .Values.affinity }}
119 affinity:
120{{ toYaml .Values.affinity | indent 10 }}
121 {{- end }}
farida azmydc9aef02021-04-07 17:07:09 +0200122 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Mike Elliott13fed112018-02-28 08:33:33 -0500123 volumes:
124 - name: localtime
125 hostPath:
126 path: /etc/localtime
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100127 - name: config-input
Mike Elliott13fed112018-02-28 08:33:33 -0500128 configMap:
129 name: {{ include "common.fullname" . }}-config
Krzysztof Opasiakacdd90c2020-02-17 22:05:51 +0100130 - name: config
131 emptyDir:
132 medium: Memory
Andreas Geisslerbd0d31a2024-03-20 09:51:32 +0100133 {{- include "common.imagePullSecrets" . | nindent 6 }}