Implementing DevOps Solutions and Practices Using Cisco Platforms (DEVOPS) — Question 41
A developer has created a deployment that should launch a pod to run their database service. The pod should launch with a metadata name of "Cisco-DB," and the developer has added it to the "Cisco" namespace in their deployment.
Which Kubernetes command confirms that the service is running and usable?
Answer options
- A. kubectl -n Cisco get services | grep "Cisco-DB"
- B. kubectl -n Cisco get pods | grep "Cisco-DB"
- C. kubectl get pods | grep "Cisco-DB"
- D. kubectl -n Cisco get service | grep "Cisco-DB"
Correct answer: C
Explanation
The correct answer is C because it checks all pods in the default namespace, which is where the service typically operates unless specified otherwise. Options A and D are incorrect as they refer to services instead of pods, and option B is limited to the 'Cisco' namespace, which may not reflect the default context.