Binding BusinessWorks Application to Monitoring Application on Kubernetes

You can bind TIBCO BusinessWorks Container edition application.

Prerequisites

  • Ensure that you have configured the database for application monitoring.
  • Ensure that you have created the TIBCO BusinessWorks™ Container Edition base docker image. For more information about creating base docker image, see Creating TIBCO BusinessWorks Container Edition base docker image in the Application Development guide.
  • Ensure that you have created the TIBCO BusinessWorks™ Container Edition application docker image. For more information about building application docker image, see Building the application docker image in the Sample guide.

Procedure

  1. Tag the application docker image by running the following command:
    docker tag <application_image_name> your_docker_container_registry/<your_project_name>/<application_image_name>
    
    
  2. Push your application image to the Docker Container Registry.
    For example: To push your application docker image on Google Cloud Registry, run the following command:
    gcloud docker -- push gcr.io/<your_project_name>/<application_image_name>
    
    
  3. Confirm that the image is present in the Docker Container Registry.
  4. Create the manifest.yml file and update the application image name. Ensure that the image name follows the following format:
    <your_docker_container_registry>/<your_gcloud_project_name>/<image_name>
    
    
    To configure monitoring application with external database, add the following two environment variables to the manifest file and port 80 with monitoring URL.
    • BW_APP_MONITORING_CONFIG
    • BW_JAVA_OPTS

    The below is a sample of the manifest.yml file:

    apiVersion: v1
    kind: Service
    metadata:
      name: <BW_APP_IMAGE_NAME>
      labels:
        app: <BW_APP_IMAGE_NAME>
    spec:
      type: LoadBalancer
      ports:
      - port: 80
        targetPort: 8080
      selector:
        app: <monitoring_image>
    ---
    apiVersion: v1
    kind: ReplicationController
    metadata:
      name: <BW_APP_IMAGE_NAME>
    spec: 
      replicas: 1
      selector:
        app: <BW_APP_IMAGE_NAME>
      template:
        metadata:
          name: <BW_APP_IMAGE_NAME>
          labels:
            app: <BW_APP_IMAGE_NAMEe>
        spec:
          containers:
            - name: <BW_APP_IMAGE_NAME>
            image: gcr.io/<PROJECT_ID>/<BW_APP_IMAGE_NAME>
            resources:
              limits:
                 memory: 512Mi
              requests:
                 memory: 512Mi
            imagePullPolicy: Always
            env:
            - name: BW_PROFILE
              value:default
            - name: BW_LOGLEVEL
              value: DEBUG
            - name: BW_APP_MONITORING_CONFIG
              value: '{"url":"http://<MONITORING_IP>:80"}'
            ports:
              - containerPort: 8080
    Note: To bind your TIBCO BusinessWorks™ Container Edition application to monitoring running on HTTPS server, add the pertaining URL in the BW_APP_MONITORIN_CONFIG property
  5. To create the monitoring service and replication controller, run the following command:
    kubectl create -f manifest.yml
    
    
  6. To verify that the application has started successfully, run the following command:
    kubectl logs pod-name
    
  7. To get the external IP of running monitoring service, run the following command:
    kubectl get svc
    Access the monitoring dashboard in the browser by using the external IP.