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.
Create a new Kubernetes project:
kubectl create namespace gridgain-control-center kubectl config set-context --current --namespace=gridgain-control-centerOnce the project is created, you can perform regular project operations such as
kubectl get namespaceto view the full list of projects andoc statusto view the status of the newly createdgridgain-control-centerproject.
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: 10GiDefine 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:
Add the following to the config map:
Add the ConfigMap name in the
volumessection of the StatefulSet:Mount the config map to a specific path:
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.
Create the ConfigMap configuration file
control-center-frontend-configmap.yaml:Apply the Control Center backend configmap to the
gridgain-control-centerproject 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.
Create the container configuration file
control-center-frontend-deployment.yaml: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.
Create the service configuration file
control-center-frontend-service.yaml: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/readinessLiveness:
/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
Get the deployed Control Center frontend LoadBalancer service IP using the following command:
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
Change Configuration Parameters - make sure you optimize the disk space utilization
Connect a GridGain or Apache Ignite Cluster
Last updated
Was this helpful?

