For the complete documentation index, see llms.txt. This page is also available as Markdown.

Kubernetes

Deploying GridGain Control Center in Kubernetes, covering the backend and frontend containers, services, ConfigMap, and health probes.

Create a Kubernetes Project

A Kubernetes project is a Kubernetes namespace with additional configuration properties and enables a community of users to isolate the GridGain Control Center from other applications and users. Additional information on Kubernetes projects can be found here.

  1. Create a new Kubernetes project:

    kubectl create namespace gridgain-control-center
    kubectl config set-context --current --namespace=gridgain-control-center
  2. Once the project is created, you can perform regular project operations such as kubectl get namespace to view the full list of projects and oc status to view the status of the newly created gridgain-control-center project.

If you deploy your GridGain cluster in Docker, remember to include the control-center-agent optional library to allow it to connect to Control Center. To do this, set the environment variable "OPTION_LIBS=control-center-agent". For more information, see the https://www.gridgain.com/docs/latest/installation-guide/installing-using-docker#enabling-modules

Create the Control Center Backend Container

Create the Control Center backend container. Remember to specify the correct image tag for your version of GridGain Control Center.

Create the Configuration File

Create the backend container configuration file control-center-backend-sts.yaml. See an example below.

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: backend
  namespace: gridgain-control-center
spec:
  replicas: 1
  serviceName: backend
  selector:
    matchLabels:
      app: backend
  template:
    metadata:
      labels:
        app: backend
    spec:
      containers:
        name: backend-container
        image: gridgain/control-center-backend:2024.3
        imagePullPolicy: IfNotPresent
        resources:
          requests:
            ephemeral-storage: "2Gi"
          limits:
            ephemeral-storage: "4Gi"
          ports:
            containerPort: 3000
            protocol: TCP
            name: cc-web
          env:
            name: JVM_OPTS
            value: "-server -Xms1g -Xmx2g -XX:+AlwaysPreTouch -XX:+UseG1GC -XX:+ScavengeBeforeFullGC"
          volumeMounts:
            mountPath: /opt/gridgain-control-center/work
            name: control-center-storage
  volumeClaimTemplates:
    metadata:
      name: control-center-storage
      spec:
        accessModes: [ "ReadWriteOnce" ]
        resources:
          requests:
            storage: 10Gi

Define initContainers in the Configuration File (Optional)

When the persistentVolume is created, its owner is root. The default user inside the GridGain container is different, which may cause a permission issue when the container tries to write to the above persistentVolume. To prevent this from happening, you can define initContainers in your configuration file. See an example below.

Create the Container

Once your configuration file has been created, run the following command to create the container:

Create Control Center Backend Service

Create a Kubernetes service to route network traffic to the Control Center backend. The service will act as a LoadBalancer for the Control Center backend.

Create the backend service configuration file control-center-backend-service.yaml:

Optionally, to introduce a custom ignite-config.xml file:

  1. Add the following to the config map:

  2. Add the ConfigMap name in the volumes section of the StatefulSet:

  3. Mount the config map to a specific path:

For details on mounting files via a config map, see the official Kubernetes documentation.

Run the following command to create the service:

Create a ConfigMap for Control Center Frontend

A ConfigMap is a key-value store that lives as a Kubernetes object. ConfigMaps allow you to modify application behavior without having to recreate the Docker image.

Before creating the Control Center frontend container, you must first create the ConfigMap.

  1. Create the ConfigMap configuration file control-center-frontend-configmap.yaml:

  2. Apply the Control Center backend configmap to the gridgain-control-center project using the following command:

Create the Control Center Frontend Container

After the ConfigMap has been applied to the project, create the Control Center frontend container. Remember to specify the correct image tag for your version of GridGain Control Center.

  1. Create the container configuration file control-center-frontend-deployment.yaml:

  2. Run the following command to create the container:

Create Control Center Frontend Service

Create a Kubernetes service to route network traffic to the Control Center frontend service.

  1. Create the service configuration file control-center-frontend-service.yaml:

  2. Run the following command to create the service which will act as a LoadBalancer for the Control Center frontend service:

Configure Readiness and Liveness Probes

When running Control Center on Kubernetes, configure readiness and liveness probes for both the backend and frontend containers.

Backend Probes

The Control Center backend supports service health checks through the following endpoints:

  • Readiness: /actuator/health/readiness

  • Liveness: /actuator/health/liveness

Add the probes to the backend container spec:

Frontend Probes

For the frontend, a basic HTTP probe against / is typically sufficient:

For more details on configuring probes, see the official Kubernetes documentation.

Set JVM Options

You can additionally set JVM options to improve Control Center performance in high-throughput environments. The example below uses the same configuration as above, but also sets some JVM options:

Expose the Control Center Frontend Service and Get Routes to the Application

  1. Get the deployed Control Center frontend LoadBalancer service IP using the following command:

  2. Finally, access the Control Center frontend UI using one of the returned external IPs.

Create the First Admin Account

If this is your first time launching Control Center, you can create an initial Admin account by using details in the Control Center output. Using the example configurations in this document, the default port of the frontend container will be 8008. The Admin creation URL will look like the following:

Connect a Cluster

When configuring the cluster to connect to Control Center, remember to use the URL to the frontend service with the correct port. In the above examples, the port is 8008. For example:

Next Steps

Last updated

Was this helpful?