Skip to content

Conversation

@husseinsa
Copy link
Collaborator

Containers ports should match the target ports in Kubernetes services

@chtrembl
Copy link
Owner

Did this change work with the 3 current Dockerfiles that are exposing 8080?

@husseinsa
Copy link
Collaborator Author

husseinsa commented Feb 13, 2024

the containerPort 8080 in the deployment manifest didnt work for me, I changed the k8 service and added the targetPort: 8080 and then it worked. However, i pushed this change since, the manifest files I've used in the lab no 5 are already refering to containerPort 80. Looking at it now, I don't know how this originally worked https://github.com/chtrembl/azure-cloud/blob/main/petstore/petstoreproductservice/aks-petstoreproductservice.yml since the container port exposed in the docker file is 8080.

I will revert this change and push a new one.

@chtrembl
Copy link
Owner

I am drawing a blank remembering why I set the spring boot apps (3 services) to listen on port 80 vs the default 8080 which the manifest and Dockerfile are referencing. Unless that spring book config isn't getting picked up for some reason. I will have to take a deeper look.

@husseinsa
Copy link
Collaborator Author

husseinsa commented Feb 13, 2024

Modified the service targets ports to match the container ports that were originally specified in the deployment manifests files (8080). This fix is for Lab no. 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants