Bird
0
0

To expose a backend service only within the cluster using a fixed internal IP, which YAML configuration is correct?

hard📝 Workflow Q8 of 15
Kubernetes - Services
To expose a backend service only within the cluster using a fixed internal IP, which YAML configuration is correct?
ASet <code>spec.type: LoadBalancer</code> with <code>spec.externalIPs: ["10.0.0.100"]</code>
BSet <code>spec.type: ClusterIP</code> and specify <code>spec.clusterIP: 10.0.0.100</code>
CSet <code>spec.type: NodePort</code> and assign <code>spec.clusterIP: 10.0.0.100</code>
DSet <code>spec.type: ExternalName</code> with <code>spec.clusterIP: 10.0.0.100</code>
Step-by-Step Solution
Solution:
  1. Step 1: Fixed internal IP

    Assigning spec.clusterIP sets a fixed internal IP for the service.
  2. Step 2: Service type ClusterIP

    Using spec.type: ClusterIP restricts exposure to inside the cluster.
  3. Step 3: Eliminate other options

    LoadBalancer and NodePort expose externally; ExternalName is for DNS mapping.
  4. Final Answer:

    Set spec.type: ClusterIP and specify spec.clusterIP: 10.0.0.100 -> Option B
  5. Quick Check:

    ClusterIP + clusterIP field fixes internal IP [OK]
Quick Trick: Use spec.type ClusterIP and clusterIP for fixed internal IP [OK]
Common Mistakes:
  • Using LoadBalancer for internal-only exposure
  • Assigning clusterIP with NodePort or ExternalName
  • Confusing externalIPs with clusterIP

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes