blob: c702012694f01104b0980c5d139839c132db288e [file] [log] [blame]
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +01001{{/*
Mohammadreza Pasandidehb642ee52018-06-19 15:19:53 -04002# Copyright © 2018 Amdocs
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*/}}
Mohammadreza Pasandidehb642ee52018-06-19 15:19:53 -040016
Grzegorz-Lis1318a772020-07-23 15:08:43 +020017apiVersion: apps/v1
Mohammadreza Pasandidehb642ee52018-06-19 15:19:53 -040018kind: 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" . }}
Mohammadreza Pasandidehb642ee52018-06-19 15:19:53 -040026 heritage: {{ .Release.Service }}
27spec:
Grzegorz-Lis1318a772020-07-23 15:08:43 +020028 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
Mohammadreza Pasandidehb642ee52018-06-19 15:19:53 -040031 replicas: 1
32 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
Mohammadreza Pasandidehb642ee52018-06-19 15:19:53 -040037 spec:
38 initContainers:
39 - command:
40 - /root/ready.py
41 args:
42 - --container-name
43 - sdnc
44 - --container-name
45 - consul
46 env:
47 - name: NAMESPACE
48 valueFrom:
49 fieldRef:
50 apiVersion: v1
51 fieldPath: metadata.namespace
52 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
53 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 name: {{ include "common.name" . }}-readiness
55 containers:
56 - name: {{ include "common.name" . }}
57 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
58 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
59 envFrom:
60 - configMapRef:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010061 name: {{ include "common.release" . }}-sdnc-env
Mohammadreza Pasandidehb642ee52018-06-19 15:19:53 -040062 workingDir: "/app"
63 command: [ "bin/prom.sh" ]
64 volumeMounts:
65 - name: localtime
66 mountPath: /etc/localtime
67 readOnly: true
68 - name: prom-config
69 mountPath: /app/config
70 - name: prom-scripts
71 mountPath: /app/bin
72 - name: core-dns-keyfile
73 mountPath: /app/config/coredns
74
75 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000076{{ include "common.resources" . | indent 12 }}
Mohammadreza Pasandidehb642ee52018-06-19 15:19:53 -040077 {{- if .Values.nodeSelector }}
78 nodeSelector:
79{{ toYaml .Values.nodeSelector | indent 10 }}
80 {{- end -}}
81 {{- if .Values.affinity }}
82 affinity:
83{{ toYaml .Values.affinity | indent 10 }}
84 {{- end }}
85 volumes:
86 - name: localtime
87 hostPath:
88 path: /etc/localtime
89 - name: prom-config
90 configMap:
91 name: {{ include "common.fullname" . }}-configmap
92 - name: prom-scripts
93 configMap:
94 name: {{ include "common.fullname" . }}-scripts
95 defaultMode: 0755
96 - name: core-dns-keyfile
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +010097 {{- if .Values.persistence.enabled }}
98 persistentVolumeClaim:
99 claimName: {{ include "common.fullname" . }}
100 {{- else }}
101 emptyDir: {}
102 {{- end }}
Mohammadreza Pasandidehb642ee52018-06-19 15:19:53 -0400103 imagePullSecrets:
104 - name: {{ include "common.namespace" . }}-docker-registry-key"