Question 280
A Kubernetes administrator recommends: Apply a suitable topologySpreadConstraint or required Pod anti-affinity using hostname as topology key. Which situation most directly calls for that operation?
Explanation
Correct Answer
This is the original issue addressed by Pod anti-affinity spread: The scheduler spreads matching replicas across eligible nodes rather than concentrating failure risk.
Incorrect Answers
That separate problem requires another operation: Use kubectl set image deployment/api api=registry.example/api:v2 and watch kubectl rollout status. The Deployment controller gradually replaces old replicas while checking the progress of the rollout.
That separate problem requires another operation: Create a Secret with the certificate and key and mount it as a read-only volume at /etc/tls. The container reads controlled certificate files at runtime rather than baking private key material into the image.
That separate problem requires another operation: Add a readinessProbe that reports success only when the application's dependency initialization is complete. Service traffic is withheld from not-yet-ready endpoints while the container finishes initialization.