0
0
Kubernetesdevops~20 mins

Ingress vs LoadBalancer Service decision in Kubernetes - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Ingress vs LoadBalancer Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
When to use Ingress over LoadBalancer Service?

You have a Kubernetes cluster hosting multiple web applications. You want to expose them externally with a single IP address and route traffic based on URL paths. Which option best explains when to use an Ingress instead of a LoadBalancer Service?

AUse LoadBalancer Service when you want to route traffic based on URL paths.
BUse LoadBalancer Service to expose multiple services under a single IP address.
CUse Ingress when you need a dedicated external IP per service without routing rules.
DUse Ingress when you want to expose multiple services under one IP with path-based routing.
Attempts:
2 left
💡 Hint

Think about how many IP addresses you want to manage and if you need routing rules.

💻 Command Output
intermediate
2:00remaining
Output of kubectl get svc with LoadBalancer type

You run kubectl get svc on a service defined as type LoadBalancer. What output will you see in the EXTERNAL-IP column once the cloud provider assigns an IP?

Kubernetes
kubectl get svc my-service
A
NAME         TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)        AGE
my-service   LoadBalancer   10.0.0.1        <pending>        80:30080/TCP  5m
B
NAME         TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)        AGE
my-service   LoadBalancer   10.0.0.1        34.68.123.45     80:30080/TCP  5m
C
NAME         TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)        AGE
my-service   ClusterIP      10.0.0.1        <none>           80:30080/TCP  5m
D
NAME         TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)        AGE
my-service   NodePort       10.0.0.1        <none>           80:30080/TCP  5m
Attempts:
2 left
💡 Hint

Check the service type and what EXTERNAL-IP shows when assigned.

🔀 Workflow
advanced
3:00remaining
Steps to expose multiple services with one external IP using Ingress

Arrange the steps in the correct order to expose multiple Kubernetes services externally using a single IP with Ingress.

A1,2,3,4
B2,1,3,4
C1,3,2,4
D2,3,1,4
Attempts:
2 left
💡 Hint

Think about creating services first, then the controller, then the rules.

Troubleshoot
advanced
2:00remaining
Why is my LoadBalancer service stuck in <pending> state?

You created a LoadBalancer service in your Kubernetes cluster on a cloud provider, but the EXTERNAL-IP remains <pending> indefinitely. What is the most likely cause?

AThe cloud provider does not support automatic external IP provisioning for LoadBalancer services.
BThe service selector labels do not match any pods.
CThe Ingress controller is not deployed.
DThe service type should be ClusterIP instead of LoadBalancer.
Attempts:
2 left
💡 Hint

Consider cloud provider support for LoadBalancer services.

Best Practice
expert
3:00remaining
Choosing between Ingress and LoadBalancer for cost and scalability

You manage a Kubernetes cluster on a cloud provider with limited IP addresses and want to minimize costs while exposing many services externally. Which approach is best?

ADeploy multiple Ingress controllers, each with its own external IP.
BCreate a LoadBalancer service for each application to isolate traffic and IPs.
CUse one Ingress controller with multiple Ingress resources to share a single external IP.
DUse NodePort services and expose nodes directly to save IPs.
Attempts:
2 left
💡 Hint

Think about IP address usage and cost efficiency.