diff --git a/contrib/charts/dragonfly/templates/_pod.tpl b/contrib/charts/dragonfly/templates/_pod.tpl index 40b870f0e..2994ec7d1 100644 --- a/contrib/charts/dragonfly/templates/_pod.tpl +++ b/contrib/charts/dragonfly/templates/_pod.tpl @@ -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" }} diff --git a/contrib/charts/dragonfly/templates/service.yaml b/contrib/charts/dragonfly/templates/service.yaml index 8ba0c4c53..8f84e03f9 100644 --- a/contrib/charts/dragonfly/templates/service.yaml +++ b/contrib/charts/dragonfly/templates/service.yaml @@ -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 diff --git a/contrib/charts/dragonfly/values.yaml b/contrib/charts/dragonfly/values.yaml index 0e1e433bd..3be6af208 100644 --- a/contrib/charts/dragonfly/values.yaml +++ b/contrib/charts/dragonfly/values.yaml @@ -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: []