blob: 754e0d0f507991ac5e46bbf73fb3c78a04aa14a3 [file] [log] [blame]
Jakub Latusek50530762020-10-21 13:36:29 +02001{{/*
Marek Szwalkiewicza6625682020-03-02 17:09:18 +00002# Copyright (c) 2020 Bell Canada, Deutsche Telekom
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.
Jakub Latusek50530762020-10-21 13:36:29 +020015*/}}
Marek Szwalkiewicza6625682020-03-02 17:09:18 +000016
17apiVersion: apps/v1
18kind: Deployment
19metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20spec:
21 replicas: {{ .Values.replicaCount }}
22 selector: {{- include "common.selectors" . | nindent 4 }}
23 template:
24 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25 spec:
26 containers:
27 - name: {{ include "common.name" . }}
Sylvain Desbureaux503b2292020-11-21 22:29:17 +010028 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Marek Szwalkiewicza6625682020-03-02 17:09:18 +000029 command:
30 - bash
31 args:
32 - '-c'
33 - 'AUTH_TOKEN=`echo -n $API_USERNAME:$API_PASSWORD | base64` /opt/app/onap/python/start.sh'
34 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
35 ports: {{- include "common.containerPorts" . | nindent 12 }}
36 {{ if .Values.liveness.enabled }}
37 livenessProbe:
38 tcpSocket:
39 port: {{ .Values.liveness.port }}
40 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
41 periodSeconds: {{ .Values.liveness.periodSeconds }}
42 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
43 {{ end }}
44 readinessProbe:
45 tcpSocket:
46 port: {{ .Values.liveness.port }}
47 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
48 periodSeconds: {{ .Values.readiness.periodSeconds }}
49 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
50 env:
51 - name: APP_PORT
52 value: {{ .Values.config.appPort }}
53 - name: AUTH_TYPE
54 value: {{ .Values.config.authType }}
55 - name: API_USERNAME
Krzysztof Opasiak4372e832020-09-01 19:17:20 +020056 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-credentials" "key" "login") | nindent 12 }}
Marek Szwalkiewicza6625682020-03-02 17:09:18 +000057 - name: API_PASSWORD
Krzysztof Opasiak4372e832020-09-01 19:17:20 +020058 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-credentials" "key" "password") | nindent 12 }}
Marek Szwalkiewicza6625682020-03-02 17:09:18 +000059 - name: LOG_FILE
60 value: {{ .Values.config.logFile }}
61 - name: ARTIFACT_MANAGER_PORT
62 value: {{ .Values.config.artifactManagerPort }}
63 - name: ARTIFACT_MANAGER_SERVER_LOG_FILE
64 value: {{ .Values.config.artifactManagerLogFile }}
65 volumeMounts:
66 - mountPath: /etc/localtime
67 name: localtime
68 readOnly: true
69 - mountPath: {{ .Values.persistence.deployedBlueprint }}
70 name: {{ include "common.fullname" . }}-blueprints
71 resources:
72{{ include "common.resources" . | nindent 12 }}
73 {{- if .Values.nodeSelector }}
74 nodeSelector:
75{{ toYaml .Values.nodeSelector | nindent 10 }}
76 {{- end -}}
77 {{- if .Values.affinity }}
78 affinity:
79{{ toYaml .Values.affinity | nindent 10 }}
80 {{- end }}
farida azmyffad0322021-04-09 14:18:14 +020081 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Marek Szwalkiewicza6625682020-03-02 17:09:18 +000082 volumes:
83 - name: localtime
84 hostPath:
85 path: /etc/localtime
86 # Py executor shares the blueprintsprocessor storage (for now) to
87 # share uploaded CBA files. In the future it will be deprecated
88 # when all parts of the CDS will make use of Artifact Manager
89 - name: {{ include "common.fullname" . }}-blueprints
90 persistentVolumeClaim:
91 claimName: {{ include "common.release" . }}-cds-blueprints
92 imagePullSecrets:
93 - name: "{{ include "common.namespace" . }}-docker-registry-key"