How to expose a Kubernetes-deployed RMS server to external clients using an Ingress Controller

How to expose a Kubernetes-deployed RMS server to external clients using an Ingress Controller

book

Article ID: KB0072897

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 6.1 and later

Description

How can I deploy my RMS server in Kubernetes, and expose WebStudio to clients as a tcp service?
 

Issue/Introduction

Outlines the steps needed to expose a Kubernetes-deployed RMS server to external clients using an Ingress Controller. Examples using Kind Kubernetes and NGINX Ingress are provided.

Environment

Kubernetes Environment

Resolution

To expose your Kubernetes-deployed RMS server to external tcp clients, use an Ingress Controller.

First, deploy (for example) a Kind Kubernetes cluster using a *.yaml file with the following contents:

 
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  kubeadmConfigPatches:
  - |
    kind: InitConfiguration
    nodeRegistration:
      kubeletExtraArgs:
        node-labels: "ingress-ready=true"
  extraPortMappings:
  - containerPort: 80
    hostPort: 80
    protocol: TCP
  - containerPort: 443
    hostPort: 443
    protocol: TCP

To start the Kubernetes cluster, run:
 
$ cat kind-ingress.yaml | kind create cluster --config=-

Next, deploy (for example) a NGINX ingress controller:
 
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml

Then wait for the ingress to initialize:
 
$ kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=90s

(wait for the 'condition met' message)

Next, build your RMS docker image using be-tools. For example:
 
./build_image.sh -i rms -a ~/artifacts/ -s ~/installers/ -t rms --disable-tests

Next, load your docker image into the Kind Kubernetes cluster. For example: 
 
$ kind load docker-image rms:latest

Next, create a *.yaml file to deploy your RMS server. In this *.yaml, add the Ingress controller as shown below:
 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: rms-app-deployment
  labels:
    app: rms
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rms
  template:
    metadata:
      labels:
        app: rms
    spec:
     containers:
      - name: rms-app
        image: rms:latest
        imagePullPolicy: Never
        ports:
        - containerPort: 8090
---
kind: Service
apiVersion: v1
metadata:
  name: rms-service
spec:
  selector:
    app: rms
  ports:
    - port: 8190
      targetPort: 8090
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: rms-ingress
spec:
  rules:
  - http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: rms-service
            port:
              number: 8190
---

Finally, deploy your RMS server:
 
$ kubectl apply -f rms.yaml

External tcp clients should now be able to access WebStudio over port 80.