Is there a way to deploy statefulset first in a cluster?

3/22/2020

Is there a way to make a kubernetes cluster to deploy first the statefulset and then all other deployments? I'm working in GKE and I have a Redis pod which I want to get up and ready first because the other deployments depend on the connection to it.

-- Milen Tsvetkov
google-kubernetes-engine
kubernetes

1 Answer

3/22/2020

You can use initcontainer in other deployments.Because init containers run to completion before any app containers start, init containers offer a mechanism to block or delay app container startup until a set of preconditions are met. The init container can have a script which perform a readiness probe of the redis pods.

-- Arghya Sadhu
Source: StackOverflow