AIOPS - How to assign a pod to a specific k8s node?
search cancel

AIOPS - How to assign a pod to a specific k8s node?

book

Article ID: 265609

calendar_today

Updated On:

Products

DX Operational Intelligence DX Application Performance Management

Issue/Introduction

How to configure a pod to be created on a specific k8s node

Environment

DX 2x onpremise 

Resolution

Option 1:

a) label the node:

kubectl label nodes <node-name> master=true

example:

kubectl label nodes oi-rhel87-ose1 master=true

b) add label to the deployment under "spec" section as below:

nodeSelector:
   master: "true"

 

Option 2: hardcode the node in the deployment : use below line under the spec section:

nodeName: give the node name

Example from: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/

spec:  nodeName: kube-01

The above Pod will only run on the node kube-01

Additional Information

https://knowledge.broadcom.com/external/article/190815/aiops-troubleshooting-common-issues-and.html