-
-
Notifications
You must be signed in to change notification settings - Fork 184
Expand file tree
/
Copy pathdeployment.yaml
More file actions
87 lines (87 loc) · 3.14 KB
/
deployment.yaml
File metadata and controls
87 lines (87 loc) · 3.14 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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "beelzebub-chart.fullname" . }}
labels:
{{- include "beelzebub-chart.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "beelzebub-chart.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "beelzebub-chart.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "beelzebub-chart.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
volumeMounts:
- name: config-core-volume
mountPath: /configurations/beelzebub.yaml
subPath: beelzebub.yaml
readOnly: true
{{- range $value := .Values.beelzebubServiceConfigs }}
{{- $trimmed := trimSuffix ".yaml" $value.name }}
{{- $safeName := regexReplaceAll "[^a-z0-9-]" (lower $trimmed) "-" | trimAll "-" | trunc 63 }}
- name: config-services-volume-{{ $safeName }}
mountPath: /configurations/services/{{ $value.name }}
subPath: {{ $value.name }}
readOnly: true
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
{{- range $value := .Values.beelzebubServiceConfigs }}
- name: {{ trimSuffix ".yaml" $value.name }}
containerPort: {{ trimPrefix ":" $value.config.address | default $.Values.service.port }}
protocol: TCP
{{- end }}
# livenessProbe:
# httpGet:
# path: /
# port: http
# readinessProbe:
# httpGet:
# path: /
# port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: config-core-volume
configMap:
name: beelzebub-configuration
{{- range $value := .Values.beelzebubServiceConfigs }}
{{- $trimmed := trimSuffix ".yaml" $value.name }}
{{- $safeName := regexReplaceAll "[^a-z0-9-]" (lower $trimmed) "-" | trimAll "-" | trunc 63 }}
- name: config-services-volume-{{ $safeName }}
configMap:
name: beelzebub-services-cm-{{ $safeName }}
{{- 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 }}