-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-node-deployment.yaml
More file actions
135 lines (135 loc) · 5.25 KB
/
Copy pathsingle-node-deployment.yaml
File metadata and controls
135 lines (135 loc) · 5.25 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{{- if .Values.singleNode.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "zero-cache.fullname" . }}
labels:
{{- include "zero-cache.labels" . | nindent 4 }}
app.kubernetes.io/component: single-node
spec:
replicas: 1
selector:
matchLabels:
{{- include "zero-cache.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: single-node
strategy:
type: Recreate
template:
metadata:
labels:
{{- include "zero-cache.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: single-node
{{- with .Values.singleNode.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "zero-cache.serviceAccountName" . }}
terminationGracePeriodSeconds: 30
securityContext:
{{- toYaml .Values.podSecurityContext | default dict | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | default dict | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.singleNode.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /keepalive
port: {{ .Values.singleNode.service.port }}
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /keepalive
port: {{ .Values.singleNode.service.port }}
initialDelaySeconds: 5
periodSeconds: 10
failureThreshold: 3
successThreshold: 1
{{- if .Values.singleNode.startupProbe.enabled }}
startupProbe:
httpGet:
path: /keepalive
port: {{ .Values.singleNode.service.port }}
initialDelaySeconds: {{ .Values.singleNode.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.singleNode.startupProbe.periodSeconds }}
timeoutSeconds: {{ .Values.singleNode.startupProbe.timeoutSeconds }}
failureThreshold: {{ .Values.singleNode.startupProbe.failureThreshold }}
successThreshold: {{ .Values.singleNode.startupProbe.successThreshold }}
{{- end }}
env:
{{- include "zero-cache.env.core" (dict "port" .Values.singleNode.service.port "root" .) | nindent 12 }}
- name: ZERO_CHANGE_STREAMER_MODE
value: "dedicated"
{{- include "zero-cache.env.auth" . | nindent 12 }}
{{- include "zero-cache.env.admin" . | nindent 12 }}
{{- include "zero-cache.env.database" . | nindent 12 }}
{{- if .Values.common.litestream.backupUrl }}
- name: ZERO_LITESTREAM_BACKUP_URL
value: "{{ .Values.common.litestream.backupUrl }}"
{{- end }}
{{- include "zero-cache.env.litestream" . | nindent 12 }}
{{- include "zero-cache.env.s3" . | nindent 12 }}
{{- include "zero-cache.env.performance" . | nindent 12 }}
{{- include "zero-cache.env.logging" . | nindent 12 }}
{{- include "zero-cache.env.ratelimit" . | nindent 12 }}
{{- include "zero-cache.env.mutators" . | nindent 12 }}
{{- include "zero-cache.env.advanced" . | nindent 12 }}
{{- with include "zero-cache.env.extra" (dict "component" .Values.singleNode "root" .) }}
{{- . | nindent 12 }}
{{- end }}
{{- with include "zero-cache.envFrom.extra" (dict "component" .Values.singleNode "root" .) }}
envFrom:
{{- . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.singleNode.resources | nindent 12 }}
volumeMounts:
- name: data
mountPath: /data
{{- if or .Values.s3.enabled .Values.common.litestream.backupUrl }}
- name: litestream-config
mountPath: /etc/litestream
readOnly: true
{{- end }}
- name: tmp
mountPath: /tmp
{{- with .Values.singleNode.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.singleNode.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.singleNode.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: data
{{- if .Values.singleNode.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ include "zero-cache.fullname" . }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if or .Values.s3.enabled .Values.common.litestream.backupUrl }}
- name: litestream-config
configMap:
name: {{ include "zero-cache.fullname" . }}-litestream-config
{{- end }}
- name: tmp
emptyDir: {}
{{- end }}