K9s Add Cluster

Published
Length
2 min read

Luis Felipe Dias

All posts

To run a k9s add cluster setup, you update your local kubeconfig file. The terminal tool reads this file to find and load your clusters. Teams often share static kubeconfig files to get developers working fast. They merge new server details and keys into one local file. To save time, admins often grant broad cluster roles to these shared profiles. When a developer switches contexts, they carry those wide permissions into live systems. One wrong keystroke in the terminal can delete a critical po

Add Cluster: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

To run a k9s add cluster setup, you update your local kubeconfig file. The terminal tool reads this file to find and load your clusters.

Teams often share static kubeconfig files to get developers working fast. They merge new server details and keys into one local file. To save time, admins often grant broad cluster roles to these shared profiles. When a developer switches contexts, they carry those wide permissions into live systems. One wrong keystroke in the terminal can delete a critical pod.

How the k9s add cluster workflow works

The terminal tool does not store its own list of servers. Instead, the k9s add cluster process relies on standard Kubernetes context files. When you start the app, it reads your default kubeconfig file path. That file holds three main parts for each target system. It lists the cluster address, the user credentials, and the context link.

To add a new system, you first get the server details from your cloud host. Your cloud tool merges these new entries into your local config file. You can also combine separate config files by setting a path variable. Once the file updates, the terminal UI detects the new context right away.

Inside the terminal interface, you type the context command to view all entries. You pick the new cluster from the list and press enter. The tool then uses your local token or client key to log in. Your screen refreshes and shows the pods and workloads for that system.

What native kubeconfig setup solves and what it misses

Using standard context files keeps your local tool setup simple. Developers do not need to learn a new config format for their terminal UI. If a cluster works with standard command line tools, it works here too. Teams can switch between test and live clusters in two seconds.

Add Cluster: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, local config files leave a major security gap in daily work. Native cluster roles only check who logs in and what resources they can touch. They do not inspect what individual commands or shell sessions do in flight. Also, static tokens and client keys sit on developer laptops in plain text.

If an engineer has update rights on pods, they can open a shell inside a container. Native role rules see the shell start, not the commands run inside it. Native logs also struggle to capture the full output of interactive terminal views. When a team member leaves, revoking local certs across many clusters takes hard manual work. Plus, when a pod query returns raw database strings, native tools show everything. They cannot rewrite sensitive fields like emails, phone numbers, or card numbers in results.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Where does K9s look for new cluster entries?

The tool reads the standard kubeconfig file in your home folder by default. You can also point it to custom files using a system path variable.

Can I switch clusters without restarting the terminal tool?

Yes, you can bring up the context view inside the running app. Selecting a different context switches your active cluster view right away.

Why does a newly added cluster fail to load resources?

This usually happens when your local token expires or lacks view roles. Check that your user role has read rights for the default namespace.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.