Skip to content

Commit

Permalink
add default rbac rules for devbox runtime and runtime class.
Browse files Browse the repository at this point in the history
  • Loading branch information
lingdie committed Aug 29, 2024
1 parent 73edbd5 commit be5acfa
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/devbox/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ spec:
args:
- --leader-elect
- --health-probe-bind-address=:8081
- --registry-addr={{ .registryAddr }}
- --registry-user={{ .registryUser }}
- --registry-password={{ .registryPassword }}
- --auth-addr={{ .authAddr }}
image: controller:latest
name: manager
securityContext:
Expand Down
26 changes: 26 additions & 0 deletions controllers/devbox/config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,29 @@ subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: devbox-runtime-default-user-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: runtime-viewer-role
subjects:
- kind: Group
name: system:serviceaccounts
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: devbox-runtimeclass-default-user-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: runtimeclass-viewer-role
subjects:
- kind: Group
name: system:serviceaccounts
apiGroup: rbac.authorization.k8s.io
26 changes: 26 additions & 0 deletions controllers/devbox/deploy/manifests/deploy.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,32 @@ subjects:
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: devbox-devbox-runtime-default-user-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: devbox-runtime-viewer-role
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:serviceaccounts
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: devbox-devbox-runtimeclass-default-user-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: devbox-runtimeclass-viewer-role
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:serviceaccounts
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
Expand Down

0 comments on commit be5acfa

Please sign in to comment.