Hi all,
I would like to set the nodeSelector/toleration to pod which is running. How can I do this?
Thank you.
Hi all,
I would like to set the nodeSelector/toleration to pod which is running. How can I do this?
Thank you.
Hello hlngai,
You have to set them in the POD definition YAML file then delete the running POD and recreate It.
Hello hlngai,
Kindly check the following steps:
Kubectl get pod pod-name -o yaml> new.yml
Kubectl delete -f new.yml
Add nodeSelector/toleration.
check the links:
Taints and Tolerations | Kubernetes
Assigning Pods to Nodes | Kubernetes
For example:
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
env: test
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
nodeSelector:
disktype: ssd
Hope this helps!
hi,
Thx so much for your input.
Does it mean nodeSelector/nodeAffinity can’t be added for running pods?
Since I am testing Kubeflow which the pods of Kubeflow component(a lot of pods) are deployed using kustomize.
And my purpose would like to restrict those pods (Kubeflow components) to specified nodes.
Thanks for you help