[CONSUL] Add limits to consul chart.
[oom.git] / kubernetes / cds / charts / cds-ui / templates / deployment.yaml
1 # Copyright © 2018 Orange
2 # Modifications Copyright © 2018  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 apiVersion: apps/v1
17 kind: Deployment
18 metadata:
19   name: {{ include "common.fullname" . }}
20   namespace: {{ include "common.namespace" . }}
21   labels:
22     app: {{ include "common.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ include "common.release" . }}
25     heritage: {{ .Release.Service }}
26 spec:
27   selector:
28     matchLabels:
29       app: {{ include "common.name" . }}
30   replicas: {{ .Values.replicaCount }}
31   template:
32     metadata:
33       labels:
34         app: {{ include "common.name" . }}
35         release: {{ include "common.release" . }}
36         name: {{ include "common.fullname" . }}
37     spec:
38       containers:
39         - name: {{ include "common.name" . }}
40           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
41           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42           ports:
43             - containerPort: {{ .Values.service.internalPort }}
44           # disable liveness probe when breakpoints set in debugger
45           # so K8s doesn't restart unresponsive container
46           {{ if .Values.liveness.enabled }}
47           livenessProbe:
48             tcpSocket:
49               port: {{ .Values.service.internalPort }}
50             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
51             periodSeconds: {{ .Values.liveness.periodSeconds }}
52           {{ end }}
53           env:
54             - name: HOST
55               value: 0.0.0.0
56             - name: APP_ACTION_DEPLOY_BLUEPRINT_GRPC_ENABLED
57               value: "{{ .Values.config.app.action.deployBlueprint.grpcEnabled }}"
58             - name: API_BLUEPRINT_CONTROLLER_HTTP_BASE_URL
59               value: {{ .Values.config.api.controller.http.baseUrl }}
60             - name: API_BLUEPRINT_CONTROLLER_HTTP_AUTH_TOKEN
61               value: {{ .Values.config.api.controller.http.authToken }}
62             - name: API_BLUEPRINT_PROCESSOR_HTTP_BASE_URL
63               value: {{ .Values.config.api.processor.http.baseUrl }}
64             - name: API_BLUEPRINT_PROCESSOR_HTTP_AUTH_TOKEN
65               value: {{ .Values.config.api.processor.http.authToken }}
66             - name: API_BLUEPRINT_PROCESSOR_GRPC_HOST
67               value: {{ .Values.config.api.processor.grpc.host }}
68             - name: API_BLUEPRINT_PROCESSOR_GRPC_PORT
69               value: "{{ .Values.config.api.processor.grpc.port }}"
70             - name: API_BLUEPRINT_PROCESSOR_GRPC_AUTH_TOKEN
71               value: {{ .Values.config.api.processor.grpc.authToken }}
72           readinessProbe:
73             tcpSocket:
74               port: {{ .Values.service.internalPort }}
75             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
76             periodSeconds: {{ .Values.readiness.periodSeconds }}
77           volumeMounts:
78             - mountPath: /etc/localtime
79               name: localtime
80               readOnly: true
81           resources:
82 {{ include "common.resources" . | indent 12 }}
83         {{- if .Values.nodeSelector }}
84         nodeSelector:
85 {{ toYaml .Values.nodeSelector | indent 10 }}
86         {{- end -}}
87         {{- if .Values.affinity }}
88         affinity:
89 {{ toYaml .Values.affinity | indent 10 }}
90         {{- end }}
91       volumes:
92         - name: localtime
93           hostPath:
94             path: /etc/localtime
95       imagePullSecrets:
96       - name: "{{ include "common.namespace" . }}-docker-registry-key"