[CONSUL] Add limits to consul chart.
[oom.git] / kubernetes / sniro-emulator / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 apiVersion: apps/v1
16 kind: Deployment
17 metadata:
18   name: {{ include "common.fullname" . }}
19   namespace: {{ include "common.namespace" . }}
20   labels:
21     app: {{ include "common.name" . }}
22     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23     release: {{ include "common.release" . }}
24     heritage: {{ .Release.Service }}
25 spec:
26   replicas: {{ .Values.replicaCount }}
27   selector:
28     matchLabels:
29       app: {{ include "common.name" . }}
30       release: {{ include "common.release" . }}
31   template:
32     metadata:
33       labels:
34         app: {{ include "common.name" . }}
35         release: {{ include "common.release" . }}
36     spec:
37       containers:
38       - name: {{ include "common.name" . }}
39         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
40         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41         ports:
42         - containerPort: {{ .Values.service.internalPort }}
43         {{ if .Values.liveness.enabled }}
44         livenessProbe:
45           tcpSocket:
46             port: {{ .Values.service.internalPort }}
47           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
48           periodSeconds: {{ .Values.liveness.periodSeconds }}
49         {{ end }}
50         readinessProbe:
51           tcpSocket:
52             port: {{ .Values.service.internalPort }}
53           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
54           periodSeconds: {{ .Values.readiness.periodSeconds }}
55           resources:
56 {{ include "common.resources" . | indent 12 }}
57         {{- if .Values.nodeSelector }}
58         nodeSelector:
59 {{ toYaml .Values.nodeSelector | indent 10 }}
60         {{- end -}}
61         {{- if .Values.affinity }}
62         affinity:
63 {{ toYaml .Values.affinity | indent 10 }}
64         {{- end }}
65       imagePullSecrets:
66       - name: "{{ include "common.namespace" . }}-docker-registry-key"