Apache Tomcat is one of the most commonly used web servers and servlet containers for running Java applications. Many enterprises run production Java web applications on Tomcat servers, running on virtual machines and are looking to modernize those applications to run in containers and enjoy the benefits of containerized, cloud native environments such as Google Kubernetes Engine(GKE).
While assessing and containerizing a single Java application to run in a container is possible in a manual process. Identifying, assessing and then containerizing many such applications at scale is time consuming, labor intensive and error prone. Having these obstacles increases the costs of modernizing these apps and slows down the enterprise modernization journey.
Google have recently released a public preview version of our Tomcat modernization flow which enables customers to fully automate the modernization of existing Tomcat Java apps into containers, ready to be deployed on any Kubernetes cluster. In addition, we generate artifacts such as Dockerfiles, Deployment Descriptors, Kubernetes Secrets and Cloud Build configuration to be used in your Day2 operations. With these artifacts, you can fully automate future builds and deployments of your legacy apps using modern CI/CD practices.
The Tomcat apps modernization process is done in 4 steps:
- Assessment – You first run the Fit Assessment Tool which automatically detects running Tomcat instances and the applications deployed on them. You then use the tool to analyze the collected data and generate a report. The report will recommend a migration journey for your workload, according to a set of predefined assessment rules.
- Planning – In this step you create a migration plan for your Tomcat VM. The Migration plan will include all the Tomcat instances that were discovered in the previous step in addition to all the applications and secrets such as keystores, certificates and truststores that are used by the Tomcat instances. You can modify the plan to meet your requirements and add or remove applications or additional files.
- Migrate & Modernize – This is where we process the migration and generate the artifacts according to the migration plan. For each application we will generate a build script, deployment yaml, volumes yaml (if any data volumes were migrated) and cloudbuild yaml, all of which can be used in a CI/CD pipeline.
- Optimize – In this phase you can optimize your Tomcat containers by fine tunning memory settings, apply updates and patches to your application and create automated pipelines for building, deploying and testing your migrated applications.
If you would like to learn more about modernizing legacy Java applications running on Tomcat, please visit Google’s documentation or try it yourself by following the step by step guide on Google’s Github repository.