Manage an Existing Deployment
After deploying NCache, you can change server capacity, manage licensing and caches, and update gateway, TLS, and image settings. The procedure depends on whether the servers were deployed through Helm or YAML files. Select the matching tab for each task and retain the platform settings used during installation.
Run the commands from a terminal connected to the intended cluster. The Helm examples use ncache for the release name and namespace; the Enterprise YAML examples use the ncache StatefulSet in the default namespace.
For Helm deployments, image changes are upgrades and other supported changes are configuration updates. Both use helm upgrade. Configuration updates can be combined, but changes to any image setting must run separately from other categories, including changes to pull settings, upgrade mode, or timing. The examples use --reuse-values to retain settings that are not being changed.
For YAML deployments, edit the source manifests and apply Kubernetes resource changes with kubectl apply. Manage cache configuration through NCache Management Center. Use the same deployment method for subsequent operations; applying YAML files to resources managed by Helm can leave the two configurations inconsistent.
Prepare for YAML Pod Replacements
Changes to a container image or environment variable take effect when server pods are replaced. Before applying such a change to an existing YAML deployment, back up required configuration and data, and set the StatefulSet's update strategy to OnDelete in ncache.yaml. This allows you to verify each server's caches before replacing the next server:
spec:
updateStrategy:
type: OnDelete
Merge this setting into the existing StatefulSet spec, retaining its other fields. With this strategy, applying a changed pod template does not replace running pods automatically. Follow Replace YAML Server Pods after applying an image, licensing, or TLS change that requires new pods.
Scale the Cluster
The number of NCache servers is specified through deployment.servers, which defaults to 2. You can increase or decrease this value after installation using helm upgrade. For example, the following command increases a two-server deployment to three server pods:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set deployment.servers=3
Ensure that the cluster has sufficient resources for the additional servers. When deployment.podAntiAffinity is true, each server pod requires a separate worker node.
To reduce a three-server deployment to two server pods, use the following command:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set deployment.servers=2
Servers are removed one at a time, starting with the highest-numbered pod. The deployment waits for the caches to synchronize between removals. Ensure that the remaining servers have sufficient capacity for the caches and application workload.
Within the deployment group, you can update deployment.key and change deployment.servers. Changes to the deployment name, platform, or pod anti-affinity require redeployment. TLS settings can be changed through Helm, as described in Update TLS Settings. NCache configuration changes that require an NCache service restart are not supported as updates.
Extend the Evaluation Period
The deployment key is registered when each server starts. After support approves an evaluation extension, update the stored key if a different key was supplied:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set-string deployment.key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
If the previous operation was an offline image upgrade, first return the deployment to rolling mode in a separate Helm operation:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set image.upgrade=rolling
Once the operation has completed, restart the servers to register the key. This restart is also required when support extends the evaluation associated with the existing key, because reapplying that key through helm upgrade does not restart or re-register running servers.
kubectl rollout restart statefulset/ncache --namespace ncache
kubectl rollout status statefulset/ncache --namespace ncache
The restart replaces servers one at a time. Data availability depends on the cache topology and healthy remaining replicas; do not assume data preservation for a single-server or non-replicated cache. An image using a mutable tag such as latest can also pull a different image during restart, so use a fixed image version when the restart must retain the installed version. Replace ncache in statefulset/ncache if you installed with a different deployment.name. Verify the updated evaluation period in NCache Management Center after the rollout completes.
Activate a Production License
The following command activates the production license on all server pods. Replace xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your license key and Production with the environment associated with that license:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set-string license.licenseKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --set-string license.envName="Production" --set-string license.action="activate"
Deactivate a Production License
The following command deactivates the production license on all server pods. Replace xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your license key and Production with the environment associated with that license:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set-string license.licenseKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --set-string license.envName="Production" --set-string license.action="deactivate"
Perform a Rolling Upgrade
A rolling upgrade replaces one pod at a time, starting with the highest-numbered pod and proceeding in descending order. For the default two-server deployment, ncache-1 is upgraded before ncache-0. Each pod must become ready and complete the configured delay before the next pod is upgraded. The upgrade succeeds only when all server pods have been upgraded; otherwise, the chart attempts to restore the previous image. Verify all server pods and caches after a failed upgrade.
Use a different image tag from the installed image; re-publishing the same tag does not trigger this upgrade. For a supported patch or minor version transition, upgrade the NCache image in rolling mode:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set-string image.repository="alachisoft/ncache" --set-string image.tag="<target-image-tag>" --set image.upgrade=rolling --set image.delayMinutes=2
If an upgrade fails, the rollout stops at the first failed server and attempts to restore the previous image. Recovery relies on healthy remaining replicas retaining configuration and data; this recovery does not restore a backup. A single-server or non-replicated cache does not provide the same data-preservation guarantee. An upgraded server becomes ready after joining every cache.
The image revert does not restore the Helm release's recorded values. Inspect the release history and roll back to the revision used before the failed upgrade; otherwise, the next --reuse-values upgrade can retry the failed image:
helm history ncache --namespace ncache
helm rollback ncache "<previous-revision>" --namespace ncache
Replace <previous-revision> with the numeric revision from the release history. If the image revert also fails, correct the underlying problem, such as an image-pull failure or insufficient resources, delete only the affected stuck pod, and then run the Helm rollback:
kubectl delete pod "<stuck-pod-name>" --namespace ncache
Verify server readiness and cache availability after recovery. If required data is no longer available on surviving servers, restore it from your backup.
Perform an Offline Upgrade
An offline upgrade requires downtime while the chart backs up configuration and data, stops all server pods, replaces them with the target image, and restores the caches. Application writes are not stopped automatically, so stop writes and take an independent backup of both configuration and data before starting the upgrade. Keep writes stopped until restoration has been verified. The upgrade job uses temporary backup storage that is lost if its pod fails; in that situation, recover the configuration manually and restore data from the independent backup before resuming writes.
For a supported major version transition, upgrade in offline mode:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set-string image.repository="alachisoft/ncache" --set-string image.tag="<target-image-tag>" --set image.upgrade=offline
Update Cache Settings
The chart configures caches through the caches list. Only caches[0], named defaultCache by default, is enabled during a default installation. Its Client Cache is also enabled by default with a size of 1024 MB and an isolation level of outproc.
The following command enables caches[1] using its default name, sessionCache, or its previously configured name:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set 'caches[1].enabled=true'
Each setting uses the value supplied in the update, its previously applied value if omitted, or its default if no previous value exists. For example, the following command changes only the configured size of caches[1]:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set 'caches[1].size=2048'
Additional cache entries must be enabled in order and disabled in reverse order, starting with the highest enabled entry. Each entry from caches[2] onward requires the preceding entry to be enabled; caches[1] does not depend on caches[0]. Entries from caches[4] onward use the name cache<N> unless a name is supplied.
To enable caches[1] with a 512 MB in-process Client Cache, use the following command:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set 'caches[1].enabled=true' --set 'caches[1].clientCache.enabled=true' --set 'caches[1].clientCache.size=512' --set 'caches[1].clientCache.isolationLevel=inproc'
For an out-of-process Client Cache, set clientCache.isolationLevel to outproc and deploy the client containers separately, as described in Deploy an Out-of-Process Client Cache with Kubernetes. Enabling the Client Cache through Helm does not deploy these containers.
Cache configuration updates can be combined with other configuration updates, but image upgrades must be performed separately. The accepted values and defaults are described under cache values.
Warning
Disabling a cache deletes it. Changing an existing cache definition, including its enabled Client Cache configuration, recreates the cache without preserving its data. Preserve required data before applying these changes.
After the update completes, verify the caches in NCache Management Center, which provides tools for cache management and monitoring.
Update Gateway Settings
The chart creates client and management LoadBalancer services. To access NCache Management Center through a public endpoint, you must configure gateway.mgmtCenterEndpoint. EKS deployments also require eks.publicSubnetIds; this additional setting is not required for other platforms. These values can be supplied during helm install or updated through helm upgrade. The gateway endpoints must be reachable from the networks used by client applications and administrators. Apply gateway changes separately from image upgrades.
On-Premises, AKS, GKE, and OpenShift
For public access to NCache Management Center, set gateway.mgmtCenterEndpoint to a public IPv4 address available to the cluster's load balancer. For on-premises and bare-metal OpenShift deployments, allocate the address through the configured load balancer infrastructure. For AKS and GKE, ensure that the reserved address is compatible with the cluster's load balancer configuration.
Replace <management-ip> with the address allocated for your deployment:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set-string gateway.mgmtCenterEndpoint="<management-ip>"
EKS
The chart requests an internal AWS Network Load Balancer for client connections and an internet-facing Network Load Balancer for management. Client applications must have network access to the internal endpoint.
For public access to NCache Management Center on EKS, set gateway.mgmtCenterEndpoint to the management DNS hostname and set eks.publicSubnetIds to at least two public subnet IDs from different Availability Zones, separated by commas escaped as \, when passed through Helm. An IPv4 address is not accepted for the EKS management endpoint.
Replace the example hostname and subnet IDs with those for your environment:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set-string gateway.mgmtCenterEndpoint="ncache.example.com" --set eks.publicSubnetIds="subnet-123\,subnet-456"
Configure DNS to resolve the management hostname to the assigned load balancer.
After updating gateway settings on any platform, check the services and verify that the assigned endpoints are reachable:
kubectl get svc -n ncache
The unified chart values describe the available gateway ports and settings.
Update TLS Settings
TLS settings can be updated through helm upgrade, separately from an image upgrade. Before applying a change, ensure that client applications support the selected TLS configuration and trust the server certificate.
The tls.protocolVersion value applies to standard and mutual TLS. It accepts tls12, tls13, or auto and defaults to tls12. Unsupported values are rejected during installation and upgrade.
When changing an existing TLS deployment from tls12 to tls13, first select auto and verify that the update completes. Then select tls13 in a second operation. Use the same intermediate auto setting when changing from tls13 to tls12:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set tls.protocolVersion=auto
Verify the operation using Verify an Update, then apply the target protocol:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values --set tls.protocolVersion=tls13
To enable mutual TLS, first create the certificate Secret in the deployment namespace, as described in Create TLS Secret.
Save the following settings in ncache-mutual-tls-values.yaml. These settings enable mutual TLS and clear custom-certificate values retained from an earlier configuration, because mutual TLS obtains its certificates and passwords from the existing Secret:
tls:
enabled: true
mutualEnabled: true
secretName: ncache-tls-secret
customCertificate: ""
customCertificatePassword: ""
customClientCertificate: ""
customClientCertificatePassword: ""
Note
TLS certificates are mounted in /usr/local/share/ca-certificates inside the NCache containers. Ensure that the server and client certificate paths refer to valid certificate files. For the mutual TLS configuration shown above, the certificates are supplied through the Secret; leave tls.customCertificate and tls.customClientCertificate empty.
Replace ncache-tls-secret if your Secret has a different name, then apply the update:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache-helm --version 5.3.8 --namespace ncache --reuse-values -f ncache-mutual-tls-values.yaml
For mutual TLS, the chart automatically supplies the client certificate and its password, when required, to the NCache commands it runs. These credentials are read from the Secret identified by tls.secretName, so no additional command parameters are required. Configure client applications separately, as described in Configure TLS for Client Deployment.
Warning
Changes to TLS mode, protocol, or Secret name restart caches without replacing server pods. Adding or removing a custom server certificate also replaces server pods. These operations can interrupt client connections. Plan the update accordingly, and verify cache availability and client connectivity after it completes.
Replace YAML Server Pods
Use this procedure after applying a changed pod template with the OnDelete strategy. Back up required data first and verify that the remaining servers can keep the caches available during each replacement. If they cannot, schedule downtime.
For the default two-server deployment, replace ncache-1 first:
kubectl delete pod ncache-1 --namespace default
kubectl get pods --namespace default -l app=ncache -o wide
Wait for the replacement pod to start. In NCache Management Center, verify that it has joined every intended cache, that synchronization has completed, and that the caches are running. Test an application connection before continuing.
Replace ncache-0 only after these checks pass:
kubectl delete pod ncache-0 --namespace default
kubectl get pods --namespace default -l app=ncache -o wide
Repeat the same cache and client checks. For deployments with more servers, proceed one at a time in descending pod-number order. Stop if a replacement fails; a pod being reported as running does not establish that its caches have synchronized.
Verify an Update
Check the deployment after every operation and investigate failed pods or jobs before making another change.
kubectl get pods,jobs --namespace ncache
kubectl get svc --namespace ncache
A successful Helm command confirms that the operation was accepted; wait for the configuration job to finish before starting another update. Find the current release revision and use it in the job name:
helm history ncache --namespace ncache
kubectl logs --namespace ncache -f "job/ncache-lifecycle-<revision>" --pod-running-timeout=2m
Replace <revision> with the numeric revision shown by Helm. Successful jobs are removed after completion. If the job is no longer available, check the recorded result:
kubectl get configmap ncache-store --namespace ncache -o jsonpath='{.data.lifecycleLifecycleResult}'
Confirm that the result corresponds to the requested operation and indicates success. Inspect failed job logs before proceeding.
In NCache Management Center, verify the expected server membership, cache status, and licensing. Confirm that management and client endpoints remain reachable, then add and retrieve an item through a client application. For TLS changes, use the corresponding client TLS settings when performing this check.
See Also
Kubernetes Self-Deployment
Deploy TLS With NCache Kubernetes