Skip to content

Instantly share code, notes, and snippets.

@saper
Created February 26, 2026 16:21
Show Gist options
  • Select an option

  • Save saper/71064197b58b2ccb0fa68be606a1c0d6 to your computer and use it in GitHub Desktop.

Select an option

Save saper/71064197b58b2ccb0fa68be606a1c0d6 to your computer and use it in GitHub Desktop.
Sort ReplicaSet objects created by Kubernetes Deployment by the revision number
oc get replicaset -l app=my-app \
-o custom-columns='NAME=:.metadata.name,REVISION:.metadata.annotations.deployment\.kubernetes\.io/revision' \
--sort-by='.metadata.annotations.deployment\.kubernetes\.io/revision'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment