Oladimeji:
Need some help with the question below
Oladimeji:
kubectl get deployments -n admin2406 --sort-by=.metadata.name -o custom-columns=NAME:.metadata.name,CONTAINER_IMAGE:.spec.template.spec.containers[*].image,READY_REPLICAS:.status.readyReplicas,NAMESPACE:.metadata.namespaceNAME CONTAINER_IMAGE READY_REPLICAS NAMESPACE
deploy1 nginx 1 admin2406
deploy2 nginx:alpine 1 admin2406
deploy3 nginx:1.16 1 admin2406
deploy4 nginx:1.17 1 admin2406deploy5 nginx:latest 1 admin2406
Oladimeji:
“The data should be sorted by the increasing order of the deployment name
.” , what does that mean, I am lost @Rahul Soni
KK:
Hi @Oladimeji
KK:
It means you have to sort it by deployment name
KK:
Your command looks good, just update the custom-column from NAME to DEPLOYMENT
kubectl get deployments -n admin2406 --sort-by=.metadata.name -o custom-columns=DEPLOYMENT:.metadata.name,CONTAINER_IMAGE:.spec.template.spec.containers[*].image,READY_REPLICAS:.status.readyReplicas,NAMESPACE:.metadata.namespace