Getting Started with GigaSpaces in Kubernetes Using Helm Charts Only

This topic describes how to deploy GigaSpaces products in a Kubernetes environment. The integration is packaged as a Helm chart. You can deploy the full InsightEdge Platform, which includes the data grid, using the Helm chart available in the GigaSpaces Helm repository.

Prerequisites

The topics in this section assume basic knowledge of InsightEdge and the data grid. If you aren't familiar with the data grid (at minimum), review the contents of the general Getting Started section before performing the tasks described here.

Before beginning to work with the Space and InsightEdge, ensure that you have the following installed on your local machine or a VM:

This topic describes how to do basic and intermediate-level deployment tasks for the Space and InsightEdge using simple Helm commands. You can perform these tasks using a Kubernetes minikube, because you only need a single node.

Configuring the Space for InsightEdge involves the same tasks as configuring for data grid. The deployment and maintenance tasks described below use InsightEdge Helm charts commands. However, you can also perform these tasks using the xap Helm charts commands.

 

Deploying and Managing a Space

In this topic, you will learn how to do the following:

  • Get the required GigaSpaces Helm charts
  • Start a Space in Kubernetes
  • Monitor your Space using Kubernetes tools
  • Delete your Space

Accessing the GigaSpaces Helm Charts

The Helm package manager is used for installing InsightEdge and GigaSpaces in the Kubernetes environment. Helm makes deploying complex applications more portable, supports automatic rollbacks, and is a familiar pattern for developers that is easy to understand. Moreover, since Helm is open source, there are many community charts available with standard configurations for common application services.

A Helm chart can be used in a variety of formats and locations; packaged, unpackaged, accessed via a remote URL or even in a chart repository. The xap, insightedge, smart-cache, smart-ods and smart-augmented-transactions Helm charts are published in the GigaSpaces Helm charts repository at https://resources.gigaspaces.com/helm-charts.

Two ways to access and install these charts, in order to install a GigaSpaces product in Kubernetes, are discussed below:

  • Option 1: Install a chart directly from the repo and add the GigaSpaces Helm chart repo to the Helm repo list.
  • Option 2: Unpack the required Helm chart(s) in a local folder.

Option 1: Add a Helm Repo to the Repo List

You can point to the GigaSpaces Helm repo, so that Helm can locate the xap and insightedge charts for installation:

helm repo add gigaspaces https://resources.gigaspaces.com/helm-charts

After adding the GigaSpaces Helm repo, you can install the required chart(s) by referencing the chart name and product package version. For example, to install InsightEdge, use the command shown below.

If you're using minikube, note that the default kubernetes services created by GigaSpaces uses LoadBalancer, which requires running 'minikube tunnel' in the background. For more information see minikube tunnel.

helm install demo gigaspaces/insightedge --version=15.8.0

helm install gigaspaces/insightedge --version=15.8.0 --name demo

Option 2: Fetch the GigaSpaces Helm Charts from the GigaSpaces Repository

Another option is to fetch the GigaSpaces Helm charts that you need and unpack them locally, so you don’t have to repeat the repo name and package version in each command (which has the added benefit of making the commands shorter). For example, if you fetch (Helm 2) or pull (Helm 3) and unpack the Helm chart using the following command:

helm pull gigaspaces/insightedge --version=15.8.0 --untar

helm fetch gigaspaces/insightedge --version=15.8.0 --untar

You must fetch every chart that you will be using (for example xap, xap-pu and xap-manager) in your GigaSpaces application environment.

The chart is unpacked in a local folder called insightedge, which is referenced in the Helm commands.

Starting a Space in Kubernetes

The following examples assume that you used Option 2: Fetch the GigaSpaces Helm Charts from the GigaSpaces Repository above to install the Helm chart. These examples are for the insightedge Helm chart, but the identical syntax can be used for xap charts.

In the directory where you unpacked the Helm chart(s), run the following Helm command in the command window to start a Space in Kubernetes. This deploys a Kubernetes cluster called demo, which contains a data grid comprised of one Space in a Data Pod, and one Platform Manager called demo-xap-manager in a Management Pod. The Platform Manager manages the Space, the Manager service, and the headless service. In addition, an Operator pod is created for Kubernetes Operator commands. There are no backup instances specified.

To start an InsightEdge Space:

helm install demo insightedge

helm install insightedge --name demo

Monitoring the Space in Kubernetes

You can monitor the demo cluster you deployed using any of the following administration tools.

  • Helm: Run the following command to print the status of the "demo' release in the command window.
helm status demo
  • Kubernetes dashboard: run the following command to open a dashboard in your browser, where you can see all the Pods and services by clicking the various tabs. For example, if you're using minikube:
minikube dashboard
  • Kubectl: run the following command to print the name, description, and status of the Pods in the command window. A list of events is also printed, which can be used for troubleshooting purposes. For example, if you detected a problem in one of the Pods, you can see the Pod termination reason and exit code.
kubectl describe pod

Deleting a Space from the Kubernetes Environment

To delete the demo Space cluster, use the del Helm command. This command will remove both the Platform Manager and the Space.

To remove the release and delete all the demo release data from the server, use the following command:

helm del demo

helm del demo --purge

To remove the release, but leave the logs and data so you can inspect them at a future time, use the following command:

helm del demo --keep-history

helm del demo

Deploying Multiple Spaces on Kubernetes

If you want to deploy multiple Spaces in the same Kubernetes environment, to better utilize resources it is best to deploy one Platform Manager cluster and then configure the Spaces to use this cluster, instead of deploying each Space with its own Platform Manager.

To enable users to customize the installation, we provide several additional Helm charts that can be used to define specific constellations in more advanced scenarios:

  • Manager (insightedge-manager or xap-manager, smart-cache-manager, smart-ods-manager, smart-augmented-transactions-manager)
  • Processing Unit (insightedge-pu or xap-pu), smart-cache-pu, smart-ods-pu, smart-augmented-transactions-pu)
  • Apache Zeppelin (insightedge-zeppelin)

Before using these charts for the first time, you must fetch the charts as described in Getting Started section.

Deploying the Platform Manager

The helm command by default creates a Management Pod and a Data Pod together. When deploying a Platform Manager that will connect to multiple Spaces, you have to disable the part of the command that creates the Data Pod. Type the following Helm command to create a Management Pod called testmanager without the accompanying Space:

helm install testmanager insightedge-manager 

helm install insightedge-manager --name testmanager

Deploying Spaces

After the Management Pod has been deployed and the Platform Manager is available, you can deploy the Space instances and connect them to the Platform Manager.

There are two methods available to deploy a space: using GigaSpaces Tools (recommended method), or using Helm Charts.

Kubernetes Operator is installed by default, and is the recommended method for deploying a Space. If you use Helm Charts, Scale Out/In is not available using the Ops Manager or the Command Line Interface.

Deploy a Space using GigaSpaces Tools

See GigaSpaces Ops Manager or Command Line Interface (CLI) for information on creating a Space object.

Deploy a Space using Helm Charts

Use the following Helm command to deploy a cluster of Data Pods called testspace, and to specify that the cluster should connect to the testmanager Management Pod:

helm install testspace insightedge-pu --set manager.name=testmanager

helm install insightedge-pu --name testspace --set manager.name=testmanager

 

Applying a Product License

The Kubernetes installation comes with a 24-hour trial tryme license, to enable users to perform one-click installation and explore the InsightEdge Platform and GigaSpaces functionality. However, if you want a longer trial license, you can apply the evaluation license key that you received in the email that was sent to you after you downloaded your InsightEdge or GigaSpaces commercial edition from the Download Center. These instructions are also applicable for applying a your official product license after you purchase a GigaSpaces product.

When the Space starts, it checks for a valid license. You can apply the license by setting the pu.license property. For example, to apply the license for InsightEdge, use the following Helm command:

helm install demo insightedge --set pu.license="<your license key>"

helm install insightedge --name demo --set pu.license="<your license key>"

  • You must enclose the license key in quotation marks ("...").
  • If you install a Processing Unit using the insightedge-pu chart or xap-pu chart, use the syntax --set license="<your license key>".