06a5168bccc40fb53d3713a292945b7a7ffcecf5
[oom.git] / kubernetes / cli / templates / deployment.yaml
1 {{/*
2 # Copyright © 2017 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.
15 */}}
16
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
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" . }}
28           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
29           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
30           ports: {{ include "common.containerPorts" . | nindent 12  }}
31           {{- if eq .Values.liveness.enabled true }}
32           livenessProbe:
33             httpGet:
34               port: {{ .Values.liveness.port }}
35               path: {{ .Values.liveness.path }}
36             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
37             periodSeconds: {{ .Values.liveness.periodSeconds }}
38           {{ end -}}
39           readinessProbe:
40             httpGet:
41               port: {{ .Values.readiness.port }}
42               path: {{ .Values.readiness.path }}
43             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
44             periodSeconds: {{ .Values.readiness.periodSeconds }}
45           volumeMounts:
46           - name: lighttpd
47             mountPath: /etc/lighttpd/lighttpd.conf
48             subPath: lighttpd.conf
49             readOnly: true
50           env:
51             - name: OPEN_CLI_MODE
52               value: "{{ .Values.config.climode }}"
53           resources:
54 {{ include "common.resources" . | indent 12 }}
55         {{- if .Values.nodeSelector }}
56         nodeSelector:
57 {{ toYaml .Values.nodeSelector | indent 10 }}
58         {{- end -}}
59         {{- if .Values.affinity }}
60         affinity:
61 {{ toYaml .Values.affinity | indent 10 }}
62         {{- end }}
63       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
64       volumes:
65       - name: lighttpd
66         configMap:
67           name: {{ include "common.fullname" . }}
68       imagePullSecrets:
69       - name: "{{ include "common.namespace" . }}-docker-registry-key"