From 65b5f7e1f7e3648ac31f59c8342aa97498427d02 Mon Sep 17 00:00:00 2001 From: Pavel Okhlopkov Date: Thu, 21 May 2026 16:31:11 +0300 Subject: [PATCH] fix(examples): replace deprecated rbac.authorization.k8s.io/v1beta1 with v1 The rbac.authorization.k8s.io/v1beta1 API was deprecated in Kubernetes 1.17 and removed in 1.22. Update all example ClusterRole and ClusterRoleBinding manifests (plus the HOOKS.md reference) to use the stable rbac.authorization.k8s.io/v1 API so the examples apply cleanly on current Kubernetes versions. Fixes #709 Co-authored-by: Cursor --- docs/src/HOOKS.md | 2 +- examples/101-monitor-pods/shell-operator-rbac.yaml | 4 ++-- examples/102-monitor-namespaces/shell-operator-rbac.yaml | 4 ++-- examples/104-secret-copier/shell-operator-rbac.yaml | 4 ++-- examples/106-monitor-events/shell-operator-rbac.yaml | 4 ++-- examples/200-advanced/shell-operator-rbac.yaml | 4 ++-- .../templates/shell-operator-rbac.yaml | 4 ++-- examples/204-validating-webhook/templates/rbac.yaml | 4 ++-- examples/210-conversion-webhook/templates/rbac.yaml | 4 ++-- examples/220-execution-rate/templates/rbac.yaml | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/src/HOOKS.md b/docs/src/HOOKS.md index 35060546..0ee7e38b 100644 --- a/docs/src/HOOKS.md +++ b/docs/src/HOOKS.md @@ -218,7 +218,7 @@ kubernetes: - `name` is an optional identifier. It is used to distinguish different bindings during runtime. See also [binding context](#binding-context). -- `apiVersion` is an optional group and version of object API. For example, it is `v1` for core objects (Pod, etc.), `rbac.authorization.k8s.io/v1beta1` for ClusterRole and `monitoring.coreos.com/v1` for prometheus-operator. +- `apiVersion` is an optional group and version of object API. For example, it is `v1` for core objects (Pod, etc.), `rbac.authorization.k8s.io/v1` for ClusterRole and `monitoring.coreos.com/v1` for prometheus-operator. - `kind` is the type of a monitored Kubernetes resource. This field is required. CRDs are supported, but the resource should be registered in the cluster before Shell-operator starts. This can be checked with `kubectl api-resources` command. You can specify a case-insensitive name, kind or short name in this field. For example, to monitor a DaemonSet these forms are valid: diff --git a/examples/101-monitor-pods/shell-operator-rbac.yaml b/examples/101-monitor-pods/shell-operator-rbac.yaml index da59f09e..c856c4a5 100644 --- a/examples/101-monitor-pods/shell-operator-rbac.yaml +++ b/examples/101-monitor-pods/shell-operator-rbac.yaml @@ -5,7 +5,7 @@ metadata: name: monitor-pods-acc --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: monitor-pods @@ -15,7 +15,7 @@ rules: verbs: ["get", "watch", "list"] --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: monitor-pods diff --git a/examples/102-monitor-namespaces/shell-operator-rbac.yaml b/examples/102-monitor-namespaces/shell-operator-rbac.yaml index 8e7345df..edf4f44a 100644 --- a/examples/102-monitor-namespaces/shell-operator-rbac.yaml +++ b/examples/102-monitor-namespaces/shell-operator-rbac.yaml @@ -5,7 +5,7 @@ metadata: name: monitor-namespaces-acc --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: monitor-namespaces @@ -15,7 +15,7 @@ rules: verbs: ["get", "watch", "list"] --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: monitor-namespaces diff --git a/examples/104-secret-copier/shell-operator-rbac.yaml b/examples/104-secret-copier/shell-operator-rbac.yaml index 045c112a..d831f565 100644 --- a/examples/104-secret-copier/shell-operator-rbac.yaml +++ b/examples/104-secret-copier/shell-operator-rbac.yaml @@ -5,7 +5,7 @@ metadata: name: secret-copier-acc --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: secret-copier @@ -18,7 +18,7 @@ rules: verbs: ["*"] --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: secret-copier diff --git a/examples/106-monitor-events/shell-operator-rbac.yaml b/examples/106-monitor-events/shell-operator-rbac.yaml index c1a81780..a6416db1 100644 --- a/examples/106-monitor-events/shell-operator-rbac.yaml +++ b/examples/106-monitor-events/shell-operator-rbac.yaml @@ -5,7 +5,7 @@ metadata: name: monitor-events-acc --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: monitor-events @@ -15,7 +15,7 @@ rules: verbs: ["get", "watch", "list"] --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: monitor-events diff --git a/examples/200-advanced/shell-operator-rbac.yaml b/examples/200-advanced/shell-operator-rbac.yaml index 7419b580..1f8dec7c 100644 --- a/examples/200-advanced/shell-operator-rbac.yaml +++ b/examples/200-advanced/shell-operator-rbac.yaml @@ -5,7 +5,7 @@ metadata: name: advanced-acc --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: monitor-namespaces @@ -15,7 +15,7 @@ rules: verbs: ["get", "watch", "list"] --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: monitor-namespaces diff --git a/examples/201-install-with-helm-chart/templates/shell-operator-rbac.yaml b/examples/201-install-with-helm-chart/templates/shell-operator-rbac.yaml index 4caec6b9..797383b7 100644 --- a/examples/201-install-with-helm-chart/templates/shell-operator-rbac.yaml +++ b/examples/201-install-with-helm-chart/templates/shell-operator-rbac.yaml @@ -5,7 +5,7 @@ metadata: name: example-helm-acc --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: example-helm @@ -15,7 +15,7 @@ rules: verbs: ["get", "watch", "list"] --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: example-helm diff --git a/examples/204-validating-webhook/templates/rbac.yaml b/examples/204-validating-webhook/templates/rbac.yaml index eed6f46d..446ac903 100644 --- a/examples/204-validating-webhook/templates/rbac.yaml +++ b/examples/204-validating-webhook/templates/rbac.yaml @@ -7,7 +7,7 @@ metadata: heritage: example-204 --- # Create and update ValidatingWebhookConfiguration -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: example-204 @@ -19,7 +19,7 @@ rules: verbs: ["create", "list", "update"] --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: example-204 diff --git a/examples/210-conversion-webhook/templates/rbac.yaml b/examples/210-conversion-webhook/templates/rbac.yaml index 8561d55f..29ff33ad 100644 --- a/examples/210-conversion-webhook/templates/rbac.yaml +++ b/examples/210-conversion-webhook/templates/rbac.yaml @@ -7,7 +7,7 @@ metadata: heritage: example-210 --- # Create and update ValidatingWebhookConfiguration -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: example-210 @@ -22,7 +22,7 @@ rules: verbs: ["get", "list", "watch"] --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: example-210 diff --git a/examples/220-execution-rate/templates/rbac.yaml b/examples/220-execution-rate/templates/rbac.yaml index 801837b5..475c2514 100644 --- a/examples/220-execution-rate/templates/rbac.yaml +++ b/examples/220-execution-rate/templates/rbac.yaml @@ -6,7 +6,7 @@ metadata: labels: heritage: example-220 --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: example-220 @@ -17,7 +17,7 @@ rules: resources: ["crontabs"] verbs: ["get", "list", "watch"] --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: example-220