Merge "Unable to boot SNDC pod without AAF"
[oom.git] / kubernetes / sdnc / components / sdnc-prom / templates / deployment.yaml
1 {{/*
2 # 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.
15 */}}
16
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata:
20   name: {{ include "common.fullname" . }}
21   namespace: {{ include "common.namespace" . }}
22   labels:
23     app: {{ include "common.name" . }}
24     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
25     release: {{ include "common.release" . }}
26     heritage: {{ .Release.Service }}
27 spec:
28   selector:
29     matchLabels:
30       app: {{ include "common.name" . }}
31   replicas: 1
32   template:
33     metadata:
34       labels:
35         app: {{ include "common.name" . }}
36         release: {{ include "common.release" . }}
37     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:
61               name: {{ include "common.release" . }}-sdnc-env
62         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:
76 {{ include "common.resources" . | indent 12 }}
77         {{- 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
97         {{- if .Values.persistence.enabled }}
98           persistentVolumeClaim:
99             claimName: {{ include "common.fullname" . }}
100         {{- else }}
101           emptyDir: {}
102         {{- end }}
103       imagePullSecrets:
104         - name: {{ include "common.namespace" . }}-docker-registry-key"