Skip to content

Commit

Permalink
Add role for developer user to access resources on default namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
anjannath committed Sep 30, 2024
1 parent 914f90f commit 32c1c04
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions developer_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: default
name: developer-role
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: developer-role-binding
namespace: default
subjects:
- kind: User
name: developer
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: developer-role
apiGroup: rbac.authorization.k8s.io
3 changes: 3 additions & 0 deletions snc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ retry ${OC} create secret generic htpass-secret --from-file=htpasswd=${HTPASSWD_
retry ${OC} apply -f oauth_cr.yaml
retry ${OC} create clusterrolebinding kubeadmin --clusterrole=cluster-admin --user=kubeadmin

# Add role to give developer user access to 'default' namespace
retry ${OC} apply -f developer_role.yaml

# Remove temp kubeadmin user
retry ${OC} delete secrets kubeadmin -n kube-system

Expand Down

0 comments on commit 32c1c04

Please sign in to comment.