You can start a pod temporarily on specific node for testing by using kubectl command as follows:
kubectl run <name> --image=<image> --overrides='{"apiVersion": "v1", "spec": {"nodeSelector": {"kubernetes.io/hostname": "<hostname>"}}}' --restart=Never
With above command a temporary pod with specified name and image will be started on the node specified. The pod will not start once you delete the pod since restart is specified as "Never".
For e.g. to start nginx pod using nginx image in Oracle container registry on worker1 node, your command will look as follows:
kubectl run nginx --image=container-registry.oracle.com/olcne/nginx:1.17.7 --overrides='{"apiVersion": "v1", "spec": {"nodeSelector": {"kubernetes.io/hostname": "worker1"}}}' --restart=Never
Keywords:
temporarily starting running pod pods test testing without deployment deployments yaml file files pull pulliing particular desired choice
No comments:
Post a Comment