Pulumi is getting stuck trying to create a headles...
# python
c
Pulumi is getting stuck trying to create a headless Kubernetes service.
Specifically, it sits in "creating..." with "Finding Pods to direct traffic to"
Service code:
Copy code
etcd_service = corev1.Service(
    "etcd",
    metadata={
        "name": "etcd",
        "namespace": base_namespace.metadata["name"],
    },
    spec={
        "clusterIP": "None",
        "ports": [
            {
                "name": "peers",
                "port": 2380,
                "protocol": "TCP",
                "targetPort": 2380,
            },
            {
                "name": "clients",
                "port": 2379,
                "protocol": "TCP",
                "targetPort": 2379,
            },
        ],
        "selector": {
            "component": "etcd",
        },
    },
)
I also tried a literal Python
None
for
"clusterIP"
and got the same result (pretty sure, though, that that's not the right thing to do).
This service is for use by an etcd StatefulSet, which isn't created until after this, so it's never going to find any Pods at this step.
I can always try turning off the await to skip this validation, but the docs seem to say this should work.
Oh, I see. It needs to be headless AND empty (e.g., no
selector
. So I guess I just need to create the StatefulSet first.
I was hoping I could pass
etcd_service.metadata["name"]
to the StatefulSet's spec.ServiceName to DRY this out, but I guess I can't do that.
g
c
Yeah, that looks like the same issue. I don't think it's due to auto-naming, though (mine are not auto-named).
g
Can you update the issue with that info?
c
@clean-engineer-75963 you can use the
skip-await
annottion to get around this