From 69db21db4c9ed4c4ea1dca316759bccd35eb66bf Mon Sep 17 00:00:00 2001 From: Stefan Roman <40276838+katapultcloud@users.noreply.github.com> Date: Sun, 22 Sep 2024 07:08:01 +0200 Subject: [PATCH] =?UTF-8?q?feat(helm):=20add=20hostNetwork,=20topologySpre?= =?UTF-8?q?adConstraint=20and=20clusterIP=20su=E2=80=A6=20(#3389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 Co-authored-by: Stefan Roman --- contrib/charts/dragonfly/templates/_pod.tpl | 7 +++++++ contrib/charts/dragonfly/templates/service.yaml | 3 +++ contrib/charts/dragonfly/values.yaml | 8 ++++++++ 3 files changed, 18 insertions(+) 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: []