Bird
0
0

You need to deploy two containers that must share the same network namespace and persistent storage. Which Kubernetes object should you use?

hard📝 Workflow Q8 of 15
Kubernetes - Pods
You need to deploy two containers that must share the same network namespace and persistent storage. Which Kubernetes object should you use?
ATwo StatefulSets each managing one container
BTwo separate Pods with a shared PersistentVolumeClaim
CA Deployment with two replicas each running one container
DA single Pod containing both containers
Step-by-Step Solution
Solution:
  1. Step 1: Understand network and storage sharing

    Containers in the same Pod share the network namespace and can share volumes.
  2. Step 2: Evaluate options

    Separate Pods do not share IP addresses or network namespaces.
  3. Step 3: Select correct object

    Deploying both containers in a single Pod ensures shared IP and storage.
  4. Final Answer:

    A single Pod containing both containers -> Option D
  5. Quick Check:

    Pods share network and storage among containers [OK]
Quick Trick: Containers in one Pod share network and storage [OK]
Common Mistakes:
  • Assuming separate Pods can share IP addresses
  • Using Deployments or StatefulSets for tightly coupled containers
  • Thinking PersistentVolumeClaim alone shares network namespace

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes