Docker or podman?
Docker or podman?
You have a bunch of options:
kubectl run $NAME --image=$IMAGEthis just creates a pod running the specific image. If you kill the pod, or it terminates, it won’t be run again. In general though, you probably want to do some customization before running (maybe you need volumes, secrets, env, ports, labels, securityContext, etc.) and for that you can simply let kubectl generate the boilerplate YAML and then simply make some edit:
kubectl run $NAME --image=$IMAGE --dry-run=client -o yaml > mypod.yaml # edit mypod.yaml kubectl create -f mypod.yamlYou can do the same with a deployment or statefulset:
In case you don’t need anything fancy, the kubectl create subcommand allows you to create simple workload, so probably that’s the answer to your question.