How to deploy a LiveView application Docker image in Kubernetes using Helm

How to deploy a LiveView application Docker image in Kubernetes using Helm

book

Article ID: KB0071620

calendar_today

Updated On:

Products Versions
TIBCO Live Datamart 10.6 and later

Description

This article provides the steps needed to get a LiveView application Docker image deployed into a Kubernetes cluster using Helm charts.

In addition to the guidance provided in this article, you may also refer to the tibco-streaming-samples provided on github:

https://github.com/TIBCOSoftware/tibco-streaming-samples


 

Issue/Introduction

This article describes how to deploy a LiveView application Docker image in a Kubernetes cluster using Helm.

Resolution

1. In your Studio development environment (assumed to be a Windows or Mac machine), create an unrelated StreamBase Application project in Studio, selecting the options to 'Use Kubernetes for container orchestration' and 'Use Helm as packaging type'. This directs Studio to add an additional sub-folder to the project under src/main/helm. 

2. Add your LiveView fragment project as a dependency to your new application project. This is done via the <dependencies> section in the project's pom.xml. For example:
   
<dependencies>
        <dependency>
            <groupId>com.tibco.ldm.sample</groupId>
            <artifactId>lv_sample_helloliveview</artifactId>
            <version>11.0.0</version>
            <type>ep-liveview-fragment</type>
        </dependency>
    </dependencies>

3. Build the docker image:
 
$ cd /path/to/fragment/project/
$ mvn clean install -DskipTests
$ cd /path/to/application/project/
$ mvn clean package -DskipTests

4. If you want to test the deployment of a LiveView application with Helm without going through a Docker registry, you can edit the provided <application_project_name>-app.yaml file under the application project's src/main/helm/<application_project_name>/templates/ folder to load the image from your Kubernetes cluster directly. For example, change..
 
{{- if .Values.dockerRegistry }}
          image: {{ .Values.dockerRegistry }}/hellolv_app:0.0.1-SNAPSHOT
{{- else}}
          image: hellolv_app:0.0.1-SNAPSHOT
{{- end }}

..to:
 
image: hellolv_app:0.0.1-SNAPSHOT
imagePullPolicy: Never

5. In a StreamBase command prompt, navigate to your application project's helm directory and install the package:
 
cd /path/to/application/project/src/main/helm/<application_project_name>/
helm install hellolv .

..where 'hellolv' is the package name that may be selected by the user.

You should now be able to see the pod running in your Kubernetes cluster. For example..
 
$ kubectl get pod
NAME           READY   STATUS    RESTARTS   AGE
hellolvapp-0   1/1     Running   0          3m58s