required a dedicated node on kubernetes cluster

1/9/2020

i need to isolate dedicated node for monitoring on our Kubernetes cluster anybody know what is the best practise for that?so that it is not impacted by auto scaling

-- hatem
kubernetes
nodes

1 Answer

1/9/2020

Yes this can be achieved, that's where Labels and Selectors come in handy.

You can label your nodes with key/value pairs, in-order to isolate your nodes based on behaviour of your application, Node isoloation/restriction.

There are several ways one can label their nodes. But this the common and simplest example.

kubectl label nodes <node-name> <label-key>=<label-value>

Eg: kubectl label nodes k8-node-101 instance-type=monitoring

And in your deployment make sure you add the nodeSelector, something like this.

apiVersion: v1
kind: Pod
metadata:
  name: monitoring-pod
spec:
  containers:
    - name: mon-test
      image: "cr.mycompany.io/monitoring:v0.1"
  nodeSelector:
    instance-type: monitoring

This is one example on how you can isolate your node for specific needs or specific project purposes.

Hope this helps.

-- BinaryMonster
Source: StackOverflow