What I am presenting here is a simplified version of my setup and the syntax is wrong.
I have a list of high level "agents" that I want to deploy as pods on a kubernetes cluster.
Some nodes in this cluster have special hardware, some don't, but all the pods should use the same container.
Could look like (again: syntax is wrong):
agent1 wlan
...
agent8 wlan
agent9 wlan rs232.1
agent10 wlan rs232.2
I setup a deployment that roughly looks like that (the syntax is wrong):
deployment (standard nodes)
replicas: 8
---
deployment (rs232, terminal 1)
replicas: 1
nodeSelector:
rs232=1
env:
rs232=1 (because nodeSelector can't be passed nicely afaik)
---
deployment (rs232, terminal 2)
replicas: 1
nodeSelector:
rs232=2
env:
rs232=2
I would like each of these agents to start up and take on one identity from the list, while having the matching hardware of course.
So like a pod would talk to a role distribution service like that:
pod - Hi, I'm pod/container-xyz and I have env/label/annotation rs232=2
service - Hi, well then you are now agent10
pod - OK I'll do the work of agent10 then
(service - cool, I'll add agent10 as an alias to you in the cluster DNS) <- that will be my next question
Same thing for agents no with special hardware: the service gives them one agent role each.
I tried something with StatefulSet but that does not fit the bill (because of the various nodeSelector and they are super slow to start).
I started to think about a dedicated self-implemented server pod that would keep my agent list and lease them to matching hardware (a bit like dhcp server) but I'm pretty sure I am not the only one having this problem and there must be a solution out there. I looked quickly at Zookeeper but I don't think it is for me. I am probably not finding the solution because my vocabulary is not the correct one I guess.
Has anybody got a good idea ? Am I going in the right direction ?