Skip to content

Commit b6f1193

Browse files
committed
Include admin ClusterRole and add it to the scaffold
1 parent 5c8befa commit b6f1193

File tree

148 files changed

+1424
-21563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1424
-21563
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This rule is not used by the project project itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Provides full permissions (create, update, delete) over all custom resource objects
5+
# for the specified API resources across the cluster. In addition to resource management,
6+
# it grants users the ability to modify roles and bindings within the cluster,
7+
# allowing them to delegate specific permissions to other users or groups as needed.
8+
9+
apiVersion: rbac.authorization.k8s.io/v1
10+
kind: ClusterRole
11+
metadata:
12+
labels:
13+
app.kubernetes.io/name: project
14+
app.kubernetes.io/managed-by: kustomize
15+
name: cronjob-admin-role
16+
rules:
17+
- apiGroups:
18+
- batch.tutorial.kubebuilder.io
19+
resources:
20+
- cronjobs
21+
verbs:
22+
- '*'
23+
- apiGroups:
24+
- batch.tutorial.kubebuilder.io
25+
resources:
26+
- cronjobs/status
27+
verbs:
28+
- get

docs/book/src/cronjob-tutorial/testdata/project/config/rbac/cronjob_editor_role.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
# permissions for end users to edit cronjobs.
1+
# This rule is not used by the project project itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Allows users to modify all custom resources for project on the cluster.
5+
# This role enables users to create, update, and delete resources,
6+
# making it suitable for team members who need to manage resources
7+
# but should not control RBAC or manage permissions for others.
8+
29
apiVersion: rbac.authorization.k8s.io/v1
310
kind: ClusterRole
411
metadata:

docs/book/src/cronjob-tutorial/testdata/project/config/rbac/cronjob_viewer_role.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# permissions for end users to view cronjobs.
1+
# This rule is not used by the project project itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Grants read-only access to CronJob resources.
5+
# This role is intended for users who need visibility into the resources
6+
# without any permissions to modify them. It’s ideal for monitoring purposes and limited-access viewing.
7+
28
apiVersion: rbac.authorization.k8s.io/v1
39
kind: ClusterRole
410
metadata:

docs/book/src/cronjob-tutorial/testdata/project/config/rbac/kustomization.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ resources:
1818
- metrics_auth_role.yaml
1919
- metrics_auth_role_binding.yaml
2020
- metrics_reader_role.yaml
21-
# For each CRD, "Editor" and "Viewer" roles are scaffolded by
21+
# For each CRD, "Admin", "Editor" and "Viewer" roles are scaffolded by
2222
# default, aiding admins in cluster management. Those roles are
2323
# not used by the Project itself. You can comment the following lines
2424
# if you do not want those helpers be installed with your Project.
25+
- cronjob_admin_role.yaml
2526
- cronjob_editor_role.yaml
2627
- cronjob_viewer_role.yaml
2728

docs/book/src/cronjob-tutorial/testdata/project/dist/install.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3865,6 +3865,27 @@ rules:
38653865
---
38663866
apiVersion: rbac.authorization.k8s.io/v1
38673867
kind: ClusterRole
3868+
metadata:
3869+
labels:
3870+
app.kubernetes.io/managed-by: kustomize
3871+
app.kubernetes.io/name: project
3872+
name: project-cronjob-admin-role
3873+
rules:
3874+
- apiGroups:
3875+
- batch.tutorial.kubebuilder.io
3876+
resources:
3877+
- cronjobs
3878+
verbs:
3879+
- '*'
3880+
- apiGroups:
3881+
- batch.tutorial.kubebuilder.io
3882+
resources:
3883+
- cronjobs/status
3884+
verbs:
3885+
- get
3886+
---
3887+
apiVersion: rbac.authorization.k8s.io/v1
3888+
kind: ClusterRole
38683889
metadata:
38693890
labels:
38703891
app.kubernetes.io/managed-by: kustomize

docs/book/src/getting-started/testdata/project/config/rbac/kustomization.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ resources:
1818
- metrics_auth_role.yaml
1919
- metrics_auth_role_binding.yaml
2020
- metrics_reader_role.yaml
21-
# For each CRD, "Editor" and "Viewer" roles are scaffolded by
21+
# For each CRD, "Admin", "Editor" and "Viewer" roles are scaffolded by
2222
# default, aiding admins in cluster management. Those roles are
2323
# not used by the Project itself. You can comment the following lines
2424
# if you do not want those helpers be installed with your Project.
25+
- memcached_admin_role.yaml
2526
- memcached_editor_role.yaml
2627
- memcached_viewer_role.yaml
2728

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This rule is not used by the project project itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Provides full permissions (create, update, delete) over all custom resource objects
5+
# for the specified API resources across the cluster. In addition to resource management,
6+
# it grants users the ability to modify roles and bindings within the cluster,
7+
# allowing them to delegate specific permissions to other users or groups as needed.
8+
9+
apiVersion: rbac.authorization.k8s.io/v1
10+
kind: ClusterRole
11+
metadata:
12+
labels:
13+
app.kubernetes.io/name: project
14+
app.kubernetes.io/managed-by: kustomize
15+
name: memcached-admin-role
16+
rules:
17+
- apiGroups:
18+
- cache.example.com
19+
resources:
20+
- memcacheds
21+
verbs:
22+
- '*'
23+
- apiGroups:
24+
- cache.example.com
25+
resources:
26+
- memcacheds/status
27+
verbs:
28+
- get

docs/book/src/getting-started/testdata/project/config/rbac/memcached_editor_role.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
# permissions for end users to edit memcacheds.
1+
# This rule is not used by the project project itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Allows users to modify all custom resources for project on the cluster.
5+
# This role enables users to create, update, and delete resources,
6+
# making it suitable for team members who need to manage resources
7+
# but should not control RBAC or manage permissions for others.
8+
29
apiVersion: rbac.authorization.k8s.io/v1
310
kind: ClusterRole
411
metadata:

docs/book/src/getting-started/testdata/project/config/rbac/memcached_viewer_role.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# permissions for end users to view memcacheds.
1+
# This rule is not used by the project project itself.
2+
# It is provided to allow the cluster admin to help manage permissions for users.
3+
#
4+
# Grants read-only access to Memcached resources.
5+
# This role is intended for users who need visibility into the resources
6+
# without any permissions to modify them. It’s ideal for monitoring purposes and limited-access viewing.
7+
28
apiVersion: rbac.authorization.k8s.io/v1
39
kind: ClusterRole
410
metadata:

docs/book/src/getting-started/testdata/project/dist/install.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,27 @@ rules:
234234
---
235235
apiVersion: rbac.authorization.k8s.io/v1
236236
kind: ClusterRole
237+
metadata:
238+
labels:
239+
app.kubernetes.io/managed-by: kustomize
240+
app.kubernetes.io/name: project
241+
name: project-memcached-admin-role
242+
rules:
243+
- apiGroups:
244+
- cache.example.com
245+
resources:
246+
- memcacheds
247+
verbs:
248+
- '*'
249+
- apiGroups:
250+
- cache.example.com
251+
resources:
252+
- memcacheds/status
253+
verbs:
254+
- get
255+
---
256+
apiVersion: rbac.authorization.k8s.io/v1
257+
kind: ClusterRole
237258
metadata:
238259
labels:
239260
app.kubernetes.io/managed-by: kustomize

0 commit comments

Comments
 (0)