Skip to content

Commit

Permalink
fix(proxy): make readiness probe work out of the box in hostNetwork mode
Browse files Browse the repository at this point in the history
Before we had to configure the port and host in the values, now it works by default.
  • Loading branch information
paullaffitte committed Dec 27, 2023
1 parent 5371b03 commit e606d43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions helm/kube-image-keeper/templates/proxy-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
name: metrics
protocol: TCP
{{- else }}
- containerPort: 8082
- containerPort: {{ .Values.proxy.hostPort }}
hostIP: {{ .Values.proxy.hostIp }}
hostPort: {{ .Values.proxy.hostPort }}
protocol: TCP
Expand All @@ -74,6 +74,8 @@ spec:
{{- if .Values.proxy.hostNetwork }}
- -bind-address={{ .Values.proxy.hostIp }}:{{ .Values.proxy.hostPort }}
- -metrics-bind-address={{ .Values.proxy.hostIp }}:{{ .Values.proxy.metricsPort }}
{{- else }}
- -bind-address=:{{ .Values.proxy.hostPort }}
{{- end }}
{{- if .Values.rootCertificateAuthorities }}
{{- with .Values.proxy.env }}
Expand All @@ -85,9 +87,13 @@ spec:
name: registry-certificate-authorities
readOnly: true
{{- end }}
{{- $readinessProbe := deepCopy .Values.proxy.readinessProbe }}
{{- if .Values.proxy.hostNetwork }}
{{- $readinessProbe := merge $readinessProbe.httpGet (dict "host" "localhost") }}
{{- end }}
{{- with .Values.proxy.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- $readinessProbe | toYaml | nindent 12 }}
{{- end }}
{{- with .Values.proxy.resources }}
resources:
Expand Down
2 changes: 1 addition & 1 deletion helm/kube-image-keeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ proxy:
readinessProbe:
httpGet:
path: /v2/
port: 8082
port: 7439
resources:
requests:
# -- Cpu requests for the proxy pod
Expand Down

0 comments on commit e606d43

Please sign in to comment.