It will be useful in getting path for jsonpath output for example
k get node -o json |jq -r 'paths (.. | select (. == "docker-desktop")) | join (":")'
If you face an issue with worker node or see that worker node is down use below commands to investigate
systemctl status kubelet.service
journalctl -u kubelet
systemctl deamon-reload
systemctl restart kubelet
Few more Tips
Switch Contexts Quicklyk config use-context <context-name> Quickly switch between different Kubernetes contexts.
View All Resources in a Namespacek get all -n <namespace> Get a summary of all resources in a specific namespace.
Port Forwarding to Access Services Locallyk port-forward svc/<service-name> <local-port>:<service-port> Access a service locally by forwarding a port.
Scale a Deploymentk scale deploy <deployment-name> --replicas=<number-of-replicas> Easily scale the number of replicas in a deployment.
Debugging Podsk describe pod <pod-name> k logs <pod-name> k exec -it <pod-name> -- /bin/bash Use these commands to describe, view logs, and execute commands inside a pod for debugging.
Rolling Back a Deploymentk rollout undo deploy/<deployment-name> Roll back to a previous deployment revision.
View Resource Usagek top nodes k top pods Monitor resource usage of nodes and pods.
Apply Changes from a Filek apply -f <file.yaml> Apply changes to your cluster from a YAML file.
Delete Resources by Labelk delete pods,svc -l <label-key>=<label-value> Delete multiple resources by specifying a label.
View Eventsk get events --sort-by='.metadata.creationTimestamp' View and sort events to troubleshoot issues.