Cluster permissions
This page lists the Kubernetes API verbs the chaos service account needs on the target cluster and gives copy-paste ClusterRole and Role manifests for the two install topologies. For Harness platform RBAC (who in your Harness account can View, Create, Edit, Delete, or Execute chaos resources in the UI), go to Governance and RBAC.
The chaos service account is the identity the chaos runner uses against the Kubernetes API. Which service account that is depends on where the Delegate runs:
Delegate runs inside the target cluster. The Delegate's own service account is the chaos service account. Bind the chaos RBAC to it.
Delegate runs outside the target cluster (centralized). Each target cluster has its own chaos service account, which the Harness Kubernetes connector authenticates as. Bind the chaos RBAC to that service account on each target cluster.
The table below lists every API resource the service account uses, the verbs it needs, and why. Use it as a reference when you author a least-privilege ClusterRole or Role. Copy-paste manifests for both topologies are in Example RBAC manifests.
API permission reference
pods
Namespaced + Cluster
create, delete, get, list, patch, update, watch, deletecollection
Inject chaos; create and monitor helper pods
pods/log
Namespaced + Cluster
get, list, watch
Tail helper-pod logs
pods/exec
Namespaced + Cluster
create, get, list, watch
Run commands inside helper pods (pods/exec only accepts create plus read verbs)
secrets, configmaps, services
Namespaced (runner namespace)
create, delete, get, list, patch, update, watch, deletecollection
Create and monitor helper resources
jobs, cronjobs (batch)
Namespaced (runner namespace)
create, delete, get, list, patch, update, watch, deletecollection
Create and monitor helper jobs
deployments (apps)
Namespaced (runner namespace)
create, delete, get, list, patch, update, watch, deletecollection
Manage the chaos runner deployment lifecycle
deployments, replicasets, daemonsets, statefulsets (apps)
Cluster
get, list, watch, update
Discover app parent resources; scale during faults
replicationcontrollers, services
Cluster
get, list, watch
Discover app parent resources
networkpolicies (networking.k8s.io)
Cluster
create, delete, get, list
Network-fault injection
nodes, namespaces
Cluster
get, list, watch
Node-level faults; auto-create network experiments
pods, nodes (metrics.k8s.io)
Cluster
get, list
Optional: read CPU/memory metrics from probes (requires metrics-server)
deploymentconfigs (apps.openshift.io)
Cluster
get, list
Optional: discover OpenShift parent resources
rollouts (argoproj.io)
Cluster
get, list
Optional: discover Argo Rollouts as eligible chaos candidates
The ClusterRole and Role manifests that combine these rules are in Example RBAC manifests below. Apply them as part of the install if you do not want to grant the chaos service account cluster-admin.
Optional permissions
metrics.k8s.iorules are only needed if a probe in your experiments queries the metrics API (for example a Command probe runningkubectl top). Installmetrics-serveron the cluster first.apps.openshift.io/deploymentconfigsandargoproj.io/rolloutsare only needed if the target cluster runs OpenShift or Argo Rollouts respectively.
Namespace versus cluster scope
The same resources appear in both scopes because a chaos infrastructure can be installed either way:
Cluster-wide. Bind the
ClusterRolewith aClusterRoleBinding. The chaos service account can target workloads in any namespace.Namespace-scoped. Bind the
ClusterRolewith aRoleBindingin each onboarded application namespace. Faults that need cluster-level resources (node faults, cluster-wide policies) cannot run on this scope.
Example RBAC manifests
The collapsibles below carry copy-paste-ready RBAC manifests for the two install patterns. Apply the relevant one before you create the Kubernetes chaos infrastructure if you want least privilege instead of cluster-admin.
Next steps
Set up Kubernetes infrastructure: create the chaos infrastructure that uses these permissions.
Network configuration: mTLS and proxy settings for the Delegate and Discovery Agent.
Governance and RBAC: control who in your Harness account can manage chaos resources.
Last updated
Was this helpful?