Sample Kubernetes YAML File for Deploying an Application

Sample Kubernetes YAML file for deploying an application is at amsgce-runtime-<version>/samples/kubernetes/amxce_k8s_template.yaml.

In the YAML file, update the application name (<app-name>), application Docker image name (<image-name>), and other placeholders as per your application.

In this file,

To enable monitoring by using Hawk Container Edition, uncomment the following environment variables from sample YAML file :

Note: In ActiveMatrix Service Grid - Container Edition, instead of running one TIBCO AMSGCE node with more hardware (CPU, memory) capacity, TIBCO recommends to use horizontal scaling and use load balancer with it. For example, instead of running one node with 16 CPU cores and 32 GB RAM, run 4 TIBCO AMSGCE containers, each having 4 CPUs and use load balancer with it.

Kubernetes Rolling Update

To achieve high availability of applications, you can perform a rolling update. Rolling update is a feature of Kubernetes in which you can update deployments with zero downtime. Pods instances are incrementally replaced with new ones. New pods instances are then scheduled on nodes with available resources. For more information about rolling updates, see Kubernetes documentation.

Using Kubernetes Services to Access an Application in a Cluster

In Kubernetes, TIBCO ActiveMatrix applications run as pods. Pods communicate with each other by using services. Therefore, you must use Kubernetes services to connect two dependent applications.

For example, consider Hello World2 application provided at <TIBCO_HOME>/amx/<version>/samples/java/helloworld2.zip. For more information about this sample Hello World2 application, see TIBCO ActiveMatrix Service Grid documentation.

In Kubernetes to run this application, you must set up a service for connecting to Date Manager application. This service must be used as host in the HTTP client resource of the helloworld2 application configuration YAML file. helloworld2 application uses this service to connect to datemanager application. Both helloworld2 and datemanager applications must run in the same namespace.

Sample helloworld2 application configuration YAML file:

resources:
  httpClients:
  - name: HttpClient_DateManagerSOAP
    description: This is updated using Application Configurator (1.0.0)
    host: datemanager-service
    port: '9097'

Sample Kubernetes deployment file for Date Manager application:

apiVersion: v1
kind: Service
metadata:
    name: datemanager-service
    namespace: enhanced-helloworld
spec:
    type: LoadBalancer
    externalIPs:
    - 10.107.174.117
    ports:
    - port: 9097
      targetPort: 9097
      name: appport
    - port: 9998
      targetPort: 9998
      name: monitoringapplicationport
    selector:
        app: datemanager