Disclaimer: I'm not experienced with Pulumi. I ha...
# general
g
Disclaimer: I'm not experienced with Pulumi. I have a problem setting up a Kubernetes
Service
for a
Statefulset
- postgresql to be more specific.
Statefulset
is created and pods appear as expected and based from logs etc everything is just fine including volume bindings etc. This is also true from Pulumi side when running
pulumi up
to an empty cluster.
Service
creation hangs up however and it finally gives up with the following error:
Copy code
kubernetes:core/v1:Service (postgres):
    error: 2 errors occurred:
        * the Kubernetes API server reported that "default/postgres" failed to fully initialize or become live: 'postgres' 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
I am however absolutely certain that yes, there are specified nodes available and also that those pods are indeed running. I've been banging my head against the wall with this problem for some time now and would appreciate ideas. As an interesting detail if running
pulumi up
again also the
Statefulset
update seems to hang. I'll provide code snippets regarding this issue to a thread under this message.
Code snippet regarding my postgres setup into K8s
I feel like I'm missing something obvious and when I see it I'm going to bang my head to a wall
I'm not trying to change into
Deployment
instead of
Statefulset
and changed my
PersistentVolumeClaim
to
ReadWriteMany
to allow using deployments. Also changed my
Service
to
NodePort
. Let's see if this has any effect on this...
It shouldn't. If it does help then I'd say this is a bug in Pulumi. But right now I would be thinking it's more about an issue in my code 🙂
Eh... Wat. It tries to say "replace" for the statefulset even though it is not there anymore. Did
pulumi refresh
. It's not in the code or at the cluster at this point but apparently it is in Pulumi state
Right, had to go back to
StatefulSet
, but again it gets stuck
Or not that one but the Service
Oh god... Found it. I had forgotten to add namespace to my Service declaration... No wonder it didn't find any pods 😂
Like I guessed, this was something very stupid. Sorry to bother you!