Is it possible to make pods of a StatefulSet to run different app images in Kubernetes?

2/15/2020

I want to create a StatefulSet where I want my first pod(i.e. ordeal index-0)to behave as a router(routing-app) for the pods starting with ordeal index 1(serving-app).

I am new to Kubernetes StatefulSets, and still trying to figure out their usage in real world applications.Please let me know, if am trying out something that I should not do from the design perspective or should I try something else to accomplish my requirement. Thanks, J

-- Jaraws
kubernetes
kubernetes-deployment
kubernetes-pod
kubernetes-statefulset

1 Answer

2/15/2020

You cannot have two pods of same statefulsets running different images. It is possible to run two different images in one pod and it will be same for all the pods of your statefulset. You need to create two different statefulsets or your application which requires persistence as statefulset and other as deployment. Refer the documentation https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#limitations for more information.

-- anmol agrawal
Source: StackOverflow