netscaler-kubernetes-gateway-controller

by NetScaler

Helm chartv2.3.0App 2.3.0Verified publisher

A Helm chart for NetScaler Kubernetes Gateway Controller configuring MPX/VPX.

About this chart

NetScaler Kubernetes Gateway Controller.

NetScaler provides Kubernetes Gateway Controller and load balancing solution which globally monitors applications, collects, and shares metrics across different clusters, and provides intelligent load balancing decisions. It ensures better performance and reliability for your Kubernetes applications.

TL;DR;

For Kubernetes

helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/

helm install gateway-controller netscaler/netscaler-kubernetes-gateway-controller --set gatewayController.gatewayControllerName=citrix.com/nsgc-controller,license.accept=yes,gatewayController.entityPrefix=gwy

For OpenShift

helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/

helm install gateway-controller netscaler/netscaler-kubernetes-gateway-controller --set gatewayController.gatewayControllerName=citrix.com/nsgc-controller,license.accept=yes,gatewayController.openshift=true,gatewayController.entityPrefix=gwy

Important:

The license.accept argument is mandatory. Ensure that you set the value as yes to accept the terms and conditions of the NetScaler license.

NOTE:

The CRDs supported by NetScaler will be installed automatically with the installation of the Helm Charts if CRDs are not already available in the cluster.

Introduction

This Helm chart deploys NetScaler Kubernetes Gateway Controller in the Kubernetes or in the Openshift cluster using Helm package manager.

NetScaler credential hot-reload with HashiCorp Vault

This chart can source the NetScaler (ADC) login credentials from HashiCorp Vault and hot-reload them when they rotate, without restarting the Gateway controller. The feature is opt-in: set vaultCredentials.enabled=true (top-level) and add a Vault Agent sidecar (via extraContainers) that renders the username and password files into the shared credential volume the chart mounts at vaultCredentials.mountPath (default /etc/citrix); netscaler.adcCredentialSecret then becomes optional. Any rotated credential is validated against the NetScaler before the controller switches to it, and the controller keeps the last-good credential if a rotation is invalid. But if you already changed the password on the NetScaler, the last-good credential no longer works either, and the controller cannot log in, so fix the value in Vault right away. Requires NetScaler Kubernetes Gateway Controller 2.3.0 or later (controller image 4.3.x or later). Vault (files) and netscaler.adcCredentialSecret are not mutually exclusive: the controller resolves each field file-first (IP-keyed file → flat file → NS_USER/NS_PASSWORD from the secret), so a file always takes precedence and the secret is used only as a fallback for a missing/empty file — and only the file source is hot-reloaded. vaultCredentials.suppressEnvCredentials (default true) omits the secret env entirely for a Vault-only deployment (making netscaler.adcCredentialSecret optional); set it false to keep the secret as a static start-up fallback. The chart sets the NS_CRED_HOTRELOAD environment variable from this flag in both directions, so hot-reload is armed only when you ask for it: an existing /etc/citrix/username/password secret-as-file mount — supported long before this feature — does not turn it on by itself on upgrade. The chart also accepts initContainers (default []; Kubernetes runs init containers to completion before it starts the other containers of the pod), but a Vault Agent init container is optional here: the Gateway controller waits for the credential files at start-up (vaultCredentials.credentialWaitSeconds, default 120), so the sidecar alone is enough (a metrics exporter that you run in its own pod does need one; see the guide linked below). For step-by-step instructions and the full list of vaultCredentials.* and sidecar hook variables, see Use NetScaler credentials stored in a Vault server with NetScaler Kubernetes Gateway Controller.

# optional: the Gateway controller also waits for the credential files at start-up
initContainers:
  - name: vault-agent-init
    image: hashicorp/vault:1.21   # the same image as the sidecar, run as a Vault Agent, not a Vault server
    args: ["agent", "-config=/etc/vault/vault-agent-config.hcl", "-exit-after-auth"]   # write the files once, then exit
    # env and volumeMounts: the same as your vault-agent sidecar in extraContainers

Prerequisites

  • The Kubernetes version 1.24 or later if using Kubernetes environment.

  • Kubernetes version 1.29 or later is required to enable API Priority and Fairness (apiPriorityAndFairness.enabled=true).

  • The Openshift version 4.8 or later if using OpenShift platform.

  • Openshift version 4.16 or later is required to enable API Priority and Fairness (apiPriorityAndFairness.enabled=true).

  • The Helm version 3.x or later. You can follow instruction given here to install the same.

  • The user name and password of the NetScaler VPX or MPX appliance. The NetScaler appliance needs to have system user account (non-default) with certain privileges so that NetScaler Kubernetes Gateway Controller can configure the NetScaler VPX or MPX appliance. For instructions to create the system user account on NetScaler, see Create System User Account for NSIC in NetScaler.

    You can pass user name and password using Kubernetes secrets. Create a Kubernetes secret for the user name and password using the following command:

       kubectl create secret generic nslogin --from-literal=username='nsic' --from-literal=password='mypassword'
    
    • The secrets with credentials need to be created for all the NetScaler Nodes.

Installing the Chart

Add the NetScaler Kubernetes Gateway Controller helm chart repository using command:

   helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/

For Kubernetes:

1. NetScaler Kubernetes Gateway Controller

To install the chart with the release name, my-release, use the following command:

helm install my-release netscaler/netscaler-kubernetes-gateway-controller --set gatewayController.gatewayControllerName=citrix.com/nsgc-controller,license.accept=yes,gatewayController.entityPrefix=gwy

Note:

By default, the chart installs the recommended RBAC roles and role bindings.

The command deploys NetScaler Kubernetes Gateway Controller on Kubernetes cluster with the default configuration. The configuration section lists the mandatory and optional parameters that you can configure during installation.

For Openshift:

1. NetScaler Kubernetes Gateway Controller

Add the service account named "mcingress-k8s-role" to the privileged Security Context Constraints of OpenShift:

oc adm policy add-scc-to-user privileged system:serviceaccount:<namespace>:mcingress-k8s-role

To install the chart with the release name, my-release, use the following command:

helm install my-release netscaler/netscaler-kubernetes-gateway-controller --set gatewayController.gatewayControllerName=citrix.com/nsgc-controller,license.accept=yes,gatewayController.openshift=true,gatewayController.entityPrefix=gwy

The command deploys NetScaler Kubernetes Gateway Controller on your Openshift cluster in the default configuration. The configuration section lists the mandatory and optional parameters that you can configure during installation.

Installed components

The following components are installed:

  • NetScaler Kubernetes Gateway Controller

CRDs configuration

Kubernetes Gateway CRDs are expected to be installed, its prerequisite. Refer Install Kubernetes Gateway CRD

Netscaler CRDs will be installed when we install NetScaler Kubernetes Gateway controller via Helm automatically if CRDs are not installed in cluster already. If you wish to skip the CRD installation step, you can pass the --skip-crds flag. For more information about this option in Helm please see this.

The following CRDs enable the MCP (Model Context Protocol) gateway use case and are installed with this chart:

  • mcpprofiles.citrix.com — upstream MCP profile (token/header injection, URL replacement).
  • aigatewayroutes.citrix.com — AI/MCP umbrella route that attaches policies (rewrite, ratelimit, profiles, auth) via ExtensionRef.
  • mcproutes.citrix.com — MCP content-switching route: matches the x-netscaler-target-mcp-server header (BEFORE_STR("/").CONTAINS(...)) with a default: true catch-all and a policyExpression passthrough for arbitrary NetScaler routing.
  • aigatewayprofiles.citrix.com — frontend/backend AI gateway profile.
  • authpolicies.citrix.com — OAuth/OIDC authentication used by MCP tool-filtering and rate-limiting.

The MCP gateway needs NetScaler 14.1 or later (VPX, MPX or BLX), or a NetScaler CPX image based on 14.1 or later.

NOTE:

Helm installs CRDs under crds/ only when they are absent from the cluster; it does not create or update them during helm upgrade. If vips.citrix.com already exists in the cluster from an earlier NetScaler chart (for example NSIC or the CPX chart), it may carry an older spec.kind enum that does not accept gateway, and IPAM VIP allocation for Gateways will silently fail. Before enabling gatewayController.ipam, apply the updated CRD manually: kubectl apply -f crds/crds.yaml.

Resource Quotas

There are various use-cases when resource quotas are configured on the Kubernetes cluster. If quota is enabled in a namespace for compute resources like CPU and memory, users must specify requests or limits for those values; otherwise, the quota system may reject pod creation. The resource quotas for the Gateway Controller containers can be provided explicitly in the helm chart.

To set requests and limits for the Gateway Controller container, use the variables resources.requests and resources.limits respectively.

Below is an example of the helm command that configures

  • For Gateway Controller container:
  CPU request for 500 milli CPUs
  CPU limit at 1000m
  Memory request for 512M
  Memory limit at 1000M
helm install my-release netscaler/netscaler-kubernetes-gateway-controller --set gatewayController.gatewayControllerName=citrix.com/nsgc-controller,license.accept=yes --set resources.requests.cpu=500m,resources.requests.memory=512Mi --set resources.limits.cpu=1000m,resources.limits.memory=1000Mi,gatewayController.entityPrefix=gwy

Route Addition in MPX/VPX

For seamless connectivity of services deployed in the Kubernetes cluster, it is essential that NetScaler device should be able to reach the underlying overlay network over which Pods are running. gatewayController.nodeWatch knob of NetScaler Kubernetes Gateway Controller can be used for automatic route configuration on NetScaler towards the pod network. Refer Static Route Configuration for further details regarding the same. By default, gatewayController.nodeWatch is false. It needs to be explicitly set to true if auto route configuration is required.

This can also be achieved by deploying NetScaler Node Controller.

If your deployment uses one single NetScaler Device to loadbalance between multiple k8s clusters, there is a possibilty of CNI subnets to overlap, causing the above mentioned static routing to fail due to route conflicts. In such deployments [Policy Based Routing(PBR)] (https://docs.citrix.com/en-us/citrix-adc/current-release/networking/ip-routing/configuring-policy-based-routes/configuring-policy-based-routes-pbrs-for-ipv4-traffic.html) can be used instead. This would require you to provide one or more subnet IP Addresses unique for each kubernetes cluster using nsSNIPs in values.yaml.

Use the following command to provide subnet IPAddresses(SNIPs) to configure Policy Based Routes(PBR) on the NetScaler

helm install my-release netscaler/netscaler-kubernetes-gateway-controller --set gatewayController.gatewayControllerName=citrix.com/nsgc-controller,license.accept=yes,gatewayController.entityPrefix=gwy,netscaler.nsncPbr="true",netscaler.adcCredentialSecret=<Secret-for-ADC-credentials>,netscaler.nsSNIPs='[<NS_SNIP1>\, <NS_SNIP2>\, ...]'

Configuration

The following table lists the mandatory and optional parameters that you can configure during installation:

ParametersMandatory or OptionalDefault valueDescription
license.acceptMandatorynoSet yes to accept the NSIC end user license agreement.
imageRegistryOptionalquay.ioThe NetScaler Kubernetes Gateway Controller image registry
imageRepositoryOptionalnetscaler/netscaler-k8s-ingress-controllerThe NetScaler ingress controller image repository
imageTagOptional4.3.22The NetScaler Kubernetes Gateway Controller image tag

Deploy netscaler-kubernetes-gateway-controller with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has netscaler-kubernetes-gateway-controller on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartnetscaler-kubernetes-gateway-controller is pinned at v2.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply