Skip to content

Commit

Permalink
[kube-state-metrics] Use kube-rbac-proxy ports for probes when kube-r…
Browse files Browse the repository at this point in the history
…bac-proxy is enabled (#5234)

* use kube-rbac-proxy ports for probes when enabled

Signed-off-by: r0bj <[email protected]>

* fix telemetry port

Signed-off-by: r0bj <[email protected]>

* remove kube-rbac-proxy additional options

Signed-off-by: r0bj <[email protected]>

* Apply suggestions from code review

Signed-off-by: David Calvert <[email protected]>

---------

Signed-off-by: r0bj <[email protected]>
Signed-off-by: David Calvert <[email protected]>
Co-authored-by: MH <[email protected]>
Co-authored-by: David Calvert <[email protected]>
  • Loading branch information
3 people authored Jan 30, 2025
1 parent 19b7e97 commit 6a3be8f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kube-state-metrics/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords:
- prometheus
- kubernetes
type: application
version: 5.28.1
version: 5.29.0
appVersion: 2.14.0
home: https://github.com/kubernetes/kube-state-metrics/
sources:
Expand Down
18 changes: 18 additions & 0 deletions charts/kube-state-metrics/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ spec:
{{- if .Values.extraArgs }}
{{- .Values.extraArgs | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.kubeRBACProxy.enabled }}
- --host=127.0.0.1
{{- end }}
- --port={{ $servicePort }}
{{- if .Values.collectors }}
- --resources={{ .Values.collectors | join "," }}
Expand Down Expand Up @@ -171,8 +174,13 @@ spec:
value: {{ $header.value }}
{{- end }}
path: /healthz
{{- if .Values.kubeRBACProxy.enabled }}
port: {{ .Values.service.port | default 8080 }}
scheme: HTTPS
{{- else }}
port: {{ $servicePort }}
scheme: {{ upper .Values.startupProbe.httpGet.scheme }}
{{- end }}
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
successThreshold: {{ .Values.startupProbe.successThreshold }}
Expand All @@ -190,8 +198,13 @@ spec:
value: {{ $header.value }}
{{- end }}
path: /livez
{{- if .Values.kubeRBACProxy.enabled }}
port: {{ .Values.service.port | default 8080 }}
scheme: HTTPS
{{- else }}
port: {{ $servicePort }}
scheme: {{ upper .Values.livenessProbe.httpGet.scheme }}
{{- end }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
Expand All @@ -208,8 +221,13 @@ spec:
value: {{ $header.value }}
{{- end }}
path: /readyz
{{- if .Values.kubeRBACProxy.enabled }}
port: {{ .Values.selfMonitor.telemetryPort | default 8081 }}
scheme: HTTPS
{{- else }}
port: {{ $telemetryPort }}
scheme: {{ upper .Values.readinessProbe.httpGet.scheme }}
{{- end }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
Expand Down

0 comments on commit 6a3be8f

Please sign in to comment.