Kubernetes version: 1.27.2
Cloud being used: docker-desktop’s kubernetes and AKS (Azure)
Installation method:
Host OS: Mac Os Sonoma 14
Hello, I built a docker image containing an executable linux file (named app). When I launch the container with docker run the executable spins up and everything works fine.
If I pull that same image to my kubernetes cluster (both docker-desktop’s and azure’s) nothing happens and the created POD starts a crashbackoff loop. I put a wait command in the deployment yaml and entered the pod with sh, running sh -x ./app returns /app: 1: Syntax error: ")" unexpected
How can the same executable run in a container, but not in a POD?
It is a native java native image, a linux executable. What is not clear to me is how it works in docker but not in the pod. Does kubernetes interpreter is somehow different?
It could be that the VM doesn’t have the right binfmt modules loaded to run Java directly. Usually one would run it as java <file>, right? It’s been a while since I Java’ed.
sh -x means “run this as a shell script” which is not what you want.
I found the library that was causing the issue, spring cloud kubernetes. Still it’s not clear to me why it works in a container but not in a pod. Anyway, issue solved!