Skip to content

Commit

Permalink
Rbac for can-adopt
Browse files Browse the repository at this point in the history
Signed-off-by: Jirka Kremser <[email protected]>
  • Loading branch information
jkremser committed Jan 22, 2025
1 parent 69a9429 commit bfb78ae
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions kedify-agent/files/kedify-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ spec:
- InstallOnly
- Adopt
- Auto
- Disabled
type: string
name:
description: Name of the KEDA installation
Expand Down
61 changes: 61 additions & 0 deletions kedify-agent/templates/rbacs/can-adopt-keda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{- if .Values.agent.rbac.create }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: can-adopt-keda
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- apps
resources:
- deployments
verbs:
- update
resourceNames:
- keda-operator
- keda-admission-webhooks
- keda-operator-metrics-apiserver
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kedify-agent-can-adopt-keda
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: can-adopt-keda
subjects:
- kind: ServiceAccount
name: kedify-agent
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: can-query-api-registrations
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- apiregistration.k8s.io
resources:
- apiservices
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: can-query-api-registrations
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: can-query-api-registrations
subjects:
- kind: ServiceAccount
name: kedify-agent
namespace: {{ .Release.Namespace }}
{{- end }}

0 comments on commit bfb78ae

Please sign in to comment.