How to deploy a war file in a tomcat container pod and expose the service in GKE

Rajathithan Rajasekar
4 min readMar 12, 2023
Photo by Sayan Majhi on Unsplash

In this post, we are going to see how to deploy a java war file inside a tomcat container pod and expose the endpoint as an external load balancer in google Kubernetes engine .

Usually in container microservices CI/CD — we check in the code to a source control repository , which triggers an webhook event and a build software like Jenkins will automatically triggers the pipeline in response to the commit to create jar / war file etc , then the pipeline pushes the build artifacts into an artifacts repository like Nexus, followed by creating the container image through Docker, which then gets stored into a container repository for final deployment as a Kubernetes workload. During this process, we also do additional steps like code quality inspection with tools like Sonarqube and vulnerability assessment of the final built container.

So In this post, we are not going to see any of the above steps.

This post is more on how to do the deployment from your local machine to GKE before a CI/CD pipeline setup is made.

Step:1

Download gcloud SDK and configure it in your local machine. Run the below commands to get authenticated with your credentials.

gcloud auth application-default login…

--

--

Rajathithan Rajasekar

I like to write code in Python . Interested in cloud , dataAnalysis, computerVision, ML and deepLearning. https://rajathithanrajasekar.medium.com/membership