cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to run one ActiveGate pod for each Kubernetes node?

mallikarjuna
Visitor

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?

1 REPLY 1

Romanenkov_Al3x
DynaMight Pro
DynaMight Pro

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.

Romanenkov_Al3x_3-1679172385150.png

 

I successfully tested it :

kubectl edit statefulset.app *-activegate

Romanenkov_Al3x_0-1679171882125.png

 

 

 

        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

Romanenkov_Al3x_1-1679171971447.png

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

DT_NGINX_FORCE_UNKNOWN_VERSION_INSTRUMENTATION=1

Featured Posts