QuestionQ38

DevSecOps Pipeline-Operate and Monitor Stage

Jason Wylie works as a DevSecOps engineer at an IT company in Sacramento, California. He wants to use Jenkins for continuous integration (CI) and Azure Pipelines for continuous deployment (CD) to deploy a Spring Boot application to an Azure Container Service (AKS) Kubernetes cluster.

He created a namespace for deploying Jenkins in AKS, and then deployed the Jenkins application to the Pod.

Which of the following commands should Jason run to see the pods that have been spun up and are running?

  • A kubectl get pods -s jenkins
  • B kubectl get pods -p jenkins
  • C kubectl get pods -n jenkins
  • D kubectl get pods -k jenkins
Explanation

The -n flag (short for --namespace) tells kubectl which Kubernetes namespace to query. Since Jason deployed Jenkins into a dedicated namespace, running kubectl get pods -n jenkins lists all pods running within that specific namespace. The other flags shown are not valid options for scoping kubectl get pods to a namespace — -s specifies the API server address, and -p/-k are not namespace-related flags for this command.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!