I want to run a "set" of containers in kubernetes, each which only differs in the docker environment variables (each one searches it's own dataset, which is located on network storage, then cached into the container's ram). For example:
- container 1 -> Dataset 1
- container 2 -> Dataset 2
Over time, I'll want to add (and sometimes remove) containers from this "set", but don't want to restart ALL of the containers when doing so.
From my (naive) knowledge of kubernetes, the only way I can see to do this is:
- Each container could be its own deployment -- However there are thousands of containers, so would be a pain to modify and manage.
So my questions are:
Can I use a StatefulSet to manage this?
1.1. When a StatefulSet is "updated", must it restart all pods, even if their "spec" is unchanged? 1.2 Do StatefulSets allow for each unique container/pod to have its own environment variable(s)?
- Is there any kubernetes concept to "group" deployments into some logical unit?
- Any other thoughts about how to implement this in kubernetes?
- Would docker swarm (or another container management platform) be better suited to my use case?