Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip wait for Pods on headless Service #2475

Merged
merged 1 commit into from
Jun 27, 2023
Merged

Conversation

lblackstone
Copy link
Member

@lblackstone lblackstone commented Jun 27, 2023

Proposed changes

The await logic for Service resources normally waits for selected Pods to be ready before marking the Service ready. This doesn't work correctly for StatefulSet resources, which use a "headless" Service (i.e., Service without a ClusterIP) to reference its Pods. This led to a circular dependency if the StatefulSet referenced the Service name in the Pulumi program, because the StatefulSet would not be created until after the Service was ready, but the Service was waiting on the StatefulSet to create Pods. This change fixes this dependency by skipping the Pod check for any headless Service, rather than only headless Services that don't have Pods selected.

Related issues (optional)

Fix #1974
Fix #1995
Related #2001

@lblackstone lblackstone requested a review from a team June 27, 2023 20:40
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

The await logic for Service resources normally waits for selected Pods to be ready before marking the Service ready. This doesn't work correctly for StatefulSet resources, which use a "headless" Service (i.e., Service without a ClusterIP) to reference its Pods. This led to a circular dependency if the StatefulSet referenced the Service name in the Pulumi program, because the StatefulSet would not be created until after the Service was ready, but the Service was waiting on the StatefulSet to create Pods. This change fixes this dependency by skipping the Pod check for any headless Service, rather than only headless Services that don't have Pods selected.
@lblackstone lblackstone enabled auto-merge (squash) June 27, 2023 21:34
@lblackstone lblackstone merged commit 0b9739f into master Jun 27, 2023
18 checks passed
@lblackstone lblackstone deleted the lblackstone/headless-svc branch June 27, 2023 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

k8s StatefulSet needs service name override Await logic with Statefulsets doesn't work
2 participants