For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cluster permissions

Kubernetes API permissions the chaos service account needs on the target cluster to inject DDCR-based faults, plus copy-paste RBAC manifests for the two install topologies.

DEFAULT IS CLUSTER-ADMIN

The default install grants the Delegate's service account cluster-admin and works out of the box. Use the least-privilege manifests below only if your environment forbids cluster-admin.

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

Resource
Scope
Verbs
Used for

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.io rules are only needed if a probe in your experiments queries the metrics API (for example a Command probe running kubectl top). Install metrics-server on the cluster first.

  • apps.openshift.io/deploymentconfigs and argoproj.io/rollouts are 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 ClusterRole with a ClusterRoleBinding. The chaos service account can target workloads in any namespace.

  • Namespace-scoped. Bind the ClusterRole with a RoleBinding in 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.

Dedicated delegate approach (Delegate in target cluster)

Pairs with the dedicated delegate install under Limited Permissions. The Delegate's service account is the chaos service account. Apply the manifests below in the order shown.

1. Service account:

2. Namespace Role and RoleBinding (lets the Delegate manage chaos runner pods in its own namespace):

3. Chaos ClusterRole (discovery + chaos permissions, applied once per cluster):

4. Onboard namespaces. Either bind cluster-wide (all namespaces) or per app namespace.

Cluster-wide:

Per app namespace (repeat per onboarded namespace, replacing app1 with the namespace name):

Centralized delegate approach (Delegate outside target cluster)

Pairs with the centralized delegate install. Apply these manifests to the target cluster (not the cluster running the Delegate). The Kubernetes connector's service account is the chaos service account.

1. Service account and token secret:

Use a dedicated namespace such as harness-delegate-chaos on the target cluster.

2. Namespace Role and RoleBinding (chaos runner permissions in the chaos namespace):

3. Generate the SA token:

Use this token plus the cluster master URL (kubectl cluster-info) when you create the Kubernetes connector in Harness.

4. Chaos ClusterRole. Apply the same chaos-clusterrole from the in-cluster example above (it is identical for both topologies).

5. Bind the ClusterRole. Either cluster-wide (chaos can target every namespace) or per onboarded namespace.

Cluster-wide:

Per app namespace (repeat per onboarded namespace, replacing app1 with the namespace name):

Next steps

Last updated

Was this helpful?