-
Notifications
You must be signed in to change notification settings - Fork 163
/
deployment.yaml
109 lines (108 loc) · 3.81 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "otomi-api.fullname" . }}
labels:
{{ include "otomi-api.labels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "otomi-api.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "otomi-api.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
annotations:
checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum | trunc 63 }}
checksum/config: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum | trunc 63 }}
checksum/core: {{ include (print .Template.BasePath "/core-config.yaml") . | sha256sum | trunc 63 }}
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "otomi-api.serviceAccountName" . }}
securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext: {{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- secretRef:
name: {{ include "otomi-api.fullname" . }}
- configMapRef:
name: {{ include "otomi-api.fullname" . }}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
# initialDelaySeconds: 20
httpGet:
path: /live
port: 9000
readinessProbe:
initialDelaySeconds: 10
httpGet:
path: /ready
port: 9000
resources: {{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: repo
mountPath: /tmp
- name: core-values
mountPath: /etc/otomi/core.yaml
subPath: core.yaml
{{- if .Values.tools.enabled }}
- name: {{ .Chart.Name }}-tools
securityContext: {{- toYaml .Values.tools.securityContext | nindent 12 }}
image: "{{ .Values.tools.image.registry }}/{{ .Values.tools.image.repository }}:{{ .Values.tools.image.tag }}"
imagePullPolicy: {{ .Values.tools.image.pullPolicy }}
command: ['sh', '-c', 'bin/server.sh']
envFrom:
- secretRef:
name: {{ include "otomi-api.fullname" . }}
- configMapRef:
name: {{ include "otomi-api.fullname" . }}
ports:
- name: http
containerPort: 17771
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources: {{- toYaml .Values.tools.resources | nindent 12 }}
volumeMounts:
- name: repo
mountPath: /tmp
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: repo
emptyDir: {}
- name: core-values
configMap:
name: {{ include "otomi-api.fullname" . }}-core