Does kubectl exec bypass the container's defined entrypoint?

9/19/2018

I have an entrypoint defined in my container image, and it runs before the args specified in my deployment manifest, as it should. But when I execute a command on that container using kubectl exec, it seems to bypass the container entrypoint. Is this the expected behavior? Can I somehow force it to always use the entrypoint commands?

-- Daiku
kubernetes

1 Answer

9/20/2018

That's expected. If you really want what's in the entrypoint.sh you can do something like this:

kubectl exec -it <pod-name> -c <container-name> /path/to/entrypoint.sh

Hope it helps!

-- Rico
Source: StackOverflow