netscaler-cpx-with-gateway-controller
by NetScaler
A Helm chart for NetScaler CPX with NetScaler Kubernetes Gateway Controller running as sidecar.
About this chart
NetScaler CPX with NetScaler Gateway Controller running as sidecar.
TL;DR;
For Kubernetes
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm install netscaler-cpx-with-gateway-controller netscaler/netscaler-cpx-with-gateway-controller --set license.accept=yes,gatewayController.gatewayControllerName=<controllerName>
For OpenShift
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm install netscaler-cpx-with-gateway-controller netscaler/netscaler-cpx-with-gateway-controller --set license.accept=yes,gatewayController.openshift=true,gatewayController.gatewayControllerName=<controllerName>
Important:
The "license.accept" is a mandatory argument and should be set to "yes" to accept the terms of the NetScaler license.
Introduction
This Helm chart deploys a NetScaler CPX with NetScaler gateway controller as a sidecar in the Kubernetes or in the Openshift cluster using the Helm package manager.
Important:
For CPX deployments, download the NetScaler CPX latest image for 14.1 (
14.1-73.30) from Citrix Downloads for 14.1 or the NetScaler CPX latest image for 13.1 (13.1-64-24) from Citrix Downloads for 13.1. After downloading the NetScaler CPX image follow the instructions on the download page and update thenetscalerCpx.imagevalue in values.yaml to point to the downloaded image before installing the chart.
Prerequisites
-
The Kubernetes version should be 1.24 and above 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.
-
You have installed Prometheus Operator, if you want to view the metrics of the NetScaler CPX collected by the metrics exporter.
-
Registration of NetScaler CPX in ADM: You may want to register your CPX in ADM for licensing or to obtain servicegraph. For this you will have to create a Kubernetes secret using ADM credentials and provide it while install the chart. Create a Kubernetes secret for the user name and password using the following command:
kubectl create secret generic admlogin --from-literal=username=<adm-username> --from-literal=password=<adm-password>
Installing the Chart
Add the NetScaler Gateway Controller helm chart repository using command:
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
For Kubernetes:
1. NetScaler CPX with NetScaler Gateway Controller running as side car.
To install the chart with the release name my-release:
helm install my-release netscaler/netscaler-cpx-with-gateway-controller --set license.accept=yes,gatewayController.gatewayControllerName=<controllerName>
Note:
By default the chart installs the recommended RBAC roles and role bindings.
The command deploys NetScaler CPX with NetScaler gateway controller as a sidecar on the Kubernetes cluster with the default configuration. The configuration section lists the mandatory and optional parameters that you can configure during installation.
For OpenShift:
Add the name of the service account created when the chart is deployed to the privileged Security Context Constraints of OpenShift:
oc adm policy add-scc-to-user privileged system:serviceaccount:<namespace>:<service-account-name>
1. NetScaler CPX with NetScaler Gateway Controller running as side car.
To install the chart with the release name, my-release, use the following command:
helm install my-release netscaler/netscaler-cpx-with-gateway-controller --set license.accept=yes,gatewayController.openshift=true,gatewayController.gatewayControllerName=<controllerName>
Installed components
The following components are installed:
NetScaler CPX Service Annotations:
The parameter serviceAnnotations can be used to annotate CPX service while installing NetScaler CPX using this helm chart. For example, if CPX is getting deployed in Azure and an Azure Internal Load Balancer is required before CPX then the annotation service.beta.kubernetes.io/azure-load-balancer-internal:True can be set in CPX service as:
service:
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal:True
NetScaler CPX Service Ports:
By default, port 80 and 443 of CPX service will exposed when CPX is installed using this helm chart.To expose the CPX service as a NodePort, specify the service type as NodePort: service:
service:
annotations: {}
spec:
type: NodePort
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
- port: 443
targetPort: 443
protocol: TCP
name: https
CRDs configuration
CRDs will be installed when we install NetScaler 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) viaExtensionRef.mcproutes.citrix.com— MCP content-switching route: matches thex-netscaler-target-mcp-serverheader (BEFORE_STR("/").CONTAINS(...)) with adefault: truecatch-all and apolicyExpressionpassthrough 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.
Tolerations
Taints are applied on cluster nodes whereas tolerations are applied on pods. Tolerations enable pods to be scheduled on node with matching taints. For more information see Taints and Tolerations in Kubernetes.
Toleration can be applied to pod running NetScaler CPX and gateway controller containers using tolerations argument while deploying CPX+NSGWC using helm chart. This argument takes list of tolerations that user need to apply on the CPX+NSGWC pods.
For example, following command can be used to apply toleration on the CPX+NSGWC pod:
helm install my-release netscaler/netscaler-cpx-with-gateway-controller --set license.accept=yes,tolerations[0].key=<toleration-key>,tolerations[0].value=<toleration-value>,tolerations[0].operator=<toleration-operator>,tolerations[0].effect=<toleration-effect>,gatewayController.gatewayControllerName=<controllerName>
Here tolerations[0].key, tolerations[0].value and tolerations[0].effect are the key, value and effect that was used while tainting the node.
Effect represents what should happen to the pod if the pod don't have any matching toleration. It can have values NoSchedule, NoExecute and PreferNoSchedule.
Operator represents the operation to be used for key and value comparison between taint and tolerations. It can have values Exists and Equal. The default value for operator is Equal.
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 NSGWC and CPX containers can be provided explicitly in the helm chart.
To set requests and limits for the NSGWC container, use the variables gatewayController.resources.requests and gatewayController.resources.limits respectively.
Similarly, to set requests and limits for the CPX container, use the variable netscalerCpx.resources.requests and netscalerCpx.resources.limits respectively.
Below is an example of the helm command that configures
A) For NSGWC container:
CPU request for 500milli CPUs
CPU limit at 1000m
Memory request for 512M
Memory limit at 1000M
B) For CPX container:
CPU request for 250milli CPUs
CPU limit at 500m
Memory request for 256M
Memory limit at 512M
helm install my-release netscaler/netscaler-cpx-with-gateway-controller --set license.accept=yes --set gatewayController.resources.requests.cpu=500m,gatewayController.resources.requests.memory=512Mi,gatewayController.resources.limits.cpu=1000m,gatewayController.resources.limits.memory=1000Mi --set netscalerCpx.resources.limits.cpu=500m,netscalerCpx.resources.limits.memory=512Mi,netscalerCpx.resources.requests.cpu=250m,netscalerCpx.resources.requests.memory=256Mi --set gatewayController.gatewayControllerName="netscaler.com/gateway-controller"
Configuration
The following table lists the configurable parameters of the NetScaler CPX with NetScaler gateway controller as side car chart and their default values.
| Parameters | Mandatory or Optional | Default value | Description |
|---|---|---|---|
| license.accept | Mandatory | no | Set yes to accept the NetScaler gateway controller end user license agreement. |
| gatewayController.gatewayControllerName | Mandatory | N/A | Name of Gateway Controller . |
| gatewayController.imageRegistry | Mandatory | quay.io | The NetScaler gateway controller image registry |
| gatewayController.imageRepository | Mandatory | netscaler/netscaler-k8s-ingress-controller | The NetScaler gateway controller image repository |
| gatewayController.imageTag | Mandatory | 4.3.22 | The NetScaler gateway controller image tag |
| gatewayController.pullPolicy | Mandatory | IfNotPresent | The NetScaler gateway controller image pull policy. |
| gatewayController.required | Mandatory | true | NSGWC to be run as sidecar with NetScaler CPX |
| gatewayController.enableLivenessProbe | Optional | False | Enable liveness probe settings for NetScaler Gateway Controller |
| gatewayController.enableReadinessProbe | Optional | False | Enable Readineess probe settings for NetScaler Gateway Controller |
| gatewayController.livenessProbe | Optional | N/A | Set livenessProbe settings for NSGWC |
| gatewayController.readinessProbe | Optional | N/A | Set readinessProbe settings |
| gatewayController.resources | Optional | {} | CPU/Memory resource requests/limits for NetScaler Gateway Controller container |
| gatewayController.rbacRole | Optional | false | To deploy NSGWC with RBAC Role set rbacRole=true; by default NSGWC gets installed with RBAC ClusterRole(rbacRole=false) |
| imagePullSecrets | Optional | N/A | Provide list of Kubernetes secrets to be used for pulling the images from a private Docker registry or repository. For more information on how to create this secret please see Pull an Image from a Private Registry. |
| nameOverride | Optional | N/A | String to partially override deployment fullname template with a string (will prepend the release name) |
| fullNameOverride | Optional | N/A | String to fully override deployment fullname template with a string |
| netscalerCpx.resources | Optional | {} | CPU/Memory resource requests/limits for NetScaler CPX container |
| gatewayController.nitroReadTimeout | Optional | 20 | The nitro Read timeout in seconds, defaults to 20 |
| gatewayController.logLevel | Optional | INFO | The loglevel to control the logs generated by gatewayController. The supported loglevels are: CRITICAL, ERROR, WARNING, INFO, DEBUG, TRACE and NONE. For more information, see Logging. |
| gatewayController.jsonLog | Optional | false | Set this argument to true if log messages are required in JSON format |
| gatewayController.nsConfigDnsRec | Optional | false | To enable/disable DNS address Record addition in NetScaler through Gateway |
| gatewayController.nsSvcLbDnsRec | Optional |
Deploy netscaler-cpx-with-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-cpx-with-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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartnetscaler-cpx-with-gateway-controller is pinned at v2.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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