Skip to content

Commit

Permalink
feat(proxy): add support for hostNetwork in the helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
jperville authored and paullaffitte committed Dec 27, 2023
1 parent 977dae1 commit 5371b03
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions helm/kube-image-keeper/templates/proxy-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ spec:
{{- if .Values.proxy.priorityClassName }}
priorityClassName: {{ .Values.proxy.priorityClassName | quote }}
{{- end }}
{{- if .Values.proxy.hostNetwork }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
securityContext:
{{- toYaml .Values.proxy.podSecurityContext | nindent 8 }}
containers:
Expand All @@ -34,13 +38,23 @@ spec:
image: "{{ .Values.proxy.image.repository }}:{{ .Values.proxy.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.proxy.image.pullPolicy }}
ports:
{{- if .Values.proxy.hostNetwork }}
- containerPort: {{ .Values.proxy.hostPort }}
hostPort: {{ .Values.proxy.hostPort }}
protocol: TCP
- containerPort: {{ .Values.proxy.metricsPort }}
hostPort: {{ .Values.proxy.metricsPort }}
name: metrics
protocol: TCP
{{- else }}
- containerPort: 8082
hostIP: {{ .Values.proxy.hostIp }}
hostPort: {{ .Values.proxy.hostPort }}
protocol: TCP
- containerPort: 8080
name: metrics
protocol: TCP
{{- end }}
command:
- registry-proxy
- -v={{ .Values.proxy.verbosity }}
Expand All @@ -57,6 +71,10 @@ spec:
- -root-certificate-authorities=/etc/ssl/certs/registry-certificate-authorities/{{- . }}
{{- end }}
{{- end }}
{{- if .Values.proxy.hostNetwork }}
- -bind-address={{ .Values.proxy.hostIp }}:{{ .Values.proxy.hostPort }}
- -metrics-bind-address={{ .Values.proxy.hostIp }}:{{ .Values.proxy.metricsPort }}
{{- end }}
{{- if .Values.rootCertificateAuthorities }}
{{- with .Values.proxy.env }}
env:
Expand Down
4 changes: 4 additions & 0 deletions helm/kube-image-keeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@ proxy:
pullPolicy: IfNotPresent
# -- Proxy image tag. Default chart appVersion
tag: ""
# -- whether to run the proxy daemonset in hostNetwork mode
hostNetwork: false
# -- hostPort used for the proxy pod
hostPort: 7439
# -- hostIp used for the proxy pod
hostIp: "127.0.0.1"
# -- metricsPort used for the proxy pod (to expose prometheus metrics)
metricsPort: 8080
# -- Verbosity level for the proxy pod
verbosity: 1
# -- Specify secrets to be used when pulling proxy image
Expand Down

0 comments on commit 5371b03

Please sign in to comment.