How to set BusinessEvents Global Variables in a Kubernetes ConfigMap

How to set BusinessEvents Global Variables in a Kubernetes ConfigMap

book

Article ID: KB0072051

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 6.x

Description

In some cases, it may be required to set the values for BusinessEvents Global Variables using a Kubernetes ConfigMap. Refer to the *.yaml configuration shown below for a working example.

Issue/Introduction

Provides a basic example of how to set the values for BusinessEvents Global Variables using a Kubernetes ConfigMap.

Resolution

This example assumes the BusinessEvents project has defined a Global Variable group named 'HTTP', and added a Global Variable under that group, named 'HTTP_PORT'.

gv in project

The default value for 'HTTP/HTTP_PORT' (8108) may be overridden in your Kubernetes deployment *.yaml configuration as follows:
 
 apiVersion: apps/v1 kind: Deployment metadata:   name: "beinferenceagent" spec:   replicas: 1   selector:     matchLabels:       name: "beinferenceagent"   template:     metadata:       labels:         name: "beinferenceagent"     spec:       containers:       - name: "beinferenceagent-container"         image: "fd:6.2.1"         env:         - name: PU           value: "default"         - name: HTTP_gv_HTTP_PORT           valueFrom:             configMapKeyRef:               name: my-configmap               key: http_port         resources:           requests:             memory: 700Mi

Here, we are specifying the Global Variable name in the containers --> env section using the _gv_ separator token, as discussed in the be-tools wiki. The value is set in a separate ConfigMap named 'my-configmap' using the key named 'http_port'.

The Configmap *.yaml configuration is as follows:
 
 apiVersion: apps/v1 kind: Configmap: enabled: true name: my-configmap data:   http_port=8222