Containerization builds an OCI image from discovered artifacts and produces a deployment file you can use to deploy in the TKG cluster or any Kubernetes cluster.

Prerequisites

Procedure

  1. Refer the current versions of Tomcat, JRE/JDK and select the desired versions for image.
  2. Select the Source Registry to pull the base image, which can be embedded harbor registry, enterprise harbor registry or docker registry.
  3. Select the Base OS for image.
    By default, VM operating system is populated.
  4. Click Continue.
    Under Web Applications, you see the list of all applications present in the Tomcat Server.
  5. Select the application you want to containerize.
    You can select more than one application. To containerize all applications present in Tomcat, select the check box on the table header.
  6. If you have selected only one application or only a few applications to containerize, you must update the configuration files in the conf and bin directories.
    Note: Ignore this step if you have selected all applications for containerization.
    1. Click DOWNLOAD.
    2. Unzip the directory files.
    3. Update the files according to your requirement.
    4. Zip the directory files that contains the updated configurations.
    5. Click UPLOAD to upload the updated conf or bin directory in the ZIP format.
  7. Click Continue.
  8. Review the docker file and update the file, if required.
    Note:
    • You can change the user and group.
      Arg User=tomcat
      Arg Group=tomcat
    • You can copy the missing directories from the source VM to the image.

      COPY --chown=$USER:$GROUP webapps &CATALINA_HOME/webapps/

  9. Review the default entry point details and update, if required.
  10. Click Continue.
  11. Select the destination registry.
  12. Enter a proper image tag in the <repository>/<image>:<tag> format to push the image and artifacts.
  13. Click Continue.
  14. Review the selections and click CONFIRM to trigger the Build Image task.

Results

  • An alert pops-up showing the status of the operation. Build Image Task can be tracked in the Tasks page. Click on the task within the task bar to view the logs associated with the build process.
  • After successful completion of image build and push, component details are updated with OCI image tag and artifact tag. Artifacts zip can be downloaded and contains all discovered artifacts from the domain and generated template deployment yaml file which needs to be edited to replace FIX-ME details before deploying.

What to do next

Deploy the image in the Tanzu Kubernetes Grid cluster.