Posts

Showing posts with the label k8s

One liner command to get restart reason for a POD in Kubernetes

Run: kubectl describe pod -n <namespace> <Pod name> | grep -A2 -B2 Reason For e.g.: kubectl describe pod -n myns my-pod-6d9bdcfbfc-k9jqw | grep -A2 -B2 Reason

Get a self contained k8s config for usage in other tools(Use with caution)

Many a times we would like to view/manage the K8s cluster remotely using clients like Lens , k9s etc. I was searching for this information across, and found the below commands: # kubectl config view --flatten > k8s.cfg On the remote system, place the k8s.cfg file under: <user home dir>\.kube For e.g., on a Windows desktop for user abc, place it under: C:\Users\abc\.kube Note: You need to use this with caution as you can access complete K8s cluster with this data.