Manage Kubernetes through an SSH host

Use a host's own kubectl to see pods, workloads, services and nodes, open logs and shells, restart and scale.

Duo22 can look after a Kubernetes cluster from any SSH host that can reach it. Nothing needs installing: Duo22 runs the host’s own kubectl over your SSH connection, so the cluster’s API never has to be reachable from your computer.

Duo22 looks for kubectl first, then the one bundled with k3s (k3s kubectl), then MicroK8s (microk8s kubectl). Each is tried without and then with passwordless sudo.

Open a cluster

  1. Click Kubernetes in the sidebar (⌘7 on macOS).
  2. Pick the host whose kubectl reaches your cluster and click Open.

You can also right-click a host on the Hosts page or in the sidebar host tree and choose Open Kubernetes. The header shows the cluster’s version and which kubectl is in use (kubectl, k3s or MicroK8s), with (sudo) if it runs through sudo.

Contexts and namespaces

The contexts come from the host’s kubeconfig. When it has more than one, a context picker appears in the toolbar. The namespace picker next to it chooses one namespace or All namespaces. With all namespaces, the lists gain a Namespace column.

Views

Switch between Pods, Workloads, Services and Nodes at the top of the tab. Use Filter to narrow the list and Refresh to reload it. Lists also refresh by themselves every few seconds.

  • Pods: Status, Ready, Restarts, Age and Node.
  • Workloads: deployments, stateful sets and daemon sets, with Ready, Up to date, Available and Images.
  • Services: Type, Cluster IP, External and Ports.
  • Nodes: Status (Ready or NotReady), Roles, Version and Internal IP.

Pod logs and shells

Right-click a pod, or use its buttons:

  • Logs opens a terminal tab following the pod’s logs, starting from the last 500 lines.
  • Shell opens a terminal tab inside the pod (bash if it has one, otherwise sh). It’s only available while the pod is running.

If a pod has several containers, you pick which one from a menu.

Delete removes the pod after asking. If a deployment or another controller owns it, a new pod takes its place.

Restart and scale workloads

  • Restart replaces a workload’s pods one by one.
  • Scale… (deployments and stateful sets) asks for the number of Replicas, from 0 to 1000. Setting 0 stops every pod but keeps the workload. Daemon sets run one pod per node, so they can’t be scaled.

Describe and YAML

Describe and YAML is on pods, workloads, services and nodes. It opens a side panel where you switch between Describe and YAML, and Copy puts the text on your clipboard.

Right-click menus also have Copy name, plus Copy cluster IP on services and Copy internal IP on nodes.

If Duo22 can’t use kubectl on the host, see Fix Docker, Kubernetes and services connection errors.

Still stuck? Check the FAQ, or browse thehelp centre.