rancher-charts/packages/rancher-monitoring/rancher-kube-state-metrics/generated-changes/patch/templates/role.yaml.patch

66 lines
2.0 KiB
Diff
Raw Normal View History

--- charts-original/templates/role.yaml
+++ charts/templates/role.yaml
2023-07-11 18:34:11 +00:00
@@ -1,5 +1,8 @@
+{{- if not (kindIs "slice" .Values.collectors) }}
+{{- fail "Collectors need to be a List since kube-state-metrics chart 3.2.2. Please check README for more information."}}
+{{- end }}
{{- if and (eq .Values.rbac.create true) (not .Values.rbac.useExistingRole) -}}
2023-07-11 18:34:11 +00:00
-{{- range (ternary (split "," .Values.namespaces) (list "") (eq $.Values.rbac.useClusterRole false)) }}
+{{- range (ternary (join "," .Values.namespaces | split "," ) (list "") (eq $.Values.rbac.useClusterRole false)) }}
---
2023-07-11 18:34:11 +00:00
apiVersion: rbac.authorization.k8s.io/v1
{{- if eq $.Values.rbac.useClusterRole false }}
@@ -51,6 +54,12 @@
- endpoints
verbs: ["list", "watch"]
{{ end -}}
+{{ if has "endpointslices" $.Values.collectors }}
+- apiGroups: ["discovery.k8s.io"]
+ resources:
+ - endpointslices
+ verbs: ["list", "watch"]
+{{ end -}}
{{ if has "horizontalpodautoscalers" $.Values.collectors }}
- apiGroups: ["autoscaling"]
resources:
@@ -69,6 +78,12 @@
- jobs
verbs: ["list", "watch"]
{{ end -}}
+{{ if has "leases" $.Values.collectors }}
+- apiGroups: ["coordination.k8s.io"]
+ resources:
+ - leases
+ verbs: ["list", "watch"]
+{{ end -}}
{{ if has "limitranges" $.Values.collectors }}
- apiGroups: [""]
resources:
@@ -177,12 +192,22 @@
- volumeattachments
verbs: ["list", "watch"]
{{ end -}}
-{{ if has "verticalpodautoscalers" $.Values.collectors }}
-- apiGroups: ["autoscaling.k8s.io"]
+{{- if $.Values.kubeRBACProxy.enabled }}
+- apiGroups: ["authentication.k8s.io"]
+ resources:
+ - tokenreviews
+ verbs: ["create"]
+- apiGroups: ["authorization.k8s.io"]
+ resources:
+ - subjectaccessreviews
+ verbs: ["create"]
+{{- end }}
+{{- if $.Values.customResourceState.enabled }}
+- apiGroups: ["apiextensions.k8s.io"]
resources:
- - verticalpodautoscalers
+ - customresourcedefinitions
verbs: ["list", "watch"]
-{{ end -}}
+{{- end }}
{{ if $.Values.rbac.extraRules }}
{{ toYaml $.Values.rbac.extraRules }}
{{ end }}