- A
Run the audit logger as a separate Deployment and route traffic via a Service
Why wrong: A separate Deployment doesn't share the network namespace — traffic routing via a Service adds latency and doesn't intercept all outbound traffic from the application transparently.
- B
Add the audit logger as a second container in the same Pod spec (sidecar pattern)
Containers in the same Pod share the network namespace — the sidecar can listen on localhost and proxy all traffic before it leaves the Pod's network namespace.
- C
Use a DaemonSet for the audit logger on each node to intercept node-level traffic
Why wrong: A node-level DaemonSet intercepts traffic at the node (iptables) level — it can't transparently proxy per-Pod application traffic without complex iptables rules.
- D
Add an initContainer to start the audit logger before the main application
Why wrong: InitContainers run to completion before the main container starts — they're for initialization tasks, not for running alongside the main container.
Sidecar Pattern: Intercept Outbound Traffic in GKE
This ACE practice question tests your understanding of ace exam topics. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A GKE application Pod needs a sidecar container that proxies all outbound network requests through an audit logger before they reach the internet. Both containers share the same network namespace. Which Kubernetes pattern implements this?
Quick Answer
The answer is the sidecar pattern, which is the correct choice because it allows two containers to share the same network namespace within a single Pod, enabling the audit logger to intercept outbound traffic in GKE before it reaches the internet. By configuring the application container to route requests through the sidecar—typically via a localhost proxy or iptables rules—all outbound traffic is logged without external network hops. On the Google Associate Cloud Engineer exam, this scenario tests your understanding of Pod networking and the sidecar pattern as a fundamental Kubernetes design for traffic interception and logging. A common trap is confusing sidecars with init containers or multi-cluster setups; remember that only sidecars run concurrently and share the same namespace. Memory tip: think of the sidecar as a “silent partner” riding alongside the main container, filtering every packet that leaves the Pod.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
Add the audit logger as a second container in the same Pod spec (sidecar pattern)
Option B is correct because the sidecar pattern allows two containers to share the same network namespace within a single Pod, enabling the audit logger to intercept all outbound traffic from the application container before it reaches the internet. This is achieved by configuring the application container to route its outbound requests through the sidecar (e.g., via a localhost proxy or iptables rules), ensuring all traffic is logged without external network hops.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Run the audit logger as a separate Deployment and route traffic via a Service
Why it's wrong here
A separate Deployment doesn't share the network namespace — traffic routing via a Service adds latency and doesn't intercept all outbound traffic from the application transparently.
- ✓
Add the audit logger as a second container in the same Pod spec (sidecar pattern)
Why this is correct
Containers in the same Pod share the network namespace — the sidecar can listen on localhost and proxy all traffic before it leaves the Pod's network namespace.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Use a DaemonSet for the audit logger on each node to intercept node-level traffic
Why it's wrong here
A node-level DaemonSet intercepts traffic at the node (iptables) level — it can't transparently proxy per-Pod application traffic without complex iptables rules.
- ✗
Add an initContainer to start the audit logger before the main application
Why it's wrong here
InitContainers run to completion before the main container starts — they're for initialization tasks, not for running alongside the main container.
Common exam traps
Common exam trap: answer the scenario, not the keyword
Google Cloud often tests the distinction between initContainers and sidecars, where candidates mistakenly choose initContainers because they think 'start before the main app' implies ongoing traffic interception, but initContainers exit after completion and cannot proxy runtime traffic.
Detailed technical explanation
How to think about this question
Under the hood, the sidecar pattern leverages the Pod's shared network namespace (via the `pause` container), allowing the audit logger to bind to localhost and act as a transparent HTTP proxy (e.g., using Envoy or Squid) or manipulate iptables rules to redirect outbound traffic. A real-world scenario is in service mesh implementations like Istio, where an Envoy sidecar intercepts all ingress/egress traffic using iptables rules (e.g., `iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-port 15001`), ensuring logging and policy enforcement without application changes.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A healthcare organisation deploys an application with a public-facing web tier and a private database tier. The database subnet has no public IP and only accepts connections from the web tier's security group. Questions like this test whether you can design cloud network isolation using VNets/VPCs, subnets, and security group rules.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Related practice questions
Related ACE practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Configuring Access and Security practice questions
Practise ACE questions linked to Configuring Access and Security.
Planning and Configuring a Cloud Solution practice questions
Practise ACE questions linked to Planning and Configuring a Cloud Solution.
Ensuring Successful Operation of a Cloud Solution practice questions
Practise ACE questions linked to Ensuring Successful Operation of a Cloud Solution.
Deploying and Implementing a Cloud Solution practice questions
Practise ACE questions linked to Deploying and Implementing a Cloud Solution.
Setting Up a Cloud Solution Environment practice questions
Practise ACE questions linked to Setting Up a Cloud Solution Environment.
ACE fundamentals practice questions
Practise ACE questions linked to ACE fundamentals.
ACE scenario practice questions
Practise ACE questions linked to ACE scenario.
ACE troubleshooting practice questions
Practise ACE questions linked to ACE troubleshooting.
Practice this exam
Start a free ACE practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this ACE question test?
Read the scenario before looking for a memorised answer.
What is the correct answer to this question?
The correct answer is: Add the audit logger as a second container in the same Pod spec (sidecar pattern) — Option B is correct because the sidecar pattern allows two containers to share the same network namespace within a single Pod, enabling the audit logger to intercept all outbound traffic from the application container before it reaches the internet. This is achieved by configuring the application container to route its outbound requests through the sidecar (e.g., via a localhost proxy or iptables rules), ensuring all traffic is logged without external network hops.
What should I do if I get this ACE question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Keep practising
More ACE practice questions
- A team's Cloud Build pipeline must: (1) run unit tests, (2) build a Docker image only if tests pass, (3) push the image…
- A team needs a database backup job to run every day at 2 AM UTC. The job calls an HTTP endpoint to trigger the backup. T…
- A team wants to receive an email alert when the average CPU utilization of VMs in a managed instance group exceeds 80% f…
- A Go service is consuming significantly more CPU than expected. The team suspects an inefficient function but doesn't kn…
- A network team is creating a new VPC and must decide between auto mode and custom mode. Why would they choose custom mod…
- A company organizes its GCP projects by business unit — Finance, Engineering, and Sales. Which resource is best suited t…
Last reviewed: Jun 30, 2026
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.