Skip to content

Commit 281cf5d

Browse files
committed
feature: allow anubispaulista cluster wide read-only access\
1 parent d643551 commit 281cf5d

3 files changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: anubispaulista-view-cluster
5+
subjects:
6+
# this references our stop-gap SA via its unique name/namespace combo
7+
- kind: ServiceAccount
8+
name: anubispaulista
9+
namespace: rbac-admin
10+
# this is for later when we actually have some kind of authentication infra
11+
#- kind: User
12+
# name: anubispaulista@nekropolis.irminsul
13+
# apiGroup: rbac.authorization.k8s.io
14+
roleRef:
15+
kind: ClusterRole
16+
# TODO: we will want to aggregate some extra permissions into this default role
17+
# for all of our custom resources
18+
# until then, this should work however
19+
# https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles
20+
# k get clusterrole view -o yaml
21+
# view provides read-only access to most things, excluding secrets
22+
name: view
23+
apiGroup: rbac.authorization.k8s.io

components/rbac/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
resources:
55
- namespace.yaml
66
- rolebinding.yaml
7+
- clusterrolebinding.yaml
78
- serviceaccount.yaml

manifests/rbac/manifests.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,16 @@ subjects:
6565
- kind: ServiceAccount
6666
name: anubispaulista
6767
namespace: rbac-admin
68+
---
69+
apiVersion: rbac.authorization.k8s.io/v1
70+
kind: ClusterRoleBinding
71+
metadata:
72+
name: anubispaulista-view-cluster
73+
roleRef:
74+
apiGroup: rbac.authorization.k8s.io
75+
kind: ClusterRole
76+
name: view
77+
subjects:
78+
- kind: ServiceAccount
79+
name: anubispaulista
80+
namespace: rbac-admin

0 commit comments

Comments
 (0)