In the kubernetes environment, we can keep a container(pod) alive and avoid it exits immediately after starting.
Method one
1.
Use a long-time-run command in Dockerfile
CMD ["sh", "-c", "tail -f /dev/null"]
or
CMD ["sh", "-c", "sleep infinity"]
2.
Build the docker image and push to docker repository