Deploy NCache with Google Kubernetes Engine
Google Kubernetes Engine (GKE) provides a managed Kubernetes environment in which NCache server containers run on Linux worker nodes. The NCache Helm chart configures the server deployment and gateway services required to access the caches and NCache Management Center.
This page explains how to connect to an existing GKE cluster, install NCache, and verify the deployment. The examples use the default two-server configuration and include options for licensing and management access.
Prerequisites
Before you begin, make sure that:
- You have access to an existing GKE cluster, or permission to create one as described below.
- Google Cloud CLI is installed and configured.
kubectlis installed.- Helm with OCI registry support is installed and configured.
- You have permission to deploy namespace resources and the chart’s cluster-wide RBAC resources.
- The selected NCache OCI chart version and container image are accessible.
- You have the required deployment key and, for license activation, the appropriate license key and environment name.
- The cluster can provide networking for the NCache gateway services.
- The cluster must run Kubernetes version
1.25.0or later and provide at least two schedulable Linux worker nodes for the default two-server deployment. The default setting,deployment.podAntiAffinity=true, places each server on a separate node. If shared-node placement is acceptable, this value can be set tofalseduring installation.
Create a GKE Cluster
If you do not already have a GKE cluster, create a Standard cluster through the Google Cloud console. For the complete procedure for a regional cluster, see Create a Regional GKE Cluster.
- Select your Google Cloud project, enable the Kubernetes Engine API, and open Kubernetes Engine.
- Create a Standard cluster and specify its name, region, and release channel.
- Configure a Linux node pool with sufficient resources for NCache. Ensure that at least two worker nodes are available for the default two-server deployment, accounting for the number of nodes provisioned in each selected zone.
- Configure networking and cluster access so that the terminal used for deployment can reach the Kubernetes API, then create the cluster.
- After the cluster is ready, note its name, location, and project ID. Use these values in the following connection procedure.
Deployment Process
Follow the steps below to deploy NCache on an existing GKE cluster.
Step 1: Connect kubectl to GKE
Open Google Cloud Shell or a terminal with the Google Cloud CLI,
kubectl, and the GKE authentication plugin installed. Follow the GKE cluster access instructions for your environment.Get the credentials for the target cluster, replacing the project, cluster, and location placeholders. Use the cluster's region or zone as appropriate:
gcloud container clusters get-credentials "<gke-cluster-name>" --location "<region-or-zone>" --project "<project-id>"
- Verify access to the cluster:
kubectl get nodes
Confirm that the displayed nodes belong to the intended cluster before installing NCache.
Step 2: Prepare the NCache Helm Chart
Open Google Cloud Shell or a local terminal connected to your cluster. The unified OCI chart can be installed directly, so uploading a provider-specific package is no longer required.
Inspect the defaults for the NCache chart you intend to install:
helm show values oci://registry-1.docker.io/alachisoft/ncache --version 1.0.0
Step 3: Install Helm Chart
Run the following command to deploy two NCache servers with defaultCache enabled. Replace xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your deployment key:
helm install ncache oci://registry-1.docker.io/alachisoft/ncache --version 1.0.0 --namespace ncache --create-namespace \
--set-string deployment.key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
--set-string deployment.platform="GKE"
Tip
For guidance on deploying in different scenarios, refer to Manage an Existing Deployment.
Verify the Server Pods
Check the pods and their worker-node placement after installation:
kubectl get pods,jobs -n ncache
kubectl get pods -n ncache -o wide
After Helm installs the release, NCache completes cache configuration and licensing through a configuration job. Check for failed jobs and verify the caches in NCache Management Center before using the deployment.
Verify that all configured NCache server pods are ready; the default deployment contains two. If a pod fails to start, inspect its events and logs using its actual name, and check the deployment key, licensing values, and access to the selected image.
Step 4: Verify NCache Services
- Check the gateway services created by the installed chart:
kubectl get svc -n ncache
Verify that the required endpoints are assigned and reachable:
- Client connections:
gateway.clientPortdefaults to9800. - Management:
gateway.mgmtPortsdefaults to9801-9802, with session affinity. - Additional gateway ports:
gateway.portsdefaults to9803-9997. - Portal:
gateway.portalPortsdefaults to9998-9999, with session affinity.
Step 5: Access NCache Management Center
Use the gateway's external IP address or DNS name to access the NCache Management Center. The default direct-access URLs are http://<management-gateway-endpoint>:9801 and, when HTTPS is configured, https://<management-gateway-endpoint>:9802.
When accessing Management Center through an HTTPS load balancer, use the configured public HTTPS endpoint and forward requests to HTTP port 9801 with sticky sessions enabled. For the NCache Cloud Portal, which uses HTTPS port 9998 and HTTP port 9999, configure the HTTPS load balancer to forward requests to HTTP port 9999 with sticky sessions enabled. These port assignments are described in Firewalls and Ports.
After verifying the deployed caches in NCache Management Center, follow Getting Started to begin using NCache. Applications outside Kubernetes can connect through the client gateway using ConnectionOptions, as described in Configure the External Client. For subsequent licensing changes, cache configuration updates, and image upgrades, see Manage Deployment.