18 Mar 2023 04:17 PM - last edited on 20 Mar 2023 01:12 PM by Ana_Kuzmenchuk
We are deploying ActiveGate as a StatefulSet in a Kubernetes cluster and we want to run one ActiveGate pod on each of the Kubernetes nodes so that we can have the ActiveGate up and running even if some of the Kubernetes nodes go down. But given that theActiveGate pods belong to aStatefulSet and not DaemonSet, are there any ways to deploy them as one for each node?
Solved! Go to Solution.
18 Mar 2023 08:46 PM - edited 18 Mar 2023 08:54 PM
As I know there are no such settings for Operator in DynaKube. I can see only tolerations, annotations.
Maybe others will correct me if I am wrong.
You can simple achieve needed behavior using podAntiAffinity rules.
I successfully tested it :
kubectl edit statefulset.app *-activegate
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/component
operator: In
values:
- activegate
topologyKey: "kubernetes.io/hostname"
kubectl scale statefulset.app *-activegate --replicas=4
I have only three worker nodes, so I get this:
kubectl get pods -o wide -l app.kubernetes.io/component=activegate
And I have event:
Warning FailedScheduling pod/k8s2-activegate-3 0/4 nodes are available: 1 node(s) didn't match pod anti-affinity rules, 1 node(s) had untolerated taint {node-role.kubernetes.io/control-plane:
Hope this helps.
Regards,
Romanenkov Alex