Skip to content

Commit

Permalink
Feature/read permission (erda-project#2437)
Browse files Browse the repository at this point in the history
* feat: change read permission to get, list and watch all resources

* fix: read api-server host and port from env
  • Loading branch information
CraigMChen authored Oct 19, 2021
1 parent dbe7a78 commit 42cbc90
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/scripts/cluster-agent/shell-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kind: Config
clusters:
- cluster:
api-version: v1
server: "https://kubernetes:443"
server: "https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"
insecure-skip-tls-verify: true
name: "Default"
contexts:
Expand Down
16 changes: 15 additions & 1 deletion modules/cmp/steve/predefined_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,20 @@ rules:
- 'pods/exec'
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: erda-readonly
rules:
- apiGroups:
- "*"
resources:
- '*'
verbs:
- get
- list
- watch
`
ClusterRoleBindingExpression = `
---
Expand All @@ -217,7 +231,7 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: view
name: erda-readonly
subjects:
- kind: Group
name: erda-org-support
Expand Down

0 comments on commit 42cbc90

Please sign in to comment.