From 05dd214f216ee33d8f40c0d017eb758028a51c88 Mon Sep 17 00:00:00 2001 From: Lars Dehler Date: Thu, 19 Dec 2024 11:56:48 +0100 Subject: [PATCH 1/5] remove metricsBindAddress flag from helmchart --- hack/charts/cluster-api-operator/templates/deployment.yaml | 6 ------ hack/charts/cluster-api-operator/values.yaml | 1 - 2 files changed, 7 deletions(-) diff --git a/hack/charts/cluster-api-operator/templates/deployment.yaml b/hack/charts/cluster-api-operator/templates/deployment.yaml index 6f06700d6..86f71e778 100644 --- a/hack/charts/cluster-api-operator/templates/deployment.yaml +++ b/hack/charts/cluster-api-operator/templates/deployment.yaml @@ -65,9 +65,6 @@ spec: {{- if .Values.healthAddr }} - --health-addr={{ .Values.healthAddr }} {{- end }} - {{- if .Values.metricsBindAddr }} - - --metrics-bind-addr={{ .Values.metricsBindAddr }} - {{- end }} {{- if .Values.diagnosticsAddress }} - --diagnostics-address={{ .Values.diagnosticsAddress }} {{- end }} @@ -100,9 +97,6 @@ spec: - containerPort: 9443 name: webhook-server protocol: TCP - - containerPort: {{ ( split ":" $.Values.metricsBindAddr)._1 | int }} - name: metrics - protocol: TCP {{- with .Values.resources.manager }} resources: {{- toYaml . | nindent 12 }} diff --git a/hack/charts/cluster-api-operator/values.yaml b/hack/charts/cluster-api-operator/values.yaml index 1d2fb0cc5..69c98f28f 100644 --- a/hack/charts/cluster-api-operator/values.yaml +++ b/hack/charts/cluster-api-operator/values.yaml @@ -24,7 +24,6 @@ image: env: manager: [] healthAddr: ":8081" -metricsBindAddr: "127.0.0.1:8080" diagnosticsAddress: "8443" insecureDiagnostics: false watchConfigSecret: false From 357bbd1c4de24f979cdb025019c80ecf207ca120 Mon Sep 17 00:00:00 2001 From: Lars Dehler Date: Fri, 20 Dec 2024 11:39:04 +0100 Subject: [PATCH 2/5] expose diagnostics address port if configured --- .../cluster-api-operator/templates/deployment.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hack/charts/cluster-api-operator/templates/deployment.yaml b/hack/charts/cluster-api-operator/templates/deployment.yaml index 86f71e778..299ac332d 100644 --- a/hack/charts/cluster-api-operator/templates/deployment.yaml +++ b/hack/charts/cluster-api-operator/templates/deployment.yaml @@ -97,6 +97,15 @@ spec: - containerPort: 9443 name: webhook-server protocol: TCP + {{- if $.Values.diagnosticsAddress }} + {{- $diagnosticsPort := $.Values.diagnosticsAddress }} + {{- if contains ":" $diagnosticsPort -}} + {{ $diagnosticsPort = ( split ":" $.Values.diagnosticsAddress)._1 }} + {{- end }} + - containerPort: {{ $diagnosticsPort | int }} + name: diagnostics + protocol: TCP + {{- end }} {{- with .Values.resources.manager }} resources: {{- toYaml . | nindent 12 }} From c9bf67e87b8f8f344295053dca02a546b7160827 Mon Sep 17 00:00:00 2001 From: Lars Dehler Date: Fri, 20 Dec 2024 14:16:10 +0100 Subject: [PATCH 3/5] generate resources --- test/e2e/resources/full-chart-install.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/e2e/resources/full-chart-install.yaml b/test/e2e/resources/full-chart-install.yaml index 35df0568b..af8365dec 100644 --- a/test/e2e/resources/full-chart-install.yaml +++ b/test/e2e/resources/full-chart-install.yaml @@ -28387,7 +28387,6 @@ spec: - args: - --v=2 - --health-addr=:8081 - - --metrics-bind-addr=127.0.0.1:8080 - --diagnostics-address=8443 - --leader-elect=true command: @@ -28399,8 +28398,8 @@ spec: - containerPort: 9443 name: webhook-server protocol: TCP - - containerPort: 8080 - name: metrics + - containerPort: 8443 + name: diagnostics protocol: TCP resources: limits: From d4aca3c4816d52e65574e9b582fc02dd7471bb4c Mon Sep 17 00:00:00 2001 From: Arakos Date: Fri, 20 Dec 2024 14:21:44 +0100 Subject: [PATCH 4/5] keep metrics as port name Co-authored-by: Furkat Gofurov --- hack/charts/cluster-api-operator/templates/deployment.yaml | 4 ++-- test/e2e/resources/full-chart-install.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/charts/cluster-api-operator/templates/deployment.yaml b/hack/charts/cluster-api-operator/templates/deployment.yaml index 299ac332d..a0c314777 100644 --- a/hack/charts/cluster-api-operator/templates/deployment.yaml +++ b/hack/charts/cluster-api-operator/templates/deployment.yaml @@ -100,10 +100,10 @@ spec: {{- if $.Values.diagnosticsAddress }} {{- $diagnosticsPort := $.Values.diagnosticsAddress }} {{- if contains ":" $diagnosticsPort -}} - {{ $diagnosticsPort = ( split ":" $.Values.diagnosticsAddress)._1 }} + {{ $diagnosticsPort = ( split ":" $.Values.diagnosticsAddress)._1 | int }} {{- end }} - containerPort: {{ $diagnosticsPort | int }} - name: diagnostics + name: metrics protocol: TCP {{- end }} {{- with .Values.resources.manager }} diff --git a/test/e2e/resources/full-chart-install.yaml b/test/e2e/resources/full-chart-install.yaml index af8365dec..37c0d9b43 100644 --- a/test/e2e/resources/full-chart-install.yaml +++ b/test/e2e/resources/full-chart-install.yaml @@ -28399,7 +28399,7 @@ spec: name: webhook-server protocol: TCP - containerPort: 8443 - name: diagnostics + name: metrics protocol: TCP resources: limits: From 9afb69c45cf7570173195d91b3814f7b0753ac00 Mon Sep 17 00:00:00 2001 From: Furkat Gofurov Date: Fri, 20 Dec 2024 16:20:04 +0200 Subject: [PATCH 5/5] Make diagnostics-address a FQDN address Signed-off-by: Furkat Gofurov --- hack/charts/cluster-api-operator/values.yaml | 2 +- test/e2e/resources/full-chart-install.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/charts/cluster-api-operator/values.yaml b/hack/charts/cluster-api-operator/values.yaml index 69c98f28f..7038e9b6a 100644 --- a/hack/charts/cluster-api-operator/values.yaml +++ b/hack/charts/cluster-api-operator/values.yaml @@ -24,7 +24,7 @@ image: env: manager: [] healthAddr: ":8081" -diagnosticsAddress: "8443" +diagnosticsAddress: ":8443" insecureDiagnostics: false watchConfigSecret: false imagePullSecrets: {} diff --git a/test/e2e/resources/full-chart-install.yaml b/test/e2e/resources/full-chart-install.yaml index 37c0d9b43..f51b00826 100644 --- a/test/e2e/resources/full-chart-install.yaml +++ b/test/e2e/resources/full-chart-install.yaml @@ -28387,7 +28387,7 @@ spec: - args: - --v=2 - --health-addr=:8081 - - --diagnostics-address=8443 + - --diagnostics-address=:8443 - --leader-elect=true command: - /manager