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:
-
Docker Image Creation
a. Create a ZIETrans project and export it as an ear.
b. Refer to this docker file which deploys a sample ZIETrans application in Liberty server.
c. Build the Image using the docker build command.
docker build -t zietransimage .
-
Helm Chart Deployment
a. 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
b. 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:
| 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: |
Configure the CPU,Memory resources as per the requirement. | Limits: limits CPU:1 |
| StorageClassName | Name of the storage class | hostpath |
c. Install the helm chart using helm install command.
helm install zietrans .
d. The ZIETrans application is deployed and access it using the url:
http://localhost:9080/<zietransapp>
Note: Below are the few use full commands tointeract with the ZIETrans Deployment:
| 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.