2006b885f137fcc5b63631bb1ea6b1fcb6b758d1
[oom.git] / kubernetes / helm / starters / onap-app / templates / deployment.yaml
1 apiVersion: extensions/v1beta1
2 kind: Deployment
3 metadata:
4   name: {{ include "common.fullname" . }}
5   namespace: {{ include "common.namespace" . }}
6   labels:
7     app: {{ include "common.name" . }}
8     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9     release: {{ .Release.Name }}
10     heritage: {{ .Release.Service }}
11 spec:
12   replicas: {{ .Values.replicaCount }}
13   template:
14     metadata:
15       labels:
16         app: {{ include "common.name" . }}
17         release: {{ .Release.Name }}
18     spec:
19       initContainers:
20 #Example init container for dependency checking
21 #      - command:
22 #        - /root/ready.py
23 #        args:
24 #        - --container-name
25 #        - mariadb
26 #        env:
27 #        - name: NAMESPACE
28 #          valueFrom:
29 #            fieldRef:
30 #              apiVersion: v1
31 #              fieldPath: metadata.namespace
32 #        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
33 #        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
34 #        name: {{ include "common.name" . }}-readiness
35       containers:
36         - name: {{ include "common.name" . }}
37           image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}"
38           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
39           ports:
40           - containerPort: {{ .Values.service.internalPort }}
41           # disable liveness probe when breakpoints set in debugger
42           # so K8s doesn't restart unresponsive container
43           {{- if eq .Values.liveness.enabled true }}
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           env:
56 #Example environment variable passed to container
57 #            - name: DEBUG_FLAG
58 #              value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }}
59           volumeMounts:
60           - mountPath: /etc/localtime
61             name: localtime
62             readOnly: true
63 #Example config file mount into container
64 #          - mountPath: /opt/app/application.properties
65 #            name: {{ include "common.name" . }}-config
66 #            subPath: application.properties
67           resources:
68 {{ toYaml .Values.resources | indent 12 }}
69         {{- if .Values.nodeSelector }}
70         nodeSelector:
71 {{ toYaml .Values.nodeSelector | indent 10 }}
72         {{- end -}}
73         {{- if .Values.affinity }}
74         affinity:
75 {{ toYaml .Values.affinity | indent 10 }}
76         {{- end }}
77
78       volumes:
79         - name: localtime
80           hostPath:
81             path: /etc/localtime
82 #Example config file mount into container
83 #        - name: {{ include "common.fullname" . }}-config
84 #          configMap:
85 #            name: {{ include "common.fullname" . }}-configmap
86 #            items:
87 #            - key: application.properties
88 #              path: application.properties
89       imagePullSecrets:
90       - name: "{{ include "common.namespace" . }}-docker-registry-key"