Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-prometheus-stack] support kubelet endpoint slices #4899

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 65.0.0
version: 65.1.0
appVersion: v0.77.1
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ rules:
- endpointslices
verbs:
- get
- create
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we can use the kubeletEndpointsEnabled and kubeletEndpointSliceEnabled to toggle granting these permissions. will let reviewer decide. i can add this logic if needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The toggle would cover only write permissions, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think all of the endpointslice permissions. unelss there is a reason not to (I dont see one)

- list
- watch
- update
- delete
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ spec:
- --kubelet-selector={{ .Values.prometheusOperator.kubeletService.selector }}
{{- end }}
{{- end }}
{{- if .Values.prometheusOperator.kubeletEndpointsEnabled }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if in combination with an boolean might be mis-leading.

Since --kubelet-endpoints= is set to true by default, I set the value to false keep the flag still to true, because --kubelet-endpoints=false would be omit.

not sure, if

{{- if (print .Values.prometheusOperator.kubeletEndpointsEnabled) }}

would help here, since it converts the value to a string and "false" is still true-ish, I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, maybe just omit the ifs entirely and go by the values.yaml values?

- --kubelet-endpoints={{ .Values.prometheusOperator.kubeletEndpointsEnabled }}
{{- end }}
{{- if .Values.prometheusOperator.kubeletEndpointSliceEnabled }}
- --kubelet-endpointslice={{ .Values.prometheusOperator.kubeletEndpointSliceEnabled }}
{{- end }}
{{- if .Values.prometheusOperator.logFormat }}
- --log-format={{ .Values.prometheusOperator.logFormat }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2698,6 +2698,11 @@ prometheusOperator:
## Use '{{ template "kube-prometheus-stack.fullname" . }}-kubelet' by default
name: ""

## Create Endpoints objects for kubelet targets.
kubeletEndpointsEnabled: true
## Create EndpointSlice objects for kubelet targets.
kubeletEndpointSliceEnabled: false

## Create a servicemonitor for the operator
##
serviceMonitor:
Expand Down