You are troubleshooting connectivity to a new payments-api Deployment that exposes a Service in the default namespace of a GKE cluster. You have authenticated to the cluster from Cloud Shell and want to quickly confirm whether the Service received a ClusterIP and External IP without displaying resources from other namespaces. Which single kubectl command should you run?
When you are connected to a GKE cluster, kubectl uses the current context's namespace-default unless changed. Running "kubectl get services" (or its short form "kubectl get svc") lists only the Services in that namespace and shows the standard columns, including NAME, TYPE, CLUSTER-IP, EXTERNAL-IP, PORT(S), and AGE. Adding the -A or --all-namespaces flag overrides this behavior and returns Services from every namespace. Therefore, the concise command without any namespace-override flags is correct; it displays the required IP information for just the default namespace.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a ClusterIP in GKE?
Open an interactive chat with Bash
What is an External IP in GKE?
Open an interactive chat with Bash
What is the purpose of kubectl in Kubernetes?
Open an interactive chat with Bash
What is the purpose of ClusterIP and External IP in Kubernetes Services?
Open an interactive chat with Bash
What does adding the '-A' flag to a kubectl command do?
Open an interactive chat with Bash
How does Kubernetes determine the namespace for a command?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Ensuring successful operation of a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .