My collection of kubernetes commands


The idea behind this post is to have a list of kubernetes commands that could be useful. I’ll keep adding to it over time, any comments welcome

K9S is a command-line interface (CLI) tool that allows you to manage Kubernetes clusters from the terminal. It provides an intuitive user interface and helps you quickly navigate through resources in your cluster.

Kubectl version
The current version of Kubernetes is installed.

kubectl get nodes

kubectl proxy
The proxy server is operational. The proxy service starts in a few minutes.

kubectl get namespaces

kubectl get pods -A
-A indicates the flag for all namespaces.

Kubectl create namespace *name*

kubectl describe pod *PODName* -n *Namespace*
The detailed breakdown of the pod appears in the namespace

kubectl config set-context --current --namespace=*Namespace*
To swap namespaces permanently

kubectl describe secrets
To access the security token for the admin account created

k config use-context tkg-workload-cluster-01-admin@tkg-workload-cluster-01

k get nodes -o wide

k get svc -n

k expose -n vulnapps-dev deployment drupal --type=NodePort

Leave a Reply

Your email address will not be published. Required fields are marked *