Connect K3s workloads to the Infra console
Click Connect K3s in the Infra header, pick a saved Kubernetes or K3s connection, enter a namespace, click Read workloads, choose a workload and click Connect app. DevOpsPad reads the workload’s real label selector and writes an environment and application entry into your local project.
Nothing is written to the cluster. Connection credentials stay on your machine; the project only records the connection name, namespace and selector.
Before you start
You need a saved Kubernetes or K3s connection. Add one under Cluster resources — for example named local-k3s — or click New K3s connection inside the wizard. The usual kubeconfig, SSH tunnel, keychain and authentication rules apply; see kubeconfig contexts and SSH tunnels.
For K3s, the kubeconfig usually comes from /etc/rancher/k3s/k3s.yaml on the server. The K3s cluster access guide explains how to copy it and point it at a reachable address.
Steps
- In Infra, click Connect K3s. The dialog is titled Connect a K3s app.
- Under Cluster connection, choose the saved connection. The dialog shows the context and whether it connects directly to the Kubernetes API or through the saved SSH tunnel.
- Enter a concrete namespace under Namespace, for example
default. - Click Read workloads. DevOpsPad lists the namespace’s workloads and Pod count.
- Pick the workload under Workload.
- Check Environment name and Application name. Both must be lowercase letters, digits and hyphens, up to 63 characters.
- Click Connect app. The message “K3s app connected. Credentials stay on this device.” confirms the mapping was saved and credentials stayed local.
If the namespace has no workloads, the dialog says so (“No workloads to connect in this namespace”). Results are truncated at 500 resources.
Do it from the command line
devopspadctl does the same thing:
devopspadctl cluster inspect --connection local-k3s --namespace default
devopspadctl cluster attach --connection local-k3s --namespace default --environment pro
To register an application that has no workload yet (for example before its first deployment), pass the selector explicitly. This mode does not contact the cluster:
devopspadctl cluster attach --connection local-k3s --namespace default \
--environment pro --application svc-api --selector app=svc-api
Registering the same mapping twice is fine; a conflicting mapping is rejected. See devopspadctl.
Sharing with teammates
Connection names in the project must match a connection each teammate has saved locally. Credentials can differ per person. If two saved connections have the same name, Infra asks you to rename one under Cluster resources before it can resolve the environment.
Troubleshooting
- “No cluster connection matches this environment”: add a connection with the name used in
project.yaml, then refresh the project. - Empty Pod list after connecting: check the namespace and selector in project.yaml. The selector must match the Pod labels.
- Permission errors: see RBAC permissions for the verbs each Infra page needs.
Frequently asked questions
Does connecting a K3s workload change anything in the cluster?
No. The wizard only reads workloads and saves an environment and application mapping in your local project.yaml. It does not create or label anything in the cluster.