Run an Ubuntu pod interactively, never restart it, and remove it when it exits

kubectl run

  • Run pods in Kubernetes. Specifies pod generator to avoid deprecation error in some K8S versions.
    More information: <>.
  • Trick copyright: tl;dr; <>

kubectl run --generator=run-pod/v1 -it temp-ubuntu --image=ubuntu:20.04 --restart=Never --rm -- /bin/bash

click the source code to copy install kubectl run on any operating system with