Deploying using Docker Desktop by enabling Kubernetes

Prerequisites

Install helm and enable the Kubernetes engine in the Docker Desktop.

Note:
This example is only for the demonstration purpose.

Follow below steps to deploy the ZIETrans application in Kubernetes:

  1. Docker Image Creation
    1. Create a ZIETrans project and export it as an ear.
    2. Refer to this docker file which deploys a sample ZIETrans application in Liberty server.
    3. c. Build the Image using the docker build command.
      docker build -t zietransimage .
  2. Helm Chart Deployment
    1. Create the helm chart by using below helm create command and modify acccording to your requirement or download the sample chart from here
      helm create zietrans
    2. Navigate to the downloaded helm chart using file explorer and modify the chart according to your requirement. In values.yaml, add the Docker image.

      Configuration:

      Table 1.
      Parameter Description Default
      image.repository ZIETrans docker image name zietransimage
      image.imageTag Docker image tag latest
      image.pullpolicy Kubernetes imagePullPolicy value IfNotPresent
      serviceType Type of the service LoadBalancer
      servicePort Port number to be exposed 9080
      replicas Kubernetes replica count 1
      Resources

      Limits:
                                                  CPU:
                                                  Memory:

      Configure the CPU,Memory resources as per the requirement. Limits: limits

      CPU:1
                                                  Memory:512Mi

      StorageClassName Name of the storage class hostpath
    3. Install the helm chart using helm install command.
      helm install zietrans .
    4. The ZIETrans application is deployed and access it using the url:
      http://localhost:9080/<zietransapp>
      Note:
      Below are the few use full commands to interact with the ZIETrans Deployment
      Table 2.
      Action Command
      To list the releases that are deployed or failed helm ls
      To get all the information about deployment kubectl get all
      To get the pod details kubectl get pod
      To get the Services details kubectl get svc
      To get the Persistent Volume details Kubectl get pvc, Kubectl get pv

    For more information on Kubernertes commands, refer to Kubernetes Cheat Sheet and for Helm commands, refer to Helm Commands.