Usually, my articles about Kubernetes administration are full of kubectl commands for administration for your clusters. Recently, however, someone pointed me to the k9s project for a fast way to review and resolve day-to-day issues in Kubernetes. It’s been a huge improvement to my workflow and I’ll show you how to get started in this tutorial.

Installation can be done on a Mac, in Windows, and Linux. Instructions for each operating system can be found here. Be sure to complete installation to be able to follow along.

I will be using Linux and Minikube, which is a lightweight way to run Kubernetes on a personal computer. Install it following this tutorial or by using the documentation.

Setting the k9s configuration file

Once you’ve installed the k9s app, it’s always good to start with the help command.

$ k9s help
K9s is a CLI to view and manage your Kubernetes clusters.

Usage:
 k9s [flags]
 k9s [command]

Available Commands:
 help    Help about any command
 info    Print configuration info
 version  Print version/build info

Flags:
 -A, --all-namespaces        Launch K9s in all namespaces
   --as string           Username to impersonate for the operation
   --as-group stringArray     Group to impersonate for the operation
   --certificate-authority string Path to a cert file for the certificate authority
   --client-certificate string   Path to a client certificate file for TLS
   --client-key string       Path to a client key file for TLS
   --cluster string        The name of the kubeconfig cluster to use
 -c, --command string        Specify the default command to view when the application launches
   --context string        The name of the kubeconfig context to use
   --demo             Enable demo mode to show keyboard commands
   --headless           Turn K9s header off
 -h, --help             help for k9s
   --insecure-skip-tls-verify   If true, the server's caCertFile will not be checked for validity
   --kubeconfig string       Path to the kubeconfig file to use for CLI requests
 -l, --logLevel string        Specify a log level (info, warn, debug, error, fatal, panic, trace) (default "info")
 -n, --namespace string       If present, the namespace scope for this CLI request
   --readonly           Disable all commands that modify the cluster
 -r, --refresh int          Specify the default refresh rate as an integer (sec) (default 2)
   --request-timeout string    The length of time to wait before giving up on a single server request
   --token string         Bearer token for authentication to the API server
   --user string          The name of the kubeconfig user to use

Use "k9s [command] --help" for more information about a command.

#kubernetes #k9s project #kubectl commands #mac #linux #minikube

Speed up administration of Kubernetes clusters with k9s
3.95 GEEK