Skip to content
Open
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
13 changes: 13 additions & 0 deletions helm/kagent-tools/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@
- horizontalpodautoscalers
verbs: ["get", "list", "watch"]

# kagent resources (api.kagent.dev/v1alpha3)
- apiGroups: ["api.kagent.dev"]
resources:
- agents
- agenttemplates
- egresspolicies
- harnesses
- modelconfigs
- modelproviderconfigs
- remotemcpservers
- sandboxtemplates
verbs: ["get", "list", "watch"]

{{- if .Values.rbac.allowSecrets }}
# Secrets (opt-in)
- apiGroups: [""]
Expand Down
20 changes: 20 additions & 0 deletions helm/kagent-tools/tests/rbac_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ tests:
of: ClusterRoleBinding
template: clusterrolebinding.yaml

- it: should grant read-only access to kagent v1alpha3 resources
set:
rbac.readOnly: true
template: clusterrole.yaml
asserts:
- contains:
path: rules
content:
apiGroups: ["api.kagent.dev"]
resources:
- agents
- agenttemplates
- egresspolicies
- harnesses
- modelconfigs
- modelproviderconfigs
- remotemcpservers
- sandboxtemplates
verbs: ["get", "list", "watch"]

- it: should render Roles when rbac.namespaces is set
set:
rbac.namespaces:
Expand Down
1 change: 1 addition & 0 deletions helm/kagent-tools/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ rbac:
# and the global.watchNamespaces fallback would be unreachable.
# namespaces: []
# When true, deploys a read-only ClusterRole (get, list, watch) instead of cluster-admin.
# The read-only role covers core workloads and kagent resources (api.kagent.dev).
# Pairs well with the --read-only CLI flag which disables write operations at the application layer.
# Only applies when rbac.create is true.
# Defaults to False as to not introduce breaking changes. Worth revisiting later on.
Expand Down
Loading