-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathcontroller-deployment.yaml
More file actions
133 lines (133 loc) · 4.88 KB
/
controller-deployment.yaml
File metadata and controls
133 lines (133 loc) · 4.88 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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "zrok2.fullname" . }}
labels:
{{- include "zrok2.labelsController" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "zrok2.selectorLabelsController" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "zrok2.selectorLabelsController" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "zrok2.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: {{ .Chart.Name }}-bootstrap
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["bootstrap-ziti.bash"]
env:
- name: HOME
value: {{ .Values.controller.persistence.mount_dir }}
volumeMounts:
- name: zrok2-controller-config
mountPath: /etc/zrok2
readOnly: true
- name: bootstrap-ziti
mountPath: /usr/local/bin/bootstrap-ziti.bash
subPath: bootstrap-ziti.bash
readOnly: true
- name: persistence
mountPath: {{ .Values.controller.persistence.mount_dir }}
readOnly: false
- name: ziti-ctrl-plane-cas
mountPath: {{ .Values.ziti.ca_cert_dir }}/{{ .Values.ziti.ca_cert_file }}
subPath: {{ .Values.ziti.ca_cert_file }}
readOnly: true
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["controller", "/etc/zrok2/ctrl.yaml"]
env:
- name: ZROK2_ADMIN_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "zrok2.fullname" . }}-admin-secret
key: admin-token
- name: ZROK2_API_ENDPOINT
value: http://127.0.0.1:{{ .Values.controller.service.containerPort }}
- name: HOME
value: {{ .Values.controller.persistence.mount_dir }}
volumeMounts:
- name: zrok2-controller-config
mountPath: /etc/zrok2
readOnly: true
- name: persistence
mountPath: {{ .Values.controller.persistence.mount_dir }}
readOnly: false
ports:
- name: http
containerPort: {{ .Values.controller.service.containerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 10
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- 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: zrok2-controller-config
configMap:
name: {{ include "zrok2.fullname" . }}-config
defaultMode: 0444
items:
- key: ctrl.yaml
path: ctrl.yaml
- name: bootstrap-ziti
configMap:
name: {{ include "zrok2.fullname" . }}-config
defaultMode: 0555
items:
- key: bootstrap-ziti.bash
path: bootstrap-ziti.bash
- name: ziti-ctrl-plane-cas
configMap:
name: {{ .Values.ziti.ca_cert_configmap }}
defaultMode: 0444
items:
- key: {{ .Values.ziti.ca_cert_file }}
path: {{ .Values.ziti.ca_cert_file }}
{{- if .Values.controller.persistence.enabled }}
- name: persistence
persistentVolumeClaim:
claimName: {{ default (printf "%s-persistence" (include "zrok2.fullname" .)) .Values.controller.persistence.existingClaim }}
{{- end }}