How to Configure Configure K9s

Published
Length
3 min read

Luis Felipe Dias

All posts

When you configure k9s, you control how your terminal tool talks to Kubernetes clusters. You set it up safely by binding local views to strict cluster roles and read-only defaults. Many teams use this terminal tool to watch pods, read logs, and fix broken apps. A clean setup stops accidents before they happen in live clusters. It also keeps local files clean and easy for your team to share. How to configure k9s with safe defaults The tool reads your standard Kubernetes config file to find cl

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

When you configure k9s, you control how your terminal tool talks to Kubernetes clusters. You set it up safely by binding local views to strict cluster roles and read-only defaults.

Many teams use this terminal tool to watch pods, read logs, and fix broken apps. A clean setup stops accidents before they happen in live clusters. It also keeps local files clean and easy for your team to share.

How to configure k9s with safe defaults

The tool reads your standard Kubernetes config file to find clusters and user keys. It also uses its own local settings file to control screen refresh rates and view modes. When you configure k9s, you affect every human user who runs the tool on a laptop.

Start by turning on the read-only setting in your local tool file. This safe default stops users from deleting pods or editing live deployments by mistake. A user can still read logs and check app health without risking cluster uptime.

Next, map each cluster context to a least-privilege role in Kubernetes. Do not let the tool run with full admin rights during normal daily checks. Give developers a role that only views namespaces tied to their own apps.

You can also set custom shortcuts and resource views for each cluster. Keep these view files in version control so the whole team uses the same safe rules. Review these files often to remove old cluster names and dead contexts.

How to manage cluster contexts and namespaces

Switching between test and live clusters in a terminal can cause big mistakes. An engineer might think they are in a test space and delete a live pod. Good context settings help prevent this common human error.

Lock each cluster context to a specific default namespace in your local setup. This step keeps the tool focused on one small area when it starts up. It also cuts down the noise from system pods that most users do not need to touch.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Use distinct color themes for test, staging, and live clusters in your local files. A bright red border on a live cluster warns the user to be careful. Visual cues work well alongside strict role rules on the cluster side.

Checking logs and limits of static files

You must check both local settings and cluster audit logs to verify your setup. Ask an engineer to open the tool and try to delete a test pod. The tool or the cluster role should block the action right away.

Turn on Kubernetes audit logs to track every request the terminal tool sends. Check these logs to see which user read secrets or ran shell commands in pods. Make sure every log entry maps to one real person on your team.

Static local files still leave big gaps once a user logs in to a cluster. Anyone can edit their own local file to turn off the read-only mode. If their cluster role allows writes, they can now change live resources at will.

Also, static roles cannot hide sensitive data inside pod logs or secret objects. If a role allows reading secrets, the tool shows every key in plain text. If an app prints emails, phone numbers, or card numbers to logs, those show up too. Static setups also grant broad shell rights to an entire namespace instead of one command.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Where does the tool store its local settings?

The tool stores its main settings file in a standard user config folder on your machine. It also saves separate view and skin files for each cluster context you visit.

Does read-only mode in the tool replace Kubernetes RBAC?

No, local read-only mode only hides action keys inside the terminal screen. You still need strict Kubernetes RBAC roles to block write calls at the API server.

How can we stop users from viewing plain text secrets in the tool?

Remove secret read rights from your standard developer cluster roles right away. If someone needs to check a secret, use a workflow that masks sensitive fields in results.

The query runs. The emails stay hidden.