Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RBAC permission for appcatalog #327

Merged
merged 1 commit into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions chart/kubedb/templates/appcatalog-user-roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{ if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: appscode:appcatalog:admin
labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation
rules:
- apiGroups:
- appcatalog.appscode.com
resources:
- "*"
verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: appscode:appcatalog:view
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation
rules:
- apiGroups:
- appcatalog.appscode.com
resources:
- "*"
verbs: ["get", "list", "watch"]
{{ end }}
5 changes: 5 additions & 0 deletions chart/kubedb/templates/cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ rules:
resources:
- "*"
verbs: ["*"]
- apiGroups:
- appcatalog.appscode.com
resources:
- "*"
verbs: ["*"]
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
26 changes: 26 additions & 0 deletions hack/deploy/appcatalog-user-roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: appscode:appcatalog:admin
labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rules:
- apiGroups:
- appcatalog.appscode.com
resources:
- "*"
verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: appscode:appcatalog:view
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
rules:
- apiGroups:
- appcatalog.appscode.com
resources:
- "*"
verbs: ["get", "list", "watch"]
1 change: 1 addition & 0 deletions hack/deploy/kubedb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ if [ "$KUBEDB_ENABLE_RBAC" = true ]; then
${SCRIPT_LOCATION}hack/deploy/service-account.yaml | $ONESSL envsubst | kubectl apply -f -
${SCRIPT_LOCATION}hack/deploy/rbac-list.yaml | $ONESSL envsubst | kubectl auth reconcile -f -
${SCRIPT_LOCATION}hack/deploy/user-roles.yaml | $ONESSL envsubst | kubectl auth reconcile -f -
${SCRIPT_LOCATION}hack/deploy/appcatalog-user-roles.yaml | $ONESSL envsubst | kubectl auth reconcile -f -
fi

if [ "$KUBEDB_RUN_ON_MASTER" -eq 1 ]; then
Expand Down
5 changes: 5 additions & 0 deletions hack/deploy/rbac-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ rules:
resources:
- "*"
verbs: ["*"]
- apiGroups:
- appcatalog.appscode.com
resources:
- "*"
verbs: ["*"]
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down