备战CKA每日一题——第10天

2020-03-11  本文已影响0人  小E的私房菜

第十题:统计Service中的pod:


题目:Create a file ~/kucc00302.txt that lists all pods that implement Service nginx-service in Namespce ns-ehj,The format of the file should be one pod name per line
解题思路:

本题考的是kubectl的指令,属于基础题型:

解题步骤:
sudo kubectl get svc --show-labels -n ns-ehj | grep nginx-service
image.png
  1. 查找service下的所有pod,并将其放置到文件里去:
sudo kubectl get pods -l run=nginx-service -n ns-ehj | grep NAME|awk '{print}$1' > KUCC00302.txt
上一篇 下一篇

猜你喜欢

热点阅读