I think there is no problem with Ubuntu, just that it runs something and stops, so it is restarted. See this part of what you pasted:
Exit Code: 0
That is, the container exit status was 0 (no error) and the reason is it run until completion (i.e. no problem).
Let me explain why this happens in this case.
The idea of a deployment is that is something that needs to be running constantly, like a web server. When you run the nginx image, the nginx process is started and the container is alive as long as that process is alive. If thar process stops running, the container is not alive anymore.
In the case of a deployment, as the assumption is that the containers should be running all the time, they are restarted time after time. After some time, an exponential back off is used to restart it more spaced in time.
I think that is what you are seeing. If, for example, you try to add in the kubernetes yaml a command for the Ubuntu container, that will run for a long time, the container will be running just fine.
For example, you can add something like:
command: [ “sleep”, 30m" ]
And the Ubuntu container will run fine for 30 mins.
Of course, when you run your application this won’t be a problem because you will be starting your application