Skip to content

Commit

Permalink
Add new ClusterRole and ClusterRoleBindings for CSR (#498)
Browse files Browse the repository at this point in the history
* new clusterrole and clusterrolebindings for CSR

Signed-off-by: Sachin Kumar Singh <[email protected]>

* separated clusterrole and clusterrolebindings

Signed-off-by: Sachin Kumar Singh <[email protected]>

* created a new clusterole for CSR

* improved clusterrole and clusterrolebinding names
  • Loading branch information
sachinkumarsingh092 authored Apr 21, 2022
1 parent 55f0156 commit 85a9dd7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
14 changes: 14 additions & 0 deletions config/rbac/byoh_csr_creator_clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: byoh-csr-creator-clusterrole
rules:
- apiGroups:
- certificates.k8s.io
resources:
- certificatesigningrequests
verbs:
- create
- get
- watch
12 changes: 12 additions & 0 deletions config/rbac/byoh_csr_creator_clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: byoh-csr-creator-clusterrole-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: byoh-csr-creator-clusterrole
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:bootstrappers:byoh
8 changes: 8 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ rules:
- get
- list
- watch
- apiGroups:
- certificates.k8s.io
resources:
- certificatesigningrequests
verbs:
- create
- get
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
Expand Down
1 change: 1 addition & 0 deletions controllers/infrastructure/byohost_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type ByoHostReconciler struct {
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=byohosts,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=byohosts/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=byohosts/finalizers,verbs=update
//+kubebuilder:rbac:groups=certificates.k8s.io,resources=certificatesigningrequests,verbs=create;get;watch

// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
Expand Down

0 comments on commit 85a9dd7

Please sign in to comment.