The storefront Pods are healthy but the Service has no endpoints. Find and correct the selector mismatch.
Objectifs
- Inspect labels on Pods
- Inspect the Service selector
- Make the Service select app=storefront
Étapes suggérées
- Use --show-labels.
- Compare spec.selector with the Deployment template labels.
- Patch or re-apply the Service.
Indices
Voir la solution
kubectl patch service storefront -n shop -p '{"spec":{"selector":{"app":"storefront"}}}'
kubectl get endpointslice -n shop -l kubernetes.io/service-name=storefront