I have a legacy Deployment.yaml
that is used by Helm and works fine so far.
containers:
ports:
- containerPort: 3000
This part here was wrongly indended before. So the ports
part of it wasn't active or used in k8s as far as I understand.
So what wonders me now is how the container was running and accessible at port 3000 the whole time? So I looked for another definition describing this port.
I found it in the Dockerfile
EXPOSE 3000
My question is now - do you need to define port.containerPort
in the .yaml configuration or is the container port already implied to be at 3000 through the Dockerfile
's EXPOSE statement?
It feels like k8s knows that this should be the containerport since the Dockerfile describes it.