Skip to content

Commit

Permalink
Merge pull request #68 from tylerschultz/global-pools-rbac
Browse files Browse the repository at this point in the history
Add RBAC for GlobalInClusterIPPools
  • Loading branch information
schrej authored Feb 1, 2023
2 parents 7a7ce9c + a0f1def commit 13be977
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# It should be run by config/default
resources:
- bases/ipam.cluster.x-k8s.io_inclusterippools.yaml
- bases/ipam.cluster.x-k8s.io_globalinclusterippools.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
Expand Down
24 changes: 24 additions & 0 deletions config/rbac/globalinclusterippool_editor_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# permissions for end users to edit globalinclusterippools.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: globalinclusterippool-editor-role
rules:
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
- globalinclusterippools
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
- globalinclusterippools/status
verbs:
- get
20 changes: 20 additions & 0 deletions config/rbac/globalinclusterippool_viewer_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# permissions for end users to view globalinclusterippools.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: globalinclusterippool-viewer-role
rules:
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
- globalinclusterippools
verbs:
- get
- list
- watch
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
- globalinclusterippools/status
verbs:
- get
26 changes: 26 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,32 @@ metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
- globalinclusterippools
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
- globalinclusterippools/finalizers
verbs:
- update
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
- globalinclusterippools/status
verbs:
- get
- patch
- update
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
Expand Down
3 changes: 3 additions & 0 deletions internal/controllers/ipaddressclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ func (r *IPAddressClaimReconciler) SetupWithManager(ctx context.Context, mgr ctr
//+kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=inclusterippools,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=inclusterippools/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=inclusterippools/finalizers,verbs=update
//+kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=globalinclusterippools,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=globalinclusterippools/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=globalinclusterippools/finalizers,verbs=update
//+kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddressclaims,verbs=get;list;watch;update;patch
//+kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddresses,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddressclaims/status;ipaddresses/status,verbs=get;update;patch
Expand Down

0 comments on commit 13be977

Please sign in to comment.