How to sort the output of kubectl by a field

kubectl get pods --sort-by=<field>
kubectl get po -n kube-system --sort-by='{.metadata.creationTimestamp}'
kubectl get po -n kube-system -o json

--

--

--

Microsoft MVP | Developer | Passionate about Cloud, .NET and DevOps

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

When git is not working (in CLI)

Changing a field’s type in recent JDKs

AWS VPC with AWS VPN Client vs. OpenVPN Access Server

Fun with Skybox’s in Unity!

Streaming out the monolith

Automate Documentation for Microservices — Continuous Delivery

Time-Boxing 'CREATIVITY'!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Utkarsh Shigihalli

Utkarsh Shigihalli

Microsoft MVP | Developer | Passionate about Cloud, .NET and DevOps

More from Medium

Xavki’s Links : 20220103 week

Fixed a python App deployed on a Kubernetes Cluster

Deploy to Heroku

How to run Podman with Hashicorp Nomad on Ubuntu 20.04 LTS