kubernetes: Run a pod/deployment by selecting the most recent nodes

9/24/2019

Is there a way to perform a

kubectl run --image=busybox mydeployment sleep 100

but by selecting nodes e.g. that were created after a specific timestamp for example?

-- pkaramol
kubernetes

1 Answer

9/24/2019

In order to select the node, you can edit the json of the created resource using the --overrides flag.

For instance, this creates a pod on the node name:

kubectl run nginx --generator=run-pod/v1 --image=nginx --overrides='{ "spec": { "nodeName": "name" } }'
-- Alassane Ndiaye
Source: StackOverflow