In this short article, we are going to see some command variations and options with kubectl get nodes
to sort the nodes by age ( creation time), last transition time, IP address etc.
let us see the quick Kubectl command to Get nodes in the cluster sorted by their Age
~ kubectl get nodes – sort-by=".metadata.creationTimestamp"
Sometimes you would want to sort the Nodes by their last transition time and you can use the following command
~ kubectl get nodes – sort-by=".status.conditions[?(@.reason == 'KubeletReady' )].lastTransitionTime"
Here is a command to get nodes sorted by their IP range
kubectl get nodes – sort-by=".status.addresses[?(@.type == 'InternalIP' )].address"
More from Middleware Inventory
-
Find Who owns the Private IP in AWS | DevOps JunctionAt times of troubleshooting an issue or doing a forensic on a security incident in your AWS account. Finding who owns Private IP plays a major role. Do you know Almost all the AWS resources like Load Balancers, RDS, EFS has their own private IP address. So how to find…
-
How to restart all deployments in namespace - Kubectl | Devops JunctionRestart Namespace all Deployments after k8s v1.15 You can simply use the kubectl rollout restart command that takes care of restarting all the deployments in a namespace If you specify only the namespace and not a specific deployment, all the deployments in the namespace would be restarted kubectl rollout restart…
-
Kubernetes restart daemonset - kubectl | Devops JunctionIn this quick article, let us learn how to restart the Kubernetes DaemonSet and all the pods created by the DaemonSet. Before we move on to the objective, here are some basics. real quick. DaemonSet is to deploy a specific application/feature to your Kubernetes cluster and to make sure it…
-
Kubectl Get Nodes with Instance Type and Arch - K8s | Devops JunctionIn this post, we are going to give a quick command to list your worker nodes with their instance types and architecture. I have posted this for the Amazon EKS Kubernetes cluster but with slight modification, you can use the same approach for any other managed Kubernetes cluster too. While…
-
How to check Kubernetes and Kubectl Version | Devops JunctionHow to check the Kubernetes and Kubectl Version using the kubectl command line that's the objective of this article. As you know the kubectl is a command line tool for communicating with a Kubernetes cluster's control plane, using the Kubernetes API. Provided by Kubernetes itself if you are new to Kubectl and…