Kubernetes – Ingress Nginx: Replicas and Nodeselector

Replicas

Let’s look at the name and namespace of Ingress‘а:

kubectl get deployments.apps --all-namespaces

Edit our Ingress:

kubectl edit deployments.apps nginx-ingress-controller -n ingress-nginx

And we find the string:

replicas: 1

Set 2 replicas:

replicas: 2

You can save changes and watch the number of Ingress Pods.

 

nodeSelector

We explicitly indicate on which nodes the Ingress should be run. Let’s see the current label:

kubectl get nodes --show-labels

Set the label:

kubectl label node NODE_NAME node-role.kubernetes.io/ingress=true

Edit Ingress again:

kubectl edit deployments.apps nginx-ingress-controller -n ingress-nginx

We are interested in Deployment, namely the block “spec” -> “containers“. Add our “nodeSelector” block to it:

    spec:
      containers:
      nodeSelector:
        node-role.kubernetes.io/ingress: "true"

Tagged: Tags

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments