0
0
Kubernetesdevops~20 mins

Pod-to-Pod communication in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Pod Communication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Pod-to-Pod Communication Using ClusterIP Service

You have two pods in the same Kubernetes namespace. Pod A tries to connect to Pod B using a ClusterIP service named service-b on port 8080. What will be the output of the following command run inside Pod A?

curl http://service-b:8080/health
AConnection refused error
BTimeout error after several seconds
CDNS resolution error: service-b not found
DHTTP 200 OK with health status message
Attempts:
2 left
💡 Hint

ClusterIP services provide stable internal IPs and DNS names for pods in the same namespace.

🧠 Conceptual
intermediate
2:00remaining
Understanding Pod-to-Pod Communication Across Namespaces

Which statement correctly describes how pods communicate across different namespaces in Kubernetes?

APods communicate across namespaces by using the full DNS name including the namespace.
BPods cannot communicate across namespaces under any circumstances.
CPods can communicate across namespaces only if a NetworkPolicy allows it.
DPods communicate across namespaces using the service name without specifying the namespace.
Attempts:
2 left
💡 Hint

Think about how Kubernetes DNS resolves service names across namespaces.

Troubleshoot
advanced
2:00remaining
Troubleshooting Pod Communication Failure

Pod A cannot reach Pod B even though both are running and in the same namespace. The service for Pod B is a ClusterIP service. Which of the following is the most likely cause?

APod B is not listening on the port defined in the service.
BPod A is using the external IP of Pod B instead of the service name.
CPod A and Pod B are in different Kubernetes clusters.
DPod B's container image is missing.
Attempts:
2 left
💡 Hint

Check if the service port matches the container port Pod B listens on.

🔀 Workflow
advanced
3:00remaining
Steps to Enable Pod-to-Pod Communication with NetworkPolicy

You want to restrict pod-to-pod communication in a namespace but allow Pod A to communicate with Pod B on port 80. Which sequence of steps correctly achieves this?

A1,2,3,4
B3,2,1,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint

Think about labeling pods before creating policies that select them.

Best Practice
expert
3:00remaining
Best Practice for Secure Pod-to-Pod Communication

Which approach is the best practice to secure pod-to-pod communication in a Kubernetes cluster?

AAllow all traffic between pods and rely on pod security policies.
BUse NetworkPolicies to restrict traffic and enable mutual TLS between pods.
CUse host networking for all pods to simplify communication.
DDisable Kubernetes DNS to prevent pod name resolution.
Attempts:
2 left
💡 Hint

Consider both network restrictions and encryption.