From 9e2c74103bac2c153728a06b992664af41b416c7 Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Tue, 13 Aug 2024 23:25:01 -0400 Subject: [PATCH] Allow selecting the service's ClusterIP This is mostly useful to be able to set it to "None", creating a headless service that can be scraped using DNS discovery (dns_sd_configs). Signed-off-by: Remi Rampin --- deployment/templates/service.yaml | 3 +++ deployment/values.yaml | 1 + 2 files changed, 4 insertions(+) diff --git a/deployment/templates/service.yaml b/deployment/templates/service.yaml index 0ea2e34a..ac142fb3 100644 --- a/deployment/templates/service.yaml +++ b/deployment/templates/service.yaml @@ -27,6 +27,9 @@ metadata: {{- end }} spec: type: {{ .Values.service.type }} + {{- if eq .Values.service.type "ClusterIP" }} + clusterIP: {{ .Values.service.clusterIP | quote }} + {{- end }} ports: - name: "metrics" port: {{ .Values.service.port }} diff --git a/deployment/values.yaml b/deployment/values.yaml index 7490f46c..a2caf49b 100644 --- a/deployment/values.yaml +++ b/deployment/values.yaml @@ -93,6 +93,7 @@ service: # When enabled, the helm chart will create service enable: true type: ClusterIP + clusterIP: "" port: 9400 address: ":9400" # Annotations to add to the service