ed5876b0dd8df45ec99d751518c1e232d72afec3
[oom.git] / kubernetes / cds / components / cds-ui / templates / deployment.yaml
1 {{/*
2 # Copyright © 2018 Orange
3 # Modifications Copyright © 2018  Amdocs, Bell Canada
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 */}}
17
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
21 spec:
22   replicas: {{ .Values.replicaCount }}
23   selector: {{- include "common.selectors" . | nindent 4 }}
24   template:
25     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
26     spec:
27       containers:
28         - name: {{ include "common.name" . }}
29           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
30           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
31           ports: {{- include "common.containerPorts" . | nindent 12 }}
32           # disable liveness probe when breakpoints set in debugger
33           # so K8s doesn't restart unresponsive container
34           {{ if .Values.liveness.enabled }}
35           livenessProbe:
36             tcpSocket:
37               port: {{ .Values.service.internalPort }}
38             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
39             periodSeconds: {{ .Values.liveness.periodSeconds }}
40           {{ end }}
41           env:
42             - name: HOST
43               value: 0.0.0.0
44             - name: PROTOCOL
45               value: "{{ .Values.config.env.protocol }}"
46             - name: APP_ACTION_DEPLOY_BLUEPRINT_GRPC_ENABLED
47               value: "{{ .Values.config.app.action.deployBlueprint.grpcEnabled }}"
48             - name: API_BLUEPRINT_CONTROLLER_HTTP_BASE_URL
49               value: {{ .Values.config.api.controller.http.baseUrl }}
50             - name: API_BLUEPRINT_CONTROLLER_HTTP_AUTH_TOKEN
51               value: {{ .Values.config.api.controller.http.authToken }}
52             - name: API_BLUEPRINT_PROCESSOR_HTTP_BASE_URL
53               value: {{ .Values.config.api.processor.http.baseUrl }}
54             - name: API_BLUEPRINT_PROCESSOR_HTTP_AUTH_TOKEN
55               value: {{ .Values.config.api.processor.http.authToken }}
56             - name: API_BLUEPRINT_PROCESSOR_GRPC_HOST
57               value: {{ .Values.config.api.processor.grpc.host }}
58             - name: API_BLUEPRINT_PROCESSOR_GRPC_PORT
59               value: "{{ .Values.config.api.processor.grpc.port }}"
60             - name: API_BLUEPRINT_PROCESSOR_GRPC_AUTH_TOKEN
61               value: {{ .Values.config.api.processor.grpc.authToken }}
62           readinessProbe:
63             tcpSocket:
64               port: {{ .Values.service.internalPort }}
65             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
66             periodSeconds: {{ .Values.readiness.periodSeconds }}
67           volumeMounts:
68             - mountPath: /etc/localtime
69               name: localtime
70               readOnly: true
71           resources: {{ include "common.resources" . | nindent 12 }}
72         {{- if .Values.nodeSelector }}
73         nodeSelector:
74 {{ toYaml .Values.nodeSelector | indent 10 }}
75         {{- end -}}
76         {{- if .Values.affinity }}
77         affinity:
78 {{ toYaml .Values.affinity | indent 10 }}
79         {{- end }}
80       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
81       volumes:
82         - name: localtime
83           hostPath:
84             path: /etc/localtime
85       {{- include "common.imagePullSecrets" . | nindent 6 }}