Skip to content

Commit 4ea479c

Browse files
authored
Merge pull request #4299 from damsien/master
✨ Include admin ClusterRole and add it to the scaffold
2 parents 57892ba + aa754c7 commit 4ea479c

File tree

79 files changed

+1453
-64
lines changed

Some content is hidden

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

79 files changed

+1453
-64
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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 full permissions ('*') over batch.tutorial.kubebuilder.io.
5+
# This role is intended for users authorized to modify roles and bindings within the cluster,
6+
# enabling them to delegate specific permissions to other users or groups as needed.
7+
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: ClusterRole
10+
metadata:
11+
labels:
12+
app.kubernetes.io/name: project
13+
app.kubernetes.io/managed-by: kustomize
14+
name: cronjob-admin-role
15+
rules:
16+
- apiGroups:
17+
- batch.tutorial.kubebuilder.io
18+
resources:
19+
- cronjobs
20+
verbs:
21+
- '*'
22+
- apiGroups:
23+
- batch.tutorial.kubebuilder.io
24+
resources:
25+
- cronjobs/status
26+
verbs:
27+
- get

docs/book/src/cronjob-tutorial/testdata/project/config/rbac/cronjob_editor_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 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+
# Grants permissions to create, update, and delete resources within the batch.tutorial.kubebuilder.io.
5+
# This role is intended for users who need to manage these resources
6+
# but should not control RBAC or manage permissions for others.
7+
28
apiVersion: rbac.authorization.k8s.io/v1
39
kind: ClusterRole
410
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 batch.tutorial.kubebuilder.io resources.
5+
# This role is intended for users who need visibility into these resources
6+
# without permissions to modify them. It is 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: 3 additions & 2 deletions
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
23-
# not used by the Project itself. You can comment the following lines
23+
# not used by the {{ .ProjectName }} 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: 3 additions & 2 deletions
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
23-
# not used by the Project itself. You can comment the following lines
23+
# not used by the {{ .ProjectName }} 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: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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 full permissions ('*') over cache.example.com.
5+
# This role is intended for users authorized to modify roles and bindings within the cluster,
6+
# enabling them to delegate specific permissions to other users or groups as needed.
7+
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: ClusterRole
10+
metadata:
11+
labels:
12+
app.kubernetes.io/name: project
13+
app.kubernetes.io/managed-by: kustomize
14+
name: memcached-admin-role
15+
rules:
16+
- apiGroups:
17+
- cache.example.com
18+
resources:
19+
- memcacheds
20+
verbs:
21+
- '*'
22+
- apiGroups:
23+
- cache.example.com
24+
resources:
25+
- memcacheds/status
26+
verbs:
27+
- get

docs/book/src/getting-started/testdata/project/config/rbac/memcached_editor_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 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+
# Grants permissions to create, update, and delete resources within the cache.example.com.
5+
# This role is intended for users who need to manage these resources
6+
# but should not control RBAC or manage permissions for others.
7+
28
apiVersion: rbac.authorization.k8s.io/v1
39
kind: ClusterRole
410
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 cache.example.com resources.
5+
# This role is intended for users who need visibility into these resources
6+
# without permissions to modify them. It is 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)