From 0655f9c59dea34d278603fd7442e6ad335db0cc8 Mon Sep 17 00:00:00 2001 From: rdark Date: Thu, 28 Mar 2024 15:05:19 +0000 Subject: [PATCH] Make ports configurable for background-controller & reports-controller (#9939) Signed-off-by: Richard Clark Co-authored-by: Richard Clark --- charts/kyverno/README.md | 2 ++ .../templates/background-controller/deployment.yaml | 4 ++-- .../templates/background-controller/service.yaml | 2 +- .../templates/reports-controller/deployment.yaml | 4 ++-- .../kyverno/templates/reports-controller/service.yaml | 2 +- charts/kyverno/values.yaml | 10 ++++++++++ 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/charts/kyverno/README.md b/charts/kyverno/README.md index 17de78e46458..07f60f009513 100644 --- a/charts/kyverno/README.md +++ b/charts/kyverno/README.md @@ -511,6 +511,7 @@ The chart values are organised per component. | backgroundController.metering.port | int | `8000` | Prometheus endpoint port | | backgroundController.metering.collector | string | `""` | Otel collector endpoint | | backgroundController.metering.creds | string | `""` | Otel collector credentials | +| backgroundController.server | object | `{"port":9443}` | backgroundController server port in case you are using hostNetwork: true, you might want to change the port the backgroundController is listening to | | backgroundController.profiling.enabled | bool | `false` | Enable profiling | | backgroundController.profiling.port | int | `6060` | Profiling endpoint port | | backgroundController.profiling.serviceType | string | `"ClusterIP"` | Service type. | @@ -666,6 +667,7 @@ The chart values are organised per component. | reportsController.metering.port | int | `8000` | Prometheus endpoint port | | reportsController.metering.collector | string | `nil` | Otel collector endpoint | | reportsController.metering.creds | string | `nil` | Otel collector credentials | +| reportsController.server | object | `{"port":9443}` | reportsController server port in case you are using hostNetwork: true, you might want to change the port the reportsController is listening to | | reportsController.profiling.enabled | bool | `false` | Enable profiling | | reportsController.profiling.port | int | `6060` | Profiling endpoint port | | reportsController.profiling.serviceType | string | `"ClusterIP"` | Service type. | diff --git a/charts/kyverno/templates/background-controller/deployment.yaml b/charts/kyverno/templates/background-controller/deployment.yaml index 22b02524ab9c..48d5fc49400c 100644 --- a/charts/kyverno/templates/background-controller/deployment.yaml +++ b/charts/kyverno/templates/background-controller/deployment.yaml @@ -80,10 +80,10 @@ spec: image: {{ include "kyverno.background-controller.image" (dict "globalRegistry" .Values.global.image.registry "image" .Values.backgroundController.image "defaultTag" .Chart.AppVersion) | quote }} imagePullPolicy: {{ .Values.backgroundController.image.pullPolicy }} ports: - - containerPort: 9443 + - containerPort: {{ .Values.backgroundController.server.port }} name: https protocol: TCP - - containerPort: 8000 + - containerPort: {{ .Values.backgroundController.metering.port }} name: metrics protocol: TCP {{ if .Values.backgroundController.profiling.enabled }} diff --git a/charts/kyverno/templates/background-controller/service.yaml b/charts/kyverno/templates/background-controller/service.yaml index 0041234deec0..876f228b898e 100644 --- a/charts/kyverno/templates/background-controller/service.yaml +++ b/charts/kyverno/templates/background-controller/service.yaml @@ -15,7 +15,7 @@ metadata: spec: ports: - port: {{ .Values.backgroundController.metricsService.port }} - targetPort: 8000 + targetPort: {{ .Values.backgroundController.metering.port }} protocol: TCP name: metrics-port {{- if and (eq .Values.backgroundController.metricsService.type "NodePort") (not (empty .Values.backgroundController.metricsService.nodePort)) }} diff --git a/charts/kyverno/templates/reports-controller/deployment.yaml b/charts/kyverno/templates/reports-controller/deployment.yaml index 170c399484a0..664850fadc19 100644 --- a/charts/kyverno/templates/reports-controller/deployment.yaml +++ b/charts/kyverno/templates/reports-controller/deployment.yaml @@ -80,10 +80,10 @@ spec: image: {{ include "kyverno.reports-controller.image" (dict "globalRegistry" .Values.global.image.registry "image" .Values.reportsController.image "defaultTag" .Chart.AppVersion) | quote }} imagePullPolicy: {{ .Values.reportsController.image.pullPolicy }} ports: - - containerPort: 9443 + - containerPort: {{ .Values.reportsController.server.port }} name: https protocol: TCP - - containerPort: 8000 + - containerPort: {{ .Values.reportsController.metering.port }} name: metrics protocol: TCP {{ if .Values.reportsController.profiling.enabled }} diff --git a/charts/kyverno/templates/reports-controller/service.yaml b/charts/kyverno/templates/reports-controller/service.yaml index 794b9fa25feb..34fdfeee6de1 100644 --- a/charts/kyverno/templates/reports-controller/service.yaml +++ b/charts/kyverno/templates/reports-controller/service.yaml @@ -15,7 +15,7 @@ metadata: spec: ports: - port: {{ .Values.reportsController.metricsService.port }} - targetPort: 8000 + targetPort: {{ .Values.reportsController.metering.port }} protocol: TCP name: metrics-port {{- if and (eq .Values.reportsController.metricsService.type "NodePort") (not (empty .Values.reportsController.metricsService.nodePort)) }} diff --git a/charts/kyverno/values.yaml b/charts/kyverno/values.yaml index e93168e450ec..b66b7a7eaa85 100644 --- a/charts/kyverno/values.yaml +++ b/charts/kyverno/values.yaml @@ -1536,6 +1536,11 @@ backgroundController: # -- Otel collector credentials creds: '' + # -- backgroundController server port + # in case you are using hostNetwork: true, you might want to change the port the backgroundController is listening to + server: + port: 9443 + profiling: # -- Enable profiling enabled: false @@ -2129,6 +2134,11 @@ reportsController: # -- (string) Otel collector credentials creds: ~ + # -- reportsController server port + # in case you are using hostNetwork: true, you might want to change the port the reportsController is listening to + server: + port: 9443 + profiling: # -- Enable profiling enabled: false