851c19f0e8900b03429168c7bc4419178e1f519b
[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: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   replicas: 1
22   selector: {{- include "common.selectors" . | nindent 4 }}
23   template:
24     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25     spec:
26       initContainers:
27       - command:
28         - /app/ready.py
29         args:
30         - --service-name
31         - sdnc
32         - --service-name
33         - consul
34         env:
35         - name: NAMESPACE
36           valueFrom:
37             fieldRef:
38               apiVersion: v1
39               fieldPath: metadata.namespace
40         image: {{ include "repositoryGenerator.image.readiness" . }}
41         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42         name: {{ include "common.name" . }}-readiness
43         resources:
44           limits:
45             cpu: "100m"
46             memory: "500Mi"
47           requests:
48             cpu: "3m"
49             memory: "20Mi"
50       containers:
51       - name: {{ include "common.name" . }}
52         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
53         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54         envFrom:
55           - configMapRef:
56               name: {{ include "common.release" . }}-sdnc-env
57         workingDir: "/app"
58         command: [ "bin/prom.sh" ]
59         volumeMounts:
60         - name: localtime
61           mountPath: /etc/localtime
62           readOnly: true
63         - name: prom-config
64           mountPath: /app/config
65         - name: prom-scripts
66           mountPath: /app/bin
67         - name: core-dns-keyfile
68           mountPath: /app/config/coredns
69         resources: {{ include "common.resources" . | nindent 10 }}
70       {{- if .Values.nodeSelector }}
71       nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
72       {{- end }}
73       {{- if .Values.affinity }}
74       affinity: {{ toYaml .Values.affinity | nindent 8 }}
75       {{- end }}
76       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
77       volumes:
78         - name: localtime
79           hostPath:
80             path: /etc/localtime
81         - name: prom-config
82           configMap:
83             name: {{ include "common.fullname" . }}-configmap
84         - name: prom-scripts
85           configMap:
86             name: {{ include "common.fullname" . }}-scripts
87             defaultMode: 0755
88         - name: core-dns-keyfile
89         {{- if .Values.persistence.enabled }}
90           persistentVolumeClaim:
91             claimName: {{ include "common.fullname" . }}
92         {{- else }}
93           emptyDir: {}
94         {{- end }}
95       {{- include "common.imagePullSecrets" . | nindent 6 }}