CKA 模拟真题 Killer.sh | Question 5 | Kubectl sorting
Use context: kubectl config use-context k8s-c1-H
There are various Pods in all namespaces. Write a command into /opt/course/5/find_pods.sh which lists all Pods sorted by their AGE ( metadata.creationTimestamp ).
Write a second command into /opt/course/5/find_pods_uid.sh which lists all Pods sorted by field metadata.uid . Use kubectl sorting for both commands.
译文
在所有命名空间中都有各种Pod。
在 /opt/course/5/find_pods.sh 中写一条命令,列出所有按AGE metadata.createTimestamp 排序的Pod。
在 /opt/course/5/find_pods_uid.sh 中编写第二条命令,列出所有按 metadata.uid 排序的Pod。
两个命令都使用 kubectl 排序。
解答
kubectl get pod -A --sort-by=.metadata.creationTimestamp |
echo "kubectl get pod -A --sort-by=.metadata.uid" > /opt/course/5/find_pods_uid.sh |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Hao DevSecOps!
评论



