blob: 54034a649cb0f2ed115e65c0e41209130ba92ca7 [file] [log] [blame]
Mohammed Naser4569e9b2024-07-19 01:08:18 -04001apiVersion: apps/v1
2kind: DaemonSet
3metadata:
4 name: {{ include "goldpinger.fullname" . }}
5 labels:
6 {{- include "goldpinger.labels" . | nindent 4 }}
7spec:
8 {{- with .Values.updateStrategy }}
9 updateStrategy:
10 {{- toYaml . | nindent 4 }}
11 {{- end }}
12 selector:
13 matchLabels:
14 {{- include "goldpinger.selectorLabels" . | nindent 6 }}
15 template:
16 metadata:
17 {{- with .Values.podAnnotations }}
18 annotations:
19 {{ toYaml . | nindent 8 }}
20 {{- end }}
21 labels:
22 {{- include "goldpinger.selectorLabels" . | nindent 8 }}
23 {{- with .Values.podLabels }}
24 {{ toYaml . | nindent 8 }}
25 {{- end }}
26 spec:
27 priorityClassName: {{ .Values.priorityClassName }}
28 serviceAccountName: {{ include "goldpinger.serviceAccountName" . }}
29 {{- if .Values.image.pullSecrets }}
30 imagePullSecrets:
31 {{- range .Values.image.pullSecrets }}
32 - name: {{ . }}
33 {{- end }}
34 {{- end }}
35 containers:
36 - name: goldpinger-daemon
37 image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
38 imagePullPolicy: {{ .Values.image.pullPolicy }}
39 volumeMounts:
40 - name: zap
41 mountPath: /config
42 env:
43 - name: HOSTNAME
44 valueFrom:
45 fieldRef:
46 fieldPath: spec.nodeName
47 - name: HOST
48 value: "0.0.0.0"
49 - name: PORT
50 value: "{{ .Values.goldpinger.port }}"
51 - name: LABEL_SELECTOR
52 value: "app.kubernetes.io/name={{ include "goldpinger.name" . }}"
53 {{- if .Values.extraEnv -}}
54 {{ toYaml .Values.extraEnv | nindent 12 }}
55 {{- end }}
56 {{- with .Values.containerSecurityContext }}
57 securityContext:
58 {{- toYaml . | nindent 12 }}
59 {{- end }}
60 ports:
61 - name: http
62 containerPort: {{ .Values.goldpinger.port }}
63 protocol: TCP
64 {{- range $k := .Values.extraEnv }}
65 {{- if and (eq $k.name "USE_HOST_IP") (eq $k.value "true") }}
66 hostPort: {{ $.Values.goldpinger.port }}
67 {{- end }}
68 {{- end }}
69 livenessProbe:
70 httpGet:
71 path: /
72 port: http
73 readinessProbe:
74 httpGet:
75 path: /
76 port: http
77 resources:
78 {{- toYaml .Values.resources | nindent 12 }}
79 volumes:
80 - name: zap
81 configMap:
82 name: {{ include "goldpinger.fullname" . }}-zap
83 {{- range $k := .Values.extraEnv }}
84 {{- if and (eq $k.name "USE_HOST_IP") (eq $k.value "true") }}
85 hostNetwork: true
86 {{- end }}
87 {{- end }}
88 {{- with .Values.nodeSelector }}
89 nodeSelector:
90 {{- toYaml . | nindent 8 }}
91 {{- end }}
92 {{- with .Values.affinity }}
93 affinity:
94 {{- toYaml . | nindent 8 }}
95 {{- end }}
96 {{- with .Values.tolerations }}
97 tolerations:
98 {{- toYaml . | nindent 8 }}
99 {{- end }}
100 {{- with .Values.podSecurityContext }}
101 securityContext:
102 {{- toYaml . | nindent 8 }}
103 {{- end }}