I have sharded services, where each one have to have its ordinal. Also, each service consume different amount RAM, for example one - 4Gib, another - 20Gib. I would like to roll out these services on kubernates cluster.
I thought of using Stateful Set, where each service gets its ordinal from pod name. But there is the problem relating to resourse limits. As I wrote above, RAM consumption varies between shards, and as far as I know, high resourse limits may lead to less effective service distribution on nodes by scheduler.
Which solution suits to my problem or is the suggested one acceptable?
Requirements:
- each pod have to get unique number (that may be acquired inside service) starting from 0
- easy to increase shard number; new shard must get a new unique number
- easy to deploy new service changes
- there are dns entries for each pod, where the differences between them are only pod numbers
- possibility to set limits for each pod (this requirement stems from the fact that each shard consumes different amount of RAM)