https://pulumi.com logo
#general
Title
# general
e

echoing-activity-32278

12/29/2021, 10:24 AM
q

quiet-wolf-18467

12/29/2021, 10:49 AM
Code seems fine to me. Can you describe the service and share the output please?
e

echoing-activity-32278

12/29/2021, 10:50 AM
Copy code
kubernetes:core/v1:Service (example-api-qa):
    error: 2 errors occurred:
        * the Kubernetes API server reported that "example/example-api-qa" failed to fully initialize or become live: 'example-api-qa' timed out waiting to be Ready
        * Service does not target any Pods. Selected Pods may not be ready, or field '.spec.selector' may not match labels on any Pods
Reason is that, the statefulset will only be created after the service becomes ready (since the statefulset depends on the service’s name). However, the service depends on the statefulset to become ready, causing a circular dependency. While the doc: https://www.pulumi.com/registry/packages/kubernetes/api-docs/core/v1/service/#:~:text=The%20endpoints%20objects[…]e%20number%20of%20living%20objects says headless service does not depend on the statefulset to become alive, this is not true on AKS.
If I directly refer to the service name instead of through service.metadata.name, https://www.pulumi.com/registry/packages/kubernetes/api-docs/apps/v1/statefulset/#:~:text=web%22%2C%0A%20%20%20%2[…]20%20%20%20%20%20%20%20%20%20app. , then everything is fine.
q

quiet-wolf-18467

12/29/2021, 10:57 AM
Services are always considered “ready” in Kubernetes
If Pulumi is waiting for endpoints, that could be a provoke here. Let me run the example myself and I'll open a bug report if needed. Thanks for bringing to our attention.
🙏 1
f

fast-florist-41572

01/04/2022, 11:22 AM
@quiet-wolf-18467 I believe it is a bug. I'm also provisioning a helm chart that relies on a headless service (ClusterIP: None) and getting the following error
* the Kubernetes API server reported that "default/kratos-courier" failed to fully initialize or become live: 'kratos-courier' timed out waiting to be Ready
* Service does not target any Pods. Selected Pods may not be ready, or field '.spec.selector' may not match labels on any Pods
It assumes that the selectors must be empty but I don't think that is true
q

quiet-wolf-18467

01/04/2022, 11:31 AM
I'm back at work tomorrow and will run some tests on this. We'll fix it if it's broken 😀
f

fast-florist-41572

01/04/2022, 11:31 AM
👍 Enjoy the last time off 🙂
q

quiet-wolf-18467

01/04/2022, 11:34 AM
As a workaround for now, you can add an annotation to your resource to skip the await behaviour
<http://pulumi.com/skipAwait:True|pulumi.com/skipAwait:True>
f

fast-florist-41572

01/04/2022, 1:18 PM
@quiet-wolf-18467 thanks it was actually an error in helm chart I was trying to install https://github.com/ory/k8s/tree/master/helm/charts/kratos They are incorrectly creating the headless service which has a selector but doesn't get assigned an endpoint
2 Views