Deployment of TIBCO® Order Management On Kubernetes
You can containerize the TIBCO® Order Management application in Docker and then deploy it on the Kubernetes cluster. To containerize the application, you must build and run the Docker images by using the bundled Dockerfile. The deployment uses Kubernetes concepts such as, deployment, pod, kubectl, Kubernetes service. For more details, see Kubernetes Documentation.
Building Docker Images
Preparation for the deployment starts with building Docker images using the Dockerfile. The $OM_HOME/docker directory contains subdirectories with the ready-to-use Dockerfile and other scripts required to build the images. Detailed instructions on how to use the Dockerfile and build the image are provided in the respective Dockerfile and the Readme located at the same location. See the "Docker" section in the TIBCO® Order Management Administration guide for more details.
Deployment on Kubernetes
After creating the Docker files, you must push them in the Docker registry so that they can be accessed by Kubernetes deployment. Kubernetes scripts are available at the $OM_HOME/kubernetes directory.
Prerequisites
- Copying dependency: See Task 1: Copying Dependencies for more details.
- Creating the database: See Task 2: Creating the Database for more details.
- TIBCO EMS service channel creation: See Task 3: Creating or Upgrading the TIBCO Enterprise Message Service Channel for more details.
- Configuring the installation: See Task 10: Configuring minimum requirements through Configurator UI for more details.
Example
The following example includes a snippet of the kubernetes-deploy-run-catalog-service.yml file:
apiVersion: apps/v1 kind: Deployment metadata: name: catalog-service labels: app: catalog-service spec: replicas: 1 selector: matchLabels: app: catalog-service template: metadata: name: catalog-service labels: app: catalog-service spec: containers: - name: catalog-service image: tibco/catalog-service:6.1.0 ports: - containerPort: 9092 readinessProbe: failureThreshold: 3 httpGet:path: /management/health/readiness port: 9092 scheme: HTTP periodSeconds: 300 successThreshold: 1 timeoutSeconds: 3 livenessProbe: failureThreshold: 3 httpGet: path: /management/health/liveness port: 9092 scheme: HTTP periodSeconds: 300 successThreshold: 1 timeoutSeconds: 3 env: - name: min_ram_percentage value: "25.0" - name: max_ram_percentage value: "100.0" resources: limits: cpu: '1' memory: 4Gi requests: cpu: '0.1' memory: 1Gi --- apiVersion: v1 kind: Service metadata: name: catalog-service-service spec: selector: app: catalog-service ports: - port: 9092 targetPort: 9092 nodePort: 30004 type: LoadBalancer
Procedure
-
Run the following command on the worker node (in master-worker Kubernetes cluster setup) to create TIBCO® Order Management Catalog deployment and service:
CMD>kubectl apply -f D:/Folder_Path/kubernetes-deploy-run-catalog-service.yml
The
deployment.apps/catalog-service
andservice/catalog-service
folders are created. -
To check the container status, run the following commands:
-
kubectl get all
-
kubectl get pods
Note: TheRunning
status indicates that a container is running without any issues. -
To check logs inside the container, run the following command:
CMD>kubectl exec -it Podname -- bash
Example:
kubectl exec -it catalog-service-755fb5f69c-jch2s -- bash
When the catalog pod is up and running, users can access the Swagger-UI by accessing endpoints exposed for the service.
Example:
http://EXTERNAL-IP:9092/swagger-ui.html
-
To delete deployment and service, run the following command:
CMD> kubectl delete -f D:/Folder_Path /kubernetes-deploy-run-catalog-service.yml
The
deployment.apps "catalog-service"
andservice "catalog-service"
folders are deleted.Note: Similar steps are applicable for all services.