• Facebook
  • Twitter
  • Youtube
  • LinedIn
  • RSS
  • Docs
  • Comparisons
  • Blogs
  • Download
  • Contact Us
Download
Show / Hide Table of Contents

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. You can deploy NCache using the Helm chart or YAML files to create the servers and gateway services for cache connections 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 explain how to configure 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.
  • kubectl is installed.
  • If deploying with Helm, Helm 3.14 or later is installed and configured.
  • You have permission to deploy namespace resources and cluster-wide RBAC resources.
  • The NCache container image is accessible, and you have the Enterprise YAML files or access to the selected OCI chart version.
  • 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.0 or later and provide at least two schedulable Linux worker nodes for the default two-server deployment. For Helm, the default setting, deployment.podAntiAffinity=true, places each server on a separate node. If shared-node placement is acceptable, this value can be set to false during 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

Choose the deployment method below after connecting to your cluster. The Helm examples use the ncache namespace; the Enterprise YAML examples use default. Use one method for a deployment so that the same resources are not managed by both Helm and YAML files.

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 config current-context
kubectl get nodes

Confirm that the displayed nodes belong to the intended cluster before installing NCache.

Deploy Using Helm

After confirming cluster access, prepare the chart and install NCache using the following steps.

Step 1: Prepare the NCache Helm Chart

  • Open Google Cloud Shell or a local terminal connected to your cluster. The NCache chart is available directly from the OCI registry.

  • Inspect the defaults for the NCache chart you intend to install:

helm show values oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8

Step 2: 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-helm --version 5.3.8 --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 rollout status statefulset/ncache --namespace ncache
kubectl get pods,jobs --namespace ncache
kubectl get pods --namespace ncache -o wide

After Helm installs the release, NCache completes cache configuration and licensing through a configuration job. Follow Verify an Update to check the job result, then 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 image access:

kubectl describe pod "<pod-name>" --namespace ncache
kubectl logs "<pod-name>" --namespace ncache

Step 3: Verify NCache Services

  • Check the gateway services created by the installed chart:
kubectl get svc --namespace ncache

Check the client endpoint and the configured Service ports. Configure public management access in Step 4:

  • Client connections: gateway.clientPort defaults to 9800.
  • Management: gateway.mgmtPorts defaults to 9801-9802, with session affinity.
  • Additional gateway ports: gateway.ports defaults to 9803-9997.
  • Portal: gateway.portalPorts defaults to 9998-9999, with session affinity.

Step 4: Access NCache Management Center

To access NCache Management Center through a public endpoint, configure gateway.mgmtCenterEndpoint. This value can be supplied during helm install or added afterward using helm upgrade.

If you have already installed NCache, use the following command. Replace <management-public-ip> with a public IPv4 address available through your cluster's load balancer infrastructure:

helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set-string gateway.mgmtCenterEndpoint="<management-public-ip>"

Check the management gateway Service and confirm that its external endpoint has been assigned:

kubectl get svc --namespace ncache

Use the configured endpoint to open NCache Management Center at http://<management-public-ip>:9801 or, when HTTPS is configured, https://<management-public-ip>:9802.

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. Verify the client connection by adding an item to the cache and retrieving it. For subsequent licensing changes, cache configuration updates, and image upgrades, see Manage Deployment.

Deploy Using YAML Files

After confirming cluster access, prepare and apply the server and gateway manifests using the following steps.

Step 1: Prepare the Deployment Files

Obtain the Enterprise Kubernetes YAML files from the NCache GitHub repository, and work from the folder containing ncache.yaml and the platform gateway folders. Use the shared ncache.yaml for the servers and the two gateway files identified below.

  • Use the default namespace for these manifests.
  • In the NCache container's environment variables, set NC_KEY to your deployment key:
- name: NC_KEY
  value: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  • Ensure that the StatefulSet's spec.serviceName is ncache-cacheserver, matching the headless Service in the same file. Add the following field under the StatefulSet's existing spec; retain the other settings:
spec:
  serviceName: ncache-cacheserver
  • Verify that the container image is accessible. If it requires registry credentials, create the ncache-secret image pull Secret in the default namespace; otherwise, remove the imagePullSecrets entry.
  • Keep replicas: 2 for the default two-server deployment and NC_START_DEFAULT_CACHE set to "true". The supplied YAML prefers separate worker nodes but allows both pods to run on the same node. Configure required pod anti-affinity if each server must run on a separate node.
  • If TLS is required, prepare the Secret and environment variables before applying the files, as described in Deploy Using YAML Files.

Retain the Service selectors and pod labels so that the gateways continue to route traffic to the NCache servers.

Use the supplied Kubernetes/client-gatewayservice.yaml and Kubernetes/mgmt-gatewayservice.yaml files for GKE, together with the shared ncache.yaml. Retain the Service names, selectors, ports, and management session affinity.

Google Cloud provides the load balancers for these Services. If a reserved address is required, configure it according to GKE LoadBalancer Services. Configure the required Google Cloud networking and firewall access for the application and administrator networks. The examples below use the gateway files in the Kubernetes folder.

Step 2: Deploy NCache

Apply the server manifest and both gateway manifests from the package root:

kubectl apply --namespace default -f ncache.yaml
kubectl apply --namespace default -f Kubernetes/client-gatewayservice.yaml
kubectl apply --namespace default -f Kubernetes/mgmt-gatewayservice.yaml

Verify the Server Pods

Check that both server pods have started and inspect their worker-node placement:

kubectl rollout status statefulset/ncache --namespace default
kubectl get pods --namespace default -l app=ncache -o wide

The default deployment creates ncache-0 and ncache-1. If a pod fails to start, inspect its events and logs, and check the deployment key, image access, and any certificate settings:

kubectl describe pod "<pod-name>" --namespace default
kubectl logs "<pod-name>" --namespace default

Pod status does not confirm that the caches are ready. Verify cache status in NCache Management Center after opening the management endpoint in Step 4.

Step 3: Verify NCache Services

Check that the headless Service and both gateway Services exist:

kubectl get svc ncache-cacheserver ncache-client-gateway ncache-mgmt-gateway --namespace default

Wait until the gateway endpoints have been assigned, and confirm that they are reachable from the application and administrator networks. The client gateway exposes port 9800. The management gateway exposes ports 9801 and 9802 for Management Center and ports 9998 and 9999 for the portal.

The client gateway also exposes ports 9803-9997. Confirm that the load balancer and firewall configuration permit the ports required by your deployment.

Step 4: Access NCache Management Center

Use the management gateway's assigned external IP address or DNS hostname:

kubectl get svc ncache-mgmt-gateway --namespace default

Open http://<management-gateway-endpoint>:9801 or, when Management Center HTTPS is configured, https://<management-gateway-endpoint>:9802. The endpoint is the value reported in the Service's EXTERNAL-IP column.

In NCache Management Center, verify that the intended cache is running on both server nodes before using it. Follow Configure the External Client to connect an application through the client gateway using ConnectionOptions, then add an item to the cache and retrieve it to verify the connection. For licensing, cache changes, and subsequent updates, follow the YAML tabs in Manage Deployment.

See Also

Evaluation Period Management
NCache License Management

Contact Us

PHONE

+1 214-619-2601   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top