netscaler-gslb-controller

by NetScaler

Helm chartv4.3.22App 4.3.22Verified publisher

A Helm chart for NetScaler GSLB Controller configuring MPX/VPX.

About this chart

NetScaler GSLB Controller

NetScaler provides a GSLB controller and load balancing solution which globally monitors applications, collect, and share metrics across different clusters, and provides intelligent load balancing decisions. It ensures better performance and reliability for your Kubernetes applications.NetScaler GSLB Controller is the module responsible for the configuration of the NetScaler GSLB devices.

TL;DR;

For Kubernetes

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

helm install gslb-controller netscaler/netscaler-gslb-controller --set localRegion=<local-cluster-region>,localCluster=<local-cluster-name>,sitedata[0].siteName=<site1-name>,sitedata[0].siteIp=<site1-ip-address>,sitedata[0].secretName=<site1-login-file>,sitedata[0].siteRegion=<site1-region-name>,sitedata[1].siteName=<site2-name>,sitedata[1].siteIp=<site2-ip-address>,sitedata[1].secretName=<site2-login-file>,sitedata[1].siteRegion=<site2-region-name>,license.accept=yes

For OpenShift

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

helm install gslb-controller netscaler/netscaler-gslb-controller --set localRegion=<local-cluster-region>,localCluster=<local-cluster-name>,sitedata[0].siteName=<site1-name>,sitedata[0].siteIp=<site1-ip-address>,sitedata[0].secretName=<site1-login-file>,sitedata[0].siteRegion=<site1-region-name>,sitedata[1].siteName=<site2-name>,sitedata[1].siteIp=<site2-ip-address>,sitedata[1].secretName=<site2-login-file>,sitedata[1].siteRegion=<site2-region-name>,license.accept=yes,openshift=true

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 ingress 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 — both the local ADC and each GSLB site — from HashiCorp Vault and hot-reload them when they rotate, without restarting the GSLB controller. The feature is opt-in: set vaultCredentials.enabled=true and add a Vault Agent sidecar (via extraContainers) that renders the credential files into the shared volume the chart mounts at vaultCredentials.mountPath (default /etc/citrix) — local creds at username/password and each site's creds under auth/<siteName>/username|password|mep_password. Any rotated credential is validated against the target ADC 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 that ADC, the last-good credential no longer works either, and the controller cannot log in to that ADC, so fix the value in Vault right away. Requires NetScaler GSLB controller 4.3.x or later. Vault (files) and the Kubernetes secrets (adcCredentialSecret for the local ADC, per-site secretName for each site) are not mutually exclusive: the controller resolves each field file-first (file → NS_USER/NS_PASSWORD env for the local ADC, and auth/<siteName>/… file → <site> env per site), 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; set it false to keep the secrets 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 GSLB controller waits for the credential files at start-up (vaultCredentials.credentialWaitSeconds, default 120), so the sidecar alone is enough. 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 GSLB controller.

# optional: the GSLB 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 ingress 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 needs to be created for all the NetScaler Nodes.
  • Creation of secrets is required for the GSLB controller to connect to GSLB devices and push the configuration from the GSLB controller.

       kubectl create secret generic <secretName for site> --from-literal=username=<username for gslb device> --from-literal=password=<password for gslb device>
    
    • The username and password in the above secret specifies the credentials (non-default) of a NetScaler GSLB device user. These secrets are provided as parameters while installing GSLB controller using helm install command for the respective sites and are required to be created in all clusters.

NOTE:

Starting from GSLB controller version 2.3.x, a password is required for GSLB site-to-site communication. To enhance security, it is recommended to add an additional key sitesyncpassword to the secret. If the sitesyncpassword key is not provided, the default password key will be used for site-to-site communication.

kubectl create secret generic <secretName for site> --from-literal=username=<username for gslb device> --from-literal=password=<password for gslb device> --from-literal=sitesyncpassword=<password for secure site-to-site communication>
  • Following configurations needs to be done on the NetScaler's for manually provisioning GSLB sites

    • Add a SNIP (The subnet IP address). For more information, see IP Addressing in NetScaler.
      add ip <snip> <netmask>
      
    • GSLB sites needs to be configured on all the NetScaler which acts as the GSLB Node.
      add gslb site <sitename> <snip>
      
    • Features like content switching(CS),Load Balancing(LB), SSL, GSLB should be enabled on all the NetScaler Nodes
      en feature lb,cs,ssl,gslb
      
  • Above configurations can be automated by the controller by supplying additional parameters

    • Use the following additional parameters:

       --set nsIP=<NSIP>,adcCredentialSecret=<Secret-for-NetScaler-credentials>
      

      Example:

      helm install gslb-controller netscaler/citrix-gslb-controller --set localRegion=<local-cluster-region>,localCluster=<local-cluster-name>,sitedata[0].siteName=<site1-name>,sitedata[0].siteIp=<site1-ip-address>,sitedata[0].secretName=<site1-login-file>,sitedata[0].siteRegion=<site1-region-name>,sitedata[1].siteName=<site2-name>,sitedata[1].siteIp=<site2-ip-address>,sitedata[1].secretName=<site2-login-file>,sitedata[1].siteRegion=<site2-region-name>,license.accept=yes,adcCredentialSecret=<Secret-for-NetScaler-credentials> --set nsIP=<NSIP>
      
    • You determine the NS_IP IP address needed by the controller to communicate with NetScaler. The IP address might be anyone of the following depending on the type of NetScaler deployment:

    • (Standalone appliances) NSIP - The management IP address of a standalone NetScaler appliance. For more information, see IP Addressing in NetScaler.

    • (Appliances in High Availability mode) SNIP - The subnet IP address. For more information, see IP Addressing in NetScaler.

    • (Appliances in Clustered mode) CLIP - The cluster management IP (CLIP) address for a clustered NetScaler deployment. For more information, see IP addressing for a clusterl

  • For static proximity, the location database has to be applied externally

    add locationfile /var/netscaler/inbuilt_db/Citrix_Netscaler_InBuilt_GeoIP_DB_IPv4
    

Create system User account for NSIC in NetScaler

NetScaler ingress controller configures the NetScaler using a system user account of the NetScaler. The system user account should have certain privileges so that the NSIC has permission configure the following on the NetScaler:

  • Add, Delete, or View Content Switching (CS) virtual server
  • Add, Delete, or View GSLB virtual server
  • Configure CS policies and actions
  • Configure Load Balancing (LB) virtual server
  • Configure Service groups
  • Configure user monitors
  • Check the status of the NetScaler appliance

Note:

The system user account would have privileges based on the command policy that you define.

To create the system user account, do the following:

  1. Log on to the NetScaler appliance. Perform the following:

    1. Use an SSH client, such as PuTTy, to open an SSH connection to the NetScaler appliance.

    2. Log on to the appliance by using the administrator credentials.

  2. Create the system user account using the following command:

       add system user <username> <password>
    

    For example:

       add system user nsic mypassword
    
  3. Create a policy to provide required permissions to the system user account. Use the following command:

       add cmdpolicy nsic-policy ALLOW "(^\S+\s+cs\s+\S+)|(^\S+\s+lb\s+\S+)|(^\S+\s+service\s+\S+)|(^\S+\s+servicegroup\s+\S+)|(^stat\s+system)|(^show\s+ha)|(^\S+\s+ssl\s+certKey)|(^\S+\s+ssl)|(^\S+\s+route)|(^\S+\s+monitor)|(^show\s+ns\s+ip)|(^\S+\s+system\s+file)"
    
  4. Bind the policy to the system user account using the following command:

       bind system user nsic nsic-policy 0
    

Installing the Chart

Add the NetScaler GSLB Controller helm chart repository using command:

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

For Kubernetes:

1. NetScaler GSLB Controller

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

helm install my-release netscaler/netscaler-gslb-controller --set localRegion=<local-cluster-region>,localCluster=<local-cluster-name>,sitedata[0].siteName=<site1-name>,sitedata[0].siteIp=<site1-ip-address>,sitedata[0].secretName=<site1-login-file>,sitedata[0].siteRegion=<site1-region-name>,sitedata[1].siteName=<site2-name>,sitedata[1].siteIp=<site2-ip-address>,sitedata[1].secretName=<site2-login-file>,sitedata[1].siteRegion=<site2-region-name>,license.accept=yes

Note:

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

The command deploys NetScaler GSLB 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 GSLB 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:

Deploy netscaler-gslb-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-gslb-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-gslb-controller is pinned at v4.3.22 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