feat(helm): add hostNetwork, topologySpreadConstraint and clusterIP su… (#3389)

* add(helm): add hostNetwork, topologySpreadConstraint and clusterIP support

* parameters hostNetwork and clusterIP shouold not be templated if they are not explicitly used

---------

Signed-off-by: Stefan Roman <elegant.frog3113@fastmail.com>
Co-authored-by: Stefan Roman <elegant.frog3113@fastmail.com>
This commit is contained in:
Stefan Roman 2024-09-22 07:08:01 +02:00 committed by GitHub
parent d9f8f2553b
commit 69db21db4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 0 deletions

View file

@ -40,6 +40,13 @@ imagePullSecrets:
securityContext:
{{- toYaml . | trim | nindent 2 }}
{{- end }}
{{- if and (eq (typeOf .Values.hostNetwork) "bool") .Values.hostNetwork }}
hostNetwork: true
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | trim | nindent 2 }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
{{- if eq (typeOf .) "string" }}

View file

@ -17,6 +17,9 @@ spec:
{{- if and (eq .Values.service.type "LoadBalancer") (ne .Values.service.loadBalancerIP "") }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.service.type "ClusterIP") (ne .Values.service.clusterIP "") }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}
ports:
- port: {{ .Values.service.port }}
targetPort: dragonfly

View file

@ -47,11 +47,16 @@ securityContext: {}
# runAsNonRoot: true
# runAsUser: 1000
# -- Set hostNetwork for pod
hostNetwork: false
service:
# -- Service type to provision. Can be NodePort, ClusterIP or LoadBalancer
type: ClusterIP
# -- Load balancer static ip to use when service type is set to LoadBalancer
loadBalancerIP: ""
# -- Cluster IP address to assign to the service. Leave empty to auto-allocate
clusterIP: ""
# -- Dragonfly service port
port: 6379
# -- Extra annotations for the service
@ -207,3 +212,6 @@ tolerations: []
# -- Affinity for pod assignment
affinity: {}
# -- Topology Spread Constraints for pod assignment
topologySpreadConstraints: []