Skip to content

Cloud & infrastructure

Connect a cluster by installing the Dave agent with Helm.

An in-cluster agent dials out to Dave, so no inbound access to your cluster is needed.

  1. Point your shell at the right cluster:

    Terminal window
    kubectl config current-context
    kubectl config use-context YOUR_CONTEXT

    You need the rights listed below.

  2. In Dave, go to Integrations → Add integration → Kubernetes.

  3. Enter a Cluster name. This doubles as the label — see labels.

  4. Choose Connect Cluster. Dave shows a Helm command under Run this to finish the setup.

  5. Run it. It installs the release dave-agent into the dave-system namespace, creating the namespace if needed. Its registration token is valid for 15 minutes; if it lapses, choose Resume setup for a fresh command.

  6. Watch the agent come up:

    Terminal window
    kubectl get pods -l app.kubernetes.io/name=dave-agent -A

    The connection goes Active once the agent connects.

Each pending cluster gets its own command with its own registration token, so do not reuse one across clusters.

The chart creates a service account dave-agent in dave-system, bound cluster-wide to this ClusterRole, dave-agent-read-only:

rules:
- nonResourceURLs: ['/api', '/api/*', '/apis', '/apis/*', '/healthz', '/readyz', '/version']
verbs: ['get']
- apiGroups: ['', 'apps', 'batch', 'networking.k8s.io', 'storage.k8s.io']
resources:
- namespaces
- nodes
- pods
- deployments
- statefulsets
- daemonsets
- replicasets
- services
- endpoints
- configmaps
- persistentvolumes
- persistentvolumeclaims
- ingresses
- jobs
- cronjobs
- storageclasses
verbs: ['get', 'list', 'watch']
- apiGroups: ['']
resources:
- pods/log
verbs: ['get']
- apiGroups: ['metrics.k8s.io']
resources:
- pods
- nodes
verbs: ['get', 'list']
- apiGroups: ['argoproj.io', 'autoscaling.k8s.io']
resources: ['*']
verbs: ['get', 'list', 'watch']

Dave cannot read Secrets, exec into pods, or change anything. The only extra grant is a namespaced Role, dave-agent-credential, that lets the agent read and update its own credential Secret:

rules:
- apiGroups: ['']
resources: ['secrets']
resourceNames: ['dave-agent-credential']
verbs: ['get', 'patch']

Whoever runs the Helm command needs to create a namespace, a ClusterRole and ClusterRoleBinding, and a service account, Role, RoleBinding, Secrets and Deployment in dave-system — in practice, cluster admin.

To review what the agent can do:

Terminal window
kubectl get clusterrole dave-agent-read-only -o yaml
kubectl get clusterrolebinding dave-agent-read-only -o yaml
helm list -n dave-system

Disconnect in Dave stops Dave receiving data from the agent immediately, but does not remove the agent from the cluster. Uninstall it yourself:

Terminal window
helm uninstall dave-agent -n dave-system
kubectl delete namespace dave-system

The same goes for cancelling an unfinished setup — the install command stops working, but a release you already installed stays until you uninstall it. Reconnecting a cluster needs a fresh install.