Sounds like a bug: <https://www.pulumi.com/registr...
# general
e
q
Code seems fine to me. Can you describe the service and share the output please?
e
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
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
@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
I'm back at work tomorrow and will run some tests on this. We'll fix it if it's broken 😀
f
👍 Enjoy the last time off 🙂
q
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
@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