Correct Answer: kubectl logs web-pod -c app-container
The 'kubectl logs' command retrieves logs for a container. The '-c' flag specifies the container name if the pod has multiple containers....
Correct Answer
kubectl logs web-pod -c app-container
Why This Answer Is Correct
The 'kubectl logs' command retrieves logs for a container. The '-c' flag specifies the container name if the pod has multiple containers.
This question evaluates your knowledge of Kubernetes CLI — a core concept tested in cloud certification exams. Understanding Kubernetes CLI is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.
How do you rollback a Kubernetes Deployment named 'web-app' to the directly preceding revision?
Which command applies a configuration file named 'app.yaml' to a Kubernetes cluster?
You want to quickly create a YAML template for a deployment named 'nginx' without actually creating the resource in the cluster. Which combination of kubectl flags should you use?
You are debugging a connection issue and want to run a temporary diagnostic container using the 'busybox' image inside the namespace 'staging', interact with its shell, and have the container be automatically deleted as soon as you exit the shell. Which command should you run?