Tous les labs

Expose and resolve an application

Starter ~18 mink8s

Clients in namespace frontend must reach Deployment api in namespace backend through port 80, while the Pods listen on 8080.

Objectifs
  • Create ClusterIP Service api in backend
  • Map Service port 80 to targetPort 8080
  • Use the cross-namespace DNS name
Étapes suggérées
  1. The Service selector must match app=api.
  2. Cross-namespace short form is api.backend.
  3. Verify EndpointSlices after creation.
Indices
Voir la solution
kubectl expose deployment api -n backend --port=80 --target-port=8080
# From frontend: curl http://api.backend.svc.cluster.local