From 0e2aa2e9c47e3eb5fadbb0186808bc5996001afe Mon Sep 17 00:00:00 2001 From: Pavel Rudnitskiy Date: Wed, 8 Mar 2023 17:15:49 +0100 Subject: [PATCH] prometheus-operator: add EndpointSlices for operator to support K8s 1.22+ (#2948) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add EndpointSlices for operator to support K8s 1.22+ Signed-off-by: Paul Rudnitskiy * bump chart version fix to resolve conflicts Signed-off-by: Paul Rudnitskiy --------- Signed-off-by: Paul Rudnitskiy Signed-off-by: Pavel Rudnitskiy Signed-off-by: André Bauer Co-authored-by: André Bauer --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../templates/prometheus-operator/clusterrole.yaml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 678b4d73a078..cb023862b88d 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -21,7 +21,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 45.7.0 +version: 45.7.1 appVersion: v0.63.0 kubeVersion: ">=1.16.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/prometheus-operator/clusterrole.yaml b/charts/kube-prometheus-stack/templates/prometheus-operator/clusterrole.yaml index 47162832654b..a6c5b29e3fd4 100644 --- a/charts/kube-prometheus-stack/templates/prometheus-operator/clusterrole.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus-operator/clusterrole.yaml @@ -79,4 +79,14 @@ rules: - get - list - watch +{{- if .Capabilities.APIVersions.Has "discovery.k8s.io/v1/EndpointSlice" }} +- apiGroups: + - discovery.k8s.io + resources: + - endpointslices + verbs: + - get + - list + - watch +{{- end }} {{- end }}