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

Automatically sync RBAC files in helm chart #943

Merged
merged 1 commit into from
Jul 4, 2023
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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
webhook output:webhook:artifacts:config=config/components/webhook\
paths="./..."

.PHONY: update-helm-crd
update-helm-crd: manifests
./hack/update-helm-crd.sh
.PHONY: update-helm
update-helm: manifests
./hack/update-helm.sh

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations and client-go libraries.
Expand Down Expand Up @@ -176,7 +176,7 @@ ci-lint: golangci-lint
$(GOLANGCI_LINT) run --timeout 15m0s

.PHONY: verify
verify: gomod-verify vet ci-lint fmt-verify toc-verify manifests generate update-helm-crd
verify: gomod-verify vet ci-lint fmt-verify toc-verify manifests generate update-helm
git --no-pager diff --exit-code config/components apis charts/kueue/templates/crd client-go

##@ Build
Expand Down
10 changes: 5 additions & 5 deletions charts/kueue/templates/rbac/auth_proxy_client_clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kueue.fullname" . }}-metrics-reader
name: '{{ include "kueue.fullname" . }}-metrics-reader'
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
- nonResourceURLs:
- "/metrics"
verbs:
- get
26 changes: 13 additions & 13 deletions charts/kueue/templates/rbac/auth_proxy_role.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kueue.fullname" . }}-proxy-role
name: '{{ include "kueue.fullname" . }}-proxy-role'
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
- apiGroups:
- authentication.k8s.io
Copy link
Contributor Author

@stuton stuton Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue regarding indents which yq makes. The flag -I0 doesn't work properly, that's mean ignore indent. Once the problem is solved, I will return the indents back.

resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
8 changes: 4 additions & 4 deletions charts/kueue/templates/rbac/auth_proxy_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "kueue.fullname" . }}-proxy-rolebinding
name: '{{ include "kueue.fullname" . }}-proxy-rolebinding'
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "kueue.fullname" . }}-proxy-role'
subjects:
- kind: ServiceAccount
name: '{{ include "kueue.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
- kind: ServiceAccount
name: '{{ include "kueue.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
8 changes: 4 additions & 4 deletions charts/kueue/templates/rbac/batch_admin_role.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# permissions for end users to manage all kueue objects.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kueue.fullname" . }}-batch-admin-role
name: '{{ include "kueue.fullname" . }}-batch-admin-role'
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rules: null
- matchLabels:
rbac.kueue.x-k8s.io/batch-admin: "true"
8 changes: 4 additions & 4 deletions charts/kueue/templates/rbac/batch_user_role.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# permissions for end users to run jobs.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kueue.fullname" . }}-batch-user-role
name: '{{ include "kueue.fullname" . }}-batch-user-role'
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.kueue.x-k8s.io/batch-user: "true"
rules: null
- matchLabels:
rbac.kueue.x-k8s.io/batch-user: "true"
39 changes: 20 additions & 19 deletions charts/kueue/templates/rbac/clusterqueue_editor_role.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# permissions for end users to edit clusterqueues.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kueue.fullname" . }}-clusterqueue-editor-role
name: '{{ include "kueue.fullname" . }}-clusterqueue-editor-role'
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rules:
- apiGroups:
- kueue.x-k8s.io
resources:
- clusterqueues
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kueue.x-k8s.io
resources:
- clusterqueues/status
verbs:
- get
- apiGroups:
- kueue.x-k8s.io
resources:
- clusterqueues
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kueue.x-k8s.io
resources:
- clusterqueues/status
verbs:
- get
31 changes: 16 additions & 15 deletions charts/kueue/templates/rbac/clusterqueue_viewer_role.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# permissions for end users to view clusterqueues.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kueue.fullname" . }}-clusterqueue-viewer-role
name: '{{ include "kueue.fullname" . }}-clusterqueue-viewer-role'
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rules:
- apiGroups:
- kueue.x-k8s.io
resources:
- clusterqueues
verbs:
- get
- list
- watch
- apiGroups:
- kueue.x-k8s.io
resources:
- clusterqueues/status
verbs:
- get
- apiGroups:
- kueue.x-k8s.io
resources:
- clusterqueues
verbs:
- get
- list
- watch
- apiGroups:
- kueue.x-k8s.io
resources:
- clusterqueues/status
verbs:
- get
39 changes: 20 additions & 19 deletions charts/kueue/templates/rbac/job_editor_role.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
# permissions for end users to edit jobs.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kueue.fullname" . }}-job-editor-role
name: '{{ include "kueue.fullname" . }}-job-editor-role'
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rbac.kueue.x-k8s.io/batch-user: "true"
rules:
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- jobs/status
verbs:
- get
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- jobs/status
verbs:
- get
31 changes: 16 additions & 15 deletions charts/kueue/templates/rbac/job_viewer_role.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# permissions for end users to view jobs.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kueue.fullname" . }}-job-viewer-role
name: '{{ include "kueue.fullname" . }}-job-viewer-role'
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rbac.kueue.x-k8s.io/batch-user: "true"
rules:
- apiGroups:
- batch
resources:
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- jobs/status
verbs:
- get
- apiGroups:
- batch
resources:
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- jobs/status
verbs:
- get
66 changes: 33 additions & 33 deletions charts/kueue/templates/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# permissions to do leader election.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "kueue.fullname" . }}-leader-election-role
namespace: '{{ .Release.Namespace }}'
name: '{{ include "kueue.fullname" . }}-leader-election-role'
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
9 changes: 4 additions & 5 deletions charts/kueue/templates/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "kueue.fullname" . }}-leader-election-rolebinding
namespace: '{{ .Release.Namespace }}'
name: '{{ include "kueue.fullname" . }}-leader-election-rolebinding'
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: '{{ include "kueue.fullname" . }}-leader-election-role'
subjects:
- kind: ServiceAccount
name: '{{ include "kueue.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
- kind: ServiceAccount
name: '{{ include "kueue.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
Loading