netscaler-cpx-with-ingress-controller

by NetScaler

Helm chartv4.3.22App 4.3.22Verified publisher

A Helm chart for NetScaler CPX with NetScaler ingress Controller running as sidecar.

About this chart

NetScaler CPX with NetScaler Ingress Controller running as sidecar.

In a Kubernetes or OpenShift cluster, you can deploy NetScaler CPX with NetScaler ingress controller as a sidecar. The NetScaler CPX instance is used for load balancing the North-South traffic to the microservices in your cluster. And, the sidecar NetScaler ingress controller configures the NetScaler CPX.

TL;DR;

For Kubernetes

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

helm install netscaler-cpx-with-ingress-controller netscaler/netscaler-cpx-with-ingress-controller --set license.accept=yes

For OpenShift

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

helm install netscaler-cpx-with-ingress-controller netscaler/netscaler-cpx-with-ingress-controller --set license.accept=yes,openshift=true

Important:

The "license.accept" is a mandatory argument and should be set to "yes" to accept the terms 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 a NetScaler CPX with NetScaler ingress 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 the image value 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 Ingress Controller helm chart repository using command:

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

For Kubernetes:

1. NetScaler CPX with NetScaler Ingress Controller running as side car.

To install the chart with the release name my-release:

helm install my-release netscaler/netscaler-cpx-with-ingress-controller --set license.accept=yes,ingressClass[0]=<ingressClassName>

Note:

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

The command deploys NetScaler CPX with NetScaler ingress 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.

2. NetScaler CPX with NetScaler Ingress Controller and Exporter running as side car.

Metrics exporter can be deployed as sidecar to the NetScaler CPX and collects metrics from the NetScaler CPX instance. You can then visualize these metrics using Prometheus Operator and Grafana.

Note:

Ensure that you have installed Prometheus Operator.

Use the following command for this:

helm install my-release netscaler/netscaler-cpx-with-ingress-controller --set license.accept=yes,ingressClass[0]=<ingressClassName>,exporter.required=true

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 Ingress 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-ingress-controller --set license.accept=yes,openshift=true

2. NetScaler CPX with NetScaler Ingress Controller and Exporter running as side car.

Metrics exporter can be deployed as sidecar to the NetScaler CPX and collects metrics from the NetScaler CPX instance. You can then visualize these metrics using Prometheus Operator and Grafana.

Note:

Ensure that you have installed Prometheus Operator.

Use the following command for this:

helm install my-release netscaler/netscaler-cpx-with-ingress-controller --set license.accept=yes,openshift=true,exporter.required=true

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 using Helm command:

helm install my-release netscaler/netscaler-cpx-with-ingress-controller --set license.accept=yes,serviceAnnotations.service\\.beta\\.kubernetes\\.io/azure-load-balancer-internal=True

or the same can be provided in values.yaml:

license:
  accept: yes
serviceAnnotations:
  service.beta.kubernetes.io/azure-load-balancer-internal: True

which can be used to install NetScaler CPX using Helm command:

helm install my-release netscaler/netscaler-cpx-with-ingress-controller -f values.yaml

To know more about service annotations supported by Kubernetes on various platforms please see this.

NetScaler CPX Service Ports:

By default, port 80 and 443 of CPX service will exposed when CPX is installed using this helm chart. If it is required to expose any other ports in CPX service then the parameter servicePorts can be used for it. For example, if port 9999 is required to be exposed then below helm command can be used for installing NetScaler CPX:

helm install my-release netscaler/netscaler-cpx-with-ingress-controller --set license.accept=yes,servicePorts[0].port=9999,servicePorts[0].protocol=TCP,servicePorts[0].name=https

or the same can be provided in values.yaml:

license:
  accept: yes
servicePorts:
  - port: 9090
    protocol: TCP
    name: https

which can be used to install NetScaler using Helm command:

helm install my-release netscaler/netscaler-cpx-with-ingress-controller -f values.yaml

Note: If servicePorts parameters is used, only ports provided in this parameter will be exposed in CPX service. If you want to expose default ports 80 or 443, then you will need to explicity mention these also in this parameter.

Configuration for ServiceGraph:

If NetScaler CPX need to send data to the NetScaler ADM to bring up the servicegraph, then the below steps can be followed to install NetScaler CPX with ingress controller. NetScaler ingress controller configures NetScaler CPX with the configuration required for servicegraph.

  1. Create secret using NetScaler Agent credentials, which will be used by NetScaler CPX to communicate with NetScaler ADM Agent:
kubectl create secret generic admlogin --from-literal=username=<adm-agent-username> --from-literal=password=<adm-agent-password>
  1. Deploy NetScaler CPX with NetScaler ingress controller using helm command:
helm install my-release netscaler/netscaler-cpx-with-ingress-controller --set license.accept=yes,analyticsConfig.required=true,analyticsConfig.timeseries.metrics.enable=true,analyticsConfig.distributedTracing.enable=true,analyticsConfig.endpoint.metrics.service=<ADM-Agent-IP>,ADMSettings.ADMIP=<ADM-Agent-IP>,ADMSettings.loginSecret=<Secret-for-ADM-Agent-credentials>

Note: If container agent is being used here for NetScaler ADM, please provide svcIP of container agent in the analyticsConfig.endpoint.metrics.service parameter.

NetScaler CPX DaemonSet with NetScaler Ingress Controller as sidecar for BGP Advertisement

The previous section of deploying CPX as a Deployment requires a Tier-1 Loadbalancer such as NetScaler VPX or cloud loadbalancers to route the traffic to CPX instances running in Kubernetes cluster, but you can also leverage BGP network fabric in your on-prem environemnt to route the traffic to CPX instances in a Kubernetes or Openshift cluster. you need to deploy CPX with NetScaler Ingress Controller as Daemonset to advertise the ExternalIPs of the K8s services of type LoadBalancer to your BGP Fabric. NetScaler CPX establishes a BGP peering session with your network routers, and uses that peering session to advertise the IP addresses of external cluster services. If your routers have ECMP capability, the traffic is load-balanced to multiple CPX instances by the upstream router, which in turn load-balances to actual application pods. When you deploy the NetScaler CPX with this mode, NetScaler CPX adds iptables rules for each service of type LoadBalancer on Kubernetes nodes. The traffic destined to the external IP address is routed to NetScaler CPX pods. You can also set the 'ingressIP' variable to an IP Address to advertise the External IP address for Ingress resources. Refer documentation for complete details about BGP advertisement with CPX.

Download the chart

You can download the chart usimg helm pull command.

helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm pull netscaler/netscaler-cpx-with-ingress-controller
tar -zxvf netscaler-cpx-with-ingress-controller-x.y.z.tgz

Edit the BGP configuration in values.yaml

BGP configurations enables CPX to peer with neighbor routers for advertisting the routes for Service of Type LoadBalancer. NetScaler Ingress Controllers uses static IPs given in Service YAML or using an IPAM controller to allocate an External IP address, and same is advertisted to the neighbour router with the Gateway as Node IP. An example BGP configurations is given below.

# BGP configurations: local AS, remote AS and remote address is mandatory to provide.
bgpSettings:
  required: true
  bgpConfig:
  - bgpRouter:
      # Local AS number for BGP advertisement
      localAS:
      neighbor:
        # Address of the nighbor router for BGP advertisement
      - address: xx.xx.xx.xx
        # Remote AS number
        remoteAS:
        advertisementInterval: 10
        ASOriginationInterval: 10

If the cluster spawns across multiple networks, you can also specify the NodeSelector to give different neighbors for different Cluster Nodes as shown below.

bgpSettings:
  required: true
  bgpConfig:

Deploy netscaler-cpx-with-ingress-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-ingress-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-cpx-with-ingress-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