Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
k9s shows your cluster live in the terminal. Type : and a resource name (:pods, :deploy, :svc, :events) to jump there; / filters; Enter goes inside. It uses your kubeconfig and your RBAC rights, like kubectl.
It is fast for troubleshooting: see a crashing pod, press l for logs, d to describe, s for a shell.
Zo schrijf je het
k9s [OPTIONS]Opties 17
Meest gebruikt
Start options
Keys
Niets past bij dit filter.
Voorbeelden 11
$ als gewone gebruiker# als root (of met sudo)
1Start in a namespace
k9s -n shop2Safe view on production
k9s --context prod --readonly3Start in the Deployments view
k9s -c deploy -A4Find crashing pods
k9s -n shop -c podsType
/Crashto filter, thenlfor the logs andpfor the logs before the restart.5Look at events of the namespace
k9s -n shop -c eventsSort by age with shift-a.
6Restart a deployment
k9s -n shop -c deploySelect it, press
r(rollout restart).7Port-forward to a service
k9s -n shop -c svcSelect it, press shift-f and choose the port.
8Change the context
k9s -c ctxSelect the cluster, press Enter.
9Where are the k9s config and logs?
k9s info10Use another kubeconfig file
k9s --kubeconfig ~/.kube/lab.yaml11Debug a k9s problem
k9s -l debug tail -f "$(k9s info | awk '/Logs/{print $2}')"
Niets past bij dit filter.
Let op
- k9s can delete and edit with one key; use
--readonlyor a read-only RBAC user on production. - It shows only what your RBAC allows; missing views often mean missing rights.
Bestanden
~/.config/k9s/- Config, skins, aliases (see
k9s info).
Tips om te onthouden
- Learn kubectl first (exams have no k9s), then use k9s for speed at work.
Exitcodes
0 | Normal exit. |
1 | Error (for example the cluster cannot be reached). |