Skip to content

Commit

Permalink
Support hostNetwork mode for EKS custom CNI deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
bhperry committed Sep 25, 2024
1 parent 1f31706 commit b94dec8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
14 changes: 13 additions & 1 deletion deploy/httpreq-webhook/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ spec:
matchLabels:
app: {{ include "httpreq-webhook.name" . }}
release: {{ .Release.Name }}

{{- if .Values.strategy }}
strategy:
{{ toYaml .Values.strategy | nindent 4 }}
{{- end }}
template:
metadata:
labels:
Expand All @@ -35,6 +40,7 @@ spec:
{{- if not (kindIs "invalid" .Values.logLevel) }}
- --v={{ .Values.logLevel }}
{{- end }}
- --secure-port={{ .securePort }}
env:
- name: GROUP_NAME
value: {{ .Values.groupName | quote }}
Expand All @@ -43,7 +49,7 @@ spec:
{{- end }}
ports:
- name: https
containerPort: 443
containerPort: {{ .Values.securePort }}
protocol: TCP
livenessProbe:
httpGet:
Expand All @@ -65,6 +71,12 @@ spec:
- name: certs
secret:
secretName: {{ include "httpreq-webhook.servingCertificate" . }}
{{- if .Values.hostNetwork }}
hostNetwork: true
{{- end }}
{{- if or .Values.dnsPolicy .Values.hostNetwork }}
dnsPolicy: {{ .Values.dnsPolicy | default "ClusterFirstWithHostNet" }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
Expand Down
15 changes: 15 additions & 0 deletions deploy/httpreq-webhook/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ service:
type: ClusterIP
port: 443

# Required for EKS with custom CNI
# https://cert-manager.io/docs/concepts/webhook/#webhook-connection-problems-on-aws-eks
hostNetwork: false
dnsPolicy: # Default to ClusterFirstWithHostNet if hostNetwork is true
securePort: 12443

# Deployment update strategy
# With hostNetwork, you may want to set maxUnavailable 1 so pod can rebind to same port on the node
strategy:
# type: RollingUpdate
# rollingUpdate:
# maxSurge: 0
# maxUnavailable: 1


resources: {}
# limits:
# cpu: 100m
Expand Down

0 comments on commit b94dec8

Please sign in to comment.