Skip to content

Commit

Permalink
goldpinger: set hostPort and hostNetwork if USE_HOST_IP is defi…
Browse files Browse the repository at this point in the history
…ned and true; fix extraEnv/containerSecurityContext ordering (#74)
  • Loading branch information
tamcore authored Oct 21, 2022
1 parent 4a42b3c commit 3dfae57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/goldpinger/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ name: goldpinger
sources:
- https://github.com/bloomberg/goldpinger
- https://github.com/okgolove/helm-charts
version: 5.4.3
version: 5.4.4
16 changes: 13 additions & 3 deletions charts/goldpinger/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,22 @@ spec:
value: "{{ .Values.goldpinger.port }}"
- name: LABEL_SELECTOR
value: "app.kubernetes.io/name={{ include "goldpinger.name" . }}"
{{- if .Values.extraEnv }}
{{ toYaml .Values.extraEnv | nindent 12 }}
{{- end }}
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.extraEnv }}
{{ toYaml .Values.extraEnv | indent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.goldpinger.port }}
protocol: TCP
{{- range $k := .Values.extraEnv }}
{{- if and (eq $k.name "USE_HOST_IP") (eq $k.value "true") }}
hostPort: {{ $.Values.goldpinger.port }}
{{- end }}
{{- end }}
livenessProbe:
httpGet:
path: /
Expand All @@ -68,6 +73,11 @@ spec:
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- range $k := .Values.extraEnv }}
{{- if and (eq $k.name "USE_HOST_IP") (eq $k.value "true") }}
hostNetwork: true
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down

0 comments on commit 3dfae57

Please sign in to comment.