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

Generate RBAC settings declaratively #16

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ignore: |
/config/crd/bases/submariner.io_brokers.yaml
/config/crd/bases/submariner.io_submariners.yaml
/config/crd/bases/submariner.io_servicediscoveries.yaml
/config/rbac/submariner-operator/role.yaml
/config/manager/kustomization.yaml
/config/manifests/bases/submariner.clusterserviceversion.yaml
/bundle
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ generate: vendor/modules.txt

# Generate manifests e.g. CRD, RBAC etc
manifests: generate vendor/modules.txt
controller-gen $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
controller-gen $(CRD_OPTIONS) rbac:roleName=submariner-operator webhook paths="./..." output:crd:artifacts:config=config/crd/bases output:rbac:artifacts:config=config/rbac/submariner-operator

# test if VERSION matches the semantic versioning rule
is-semantic-version:
Expand Down
2 changes: 0 additions & 2 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ resources:
- submariner-operator/service_account.yaml
- submariner-operator/role.yaml
- submariner-operator/role_binding.yaml
- submariner-operator/cluster_role.yaml
- submariner-operator/cluster_role_binding.yaml
- submariner-gateway/service_account.yaml
- submariner-gateway/role.yaml
- submariner-gateway/role_binding.yaml
Expand Down
55 changes: 0 additions & 55 deletions config/rbac/submariner-operator/cluster_role.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions config/rbac/submariner-operator/cluster_role_binding.yaml

This file was deleted.

249 changes: 192 additions & 57 deletions config/rbac/submariner-operator/role.yaml
Original file line number Diff line number Diff line change
@@ -1,63 +1,198 @@

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
kind: ClusterRole
metadata:
creationTimestamp: null
name: submariner-operator
rules:
- apiGroups:
- ""
resources:
- pods
- services
- services/finalizers
- endpoints
- persistentvolumeclaims
- events
- configmaps
- secrets
verbs:
- '*'
- apiGroups:
- apps
resources:
- deployments
- daemonsets
- replicasets
- statefulsets
verbs:
- '*'
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs:
- get
- create
- apiGroups:
- apps
resourceNames:
- submariner-operator
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- apiGroups:
- apps
resources:
- replicasets
verbs:
- get
- apiGroups:
- submariner.io
resources:
- '*'
- servicediscoveries
verbs:
- '*'
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- get
- update
- apiGroups:
- ""
resources:
- namespaces
verbs:
- create
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- patch
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- get
- update
- apiGroups:
- ""
resources:
- services
verbs:
- create
- get
- update
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- create
- get
- update
- apiGroups:
- apps
resources:
- daemonsets
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- get
- list
- update
- watch
- apiGroups:
- apps
resources:
- replicasets
verbs:
- get
- apiGroups:
- rbac
resources:
- clusterrolebindings
verbs:
- create
- get
- update
- apiGroups:
- rbac
resources:
- clusterroles
verbs:
- create
- get
- update
- apiGroups:
- rbac
resources:
- rolebindings
verbs:
- create
- get
- update
- apiGroups:
- rbac
resources:
- roles
verbs:
- create
- get
- update
- apiGroups:
- submariner.io
resources:
- brokers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- submariner.io
resources:
- brokers/status
verbs:
- get
- patch
- update
- apiGroups:
- submariner.io
resources:
- gateways
verbs:
- list
- apiGroups:
- submariner.io
resources:
- gateways
- submariners
verbs:
- list
- watch
- apiGroups:
- submariner.io
resources:
- servicediscoveries
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- submariner.io
resources:
- servicediscoveries/status
verbs:
- get
- patch
- update
- apiGroups:
- submariner.io
resources:
- submariners
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- submariner.io
resources:
- submariners/status
verbs:
- get
- patch
- update
7 changes: 4 additions & 3 deletions config/rbac/submariner-operator/role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: submariner-operator
subjects:
- kind: ServiceAccount
name: submariner-operator
namespace: placeholder
roleRef:
kind: Role
name: submariner-operator
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: submariner-operator
Loading