6887e6710ec482f1ec392cd171c744566d0d0c6e
[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: APP_ACTION_DEPLOY_BLUEPRINT_GRPC_ENABLED
45               value: "{{ .Values.config.app.action.deployBlueprint.grpcEnabled }}"
46             - name: API_BLUEPRINT_CONTROLLER_HTTP_BASE_URL
47               value: {{ .Values.config.api.controller.http.baseUrl }}
48             - name: API_BLUEPRINT_CONTROLLER_HTTP_AUTH_TOKEN
49               value: {{ .Values.config.api.controller.http.authToken }}
50             - name: API_BLUEPRINT_PROCESSOR_HTTP_BASE_URL
51               value: {{ .Values.config.api.processor.http.baseUrl }}
52             - name: API_BLUEPRINT_PROCESSOR_HTTP_AUTH_TOKEN
53               value: {{ .Values.config.api.processor.http.authToken }}
54             - name: API_BLUEPRINT_PROCESSOR_GRPC_HOST
55               value: {{ .Values.config.api.processor.grpc.host }}
56             - name: API_BLUEPRINT_PROCESSOR_GRPC_PORT
57               value: "{{ .Values.config.api.processor.grpc.port }}"
58             - name: API_BLUEPRINT_PROCESSOR_GRPC_AUTH_TOKEN
59               value: {{ .Values.config.api.processor.grpc.authToken }}
60           readinessProbe:
61             tcpSocket:
62               port: {{ .Values.service.internalPort }}
63             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
64             periodSeconds: {{ .Values.readiness.periodSeconds }}
65           volumeMounts:
66             - mountPath: /etc/localtime
67               name: localtime
68               readOnly: true
69           resources: {{ include "common.resources" . | nindent 12 }}
70         {{- if .Values.nodeSelector }}
71         nodeSelector:
72 {{ toYaml .Values.nodeSelector | indent 10 }}
73         {{- end -}}
74         {{- if .Values.affinity }}
75         affinity:
76 {{ toYaml .Values.affinity | indent 10 }}
77         {{- end }}
78       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
79       volumes:
80         - name: localtime
81           hostPath:
82             path: /etc/localtime
83       imagePullSecrets:
84       - name: "{{ include "common.namespace" . }}-docker-registry-key"