citrix-adc-istio-ingress-gateway
by NetScaler
A Helm chart for NetScaler as Ingress Gateway installation in Istio Service Mesh on Kubernetes platform
About this chart
Deploy NetScaler as an Ingress Gateway in Istio environment using Helm charts
NetScaler can be deployed as an Istio Ingress Gateway to control the ingress traffic to Istio service mesh.
Table of Contents
- TL; DR;
- Introduction
- Deploy NetScaler VPX or MPX as an Ingress Gateway
- Deploy NetScaler CPX as an Ingress Gateway
- Using Existing Certificates to deploy NetScaler as an Ingress Gateway
- Deploy NetScaler as an Ingress Gateway in multi cluster Istio Service mesh
- Segregating traffic with multiple Ingress Gateways
- Visualizing statistics of NetScaler Ingress Gateway with Metrics Exporter
- Exposing services running on non-HTTP ports
- Generate Certificate for Ingress Gateway
- Configure Third Party Service Account Tokens
- NetScaler CPX License Provisioning
- Service Graph configuration
- NetScaler as Ingress Gateway: a sample deployment
- Uninstalling the Helm chart
- NetScaler VPX/MPX Certificate Verification
- Configuration Parameters
TL; DR;
To deploy NetScaler VPX or MPX as an Ingress Gateway
kubectl create secret generic nslogin --from-literal=username=<netscaler-user> --from-literal=password=<netscaler-password> -n netscaler-system
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm install citrix-adc-istio-ingress-gateway netscaler/citrix-adc-istio-ingress-gateway --namespace netscaler-system --set ingressGateway.EULA=YES --set ingressGateway.netscalerUrl=https://<nsip>[:port] --set ingressGateway.vserverIP=<IPv4 Address> --set secretName=nslogin
To deploy NetScaler CPX as an Ingress Gateway
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm install citrix-adc-istio-ingress-gateway netscaler/citrix-adc-istio-ingress-gateway --namespace netscaler-system --set ingressGateway.EULA=YES --set citrixCPX=true
Introduction
This chart deploys NetScaler VPX, MPX, or CPX as an Ingress Gateway in the Istio service mesh using the Helm package manager. For detailed information on different deployment options, see Deployment Architecture.
Compatibility Matrix between NetScaler xDS-adaptor and Istio version
Below table provides info about recommended NetScaler xDS-Adaptor version to be used for various Istio versions.
| NetScaler xDS-Adaptor version | Istio version |
|---|---|
| quay.io/citrix/citrix-xds-adaptor:0.10.3 | Istio v1.14+ |
| quay.io/citrix/citrix-xds-adaptor:0.10.1 | Istio v1.12 to Istio v1.13 |
| quay.io/citrix/citrix-xds-adaptor:0.9.9 | Istio v1.10 to Istio v1.11 |
| quay.io/citrix/citrix-xds-adaptor:0.9.8 | Istio v1.8 to Istio v1.9 |
| quay.io/citrix/citrix-xds-adaptor:0.9.5 | Istio v1.6 |
Prerequisites
The following prerequisites are required for deploying NetScaler as an Ingress Gateway in Istio service mesh:
-
Ensure that Istio version 1.8 onwards is installed
-
Ensure that Helm with version 3.x is installed. Follow this step to install the same.
-
Ensure that your cluster Kubernetes version should be above 1.16 and the
admissionregistration.k8s.io/v1,admissionregistration.k8s.io/v1beta1API is enabledYou can verify the API by using the following command:
kubectl api-versions | grep admissionregistration.k8s.io/v1The following output indicates that the API is enabled:
admissionregistration.k8s.io/v1 admissionregistration.k8s.io/v1beta1 -
For deploying NetScaler VPX or MPX as an Ingress gateway:
Create a Kubernetes secret for the NetScaler user name and password using the following command:
kubectl create secret generic nslogin --from-literal=username=<netscaler-user> --from-literal=password=<netscaler-password> -n netscaler-system -
Create system user account for xDS-adaptor in NetScaler:
The NetScaler appliance needs to have system user account (non-default) with certain privileges so that
xDS-adaptorcan configure the NetScaler VPX or MPX appliance. Follow the instructions to create the system user account on NetScaler.Create a Kubernetes secret for the user name and password using the following command:
kubectl create secret generic nslogin --from-literal=username='cxa' --from-literal=password='mypassword'The
xDS-adaptorconfigures the NetScaler using a system user account of the NetScaler. The system user account should have certain privileges so that the xDS-adaptor has permissions configure the following on the NetScaler:- Add, Delete, or View Content Switching (CS) virtual server
- Configure CS policies and actions
- Configure Load Balancing (LB) virtual server
- Configure Service groups
- Cofigure SSl certkeys
- Configure routes
- Configure user monitors
- Add system file (for uploading SSL certkeys from Kubernetes)
- Configure Virtual IP address (VIP)
- Check the status of the NetScaler appliance
- Add, Delete or view authentication virtual server, policy, authaction
- Add, Delete or view Policy
- Add, Delete or view Responder policy, action, param
- Add, Delete or view Rewrite policy, action, param
- Add, Delete or view analytics profile
- Add, Delete or view DNS name server
- Add, Delete or view network netprofile
- Add, Delete or view Traffic Management Commands(sessionaction, session policy, sessionparameter)
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:
-
Log on to the NetScaler appliance. Perform the following:
-
Use an SSH client, such as PuTTy, to open an SSH connection to the NetScaler appliance.
-
Log on to the appliance by using the administrator credentials.
-
-
Create the system user account using the following command:
add system user <username> <password>For example:
add system user cxa mypassword -
Create a policy to provide required permissions to the system user account. Use the following command:
add cmdpolicy cxa-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)|)|(^\S+\s+aaa\s+\S+)|(^\S+\s+aaa\s+\S+\s+.*)|(^\S+\s+authentication\s+\S+)|(^\S+\s+authentication\s+\S+\s+.*)|(^\S+\s+policy\s+\S+)|(^\S+\s+policy\s+\S+\s+.*)|(^\S+\s+rewrite\s+\S+)|(^\S+\s+rewrite\s+\S+\s+.*)|(^\S+\s+analytics\s+\S+)|(^\S+\s+analytics\s+\S+\s+.*)|(^\S+\s+dns\s+\S+)|(^\S+\s+dns\s+\S+\s+.*)|(^\S+\s+netProfile)|(^\S+\s+netProfile\s+.*)|(^\S+\s+tm\s+\S+)|(^\S+\s+tm\s+\S+\s+.*)" -
Bind the policy to the system user account using the following command:
bind system user cxa cxa-policy 0
- Registration of NetScaler CPX in ADM
Create a secret for ADM username and password
kubectl create secret generic admlogin --from-literal=username=<adm-username> --from-literal=password=<adm-password> -n netscaler-system
- Important Note: For deploying NetScaler VPX or MPX as ingress gateway, you should establish the connectivity between NetScaler VPX or MPX and cluster nodes. This connectivity can be established by configuring routes on NetScaler as mentioned here or by deploying NetScaler Node Controller.
Deploy NetScaler VPX or MPX as an Ingress Gateway
To deploy NetScaler VPX or MPX as an Ingress Gateway in the Istio service mesh, do the following step. In this example, release name is specified as citrix-adc-istio-ingress-gateway and namespace as netscaler-system.
kubectl create secret generic nslogin --from-literal=username=<netscaler-user> --from-literal=password=<netscaler-password> -n netscaler-system
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm install citrix-adc-istio-ingress-gateway netscaler/citrix-adc-istio-ingress-gateway --namespace netscaler-system --set ingressGateway.EULA=YES,ingressGateway.netscalerUrl=https://<nsip>[:port],ingressGateway.vserverIP=<IPv4 Address> --set secretName=nslogin
Deploy NetScaler CPX as an Ingress Gateway
To deploy NetScaler CPX as an Ingress Gateway, do the following step. In this example, release name is specified as my-release and namespace is used as netscaler-system.
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm install my-release netscaler/citrix-adc-istio-ingress-gateway --namespace netscaler-system --set ingressGateway.EULA=YES,citrixCPX=true
Deploy NetScaler as an Ingress Gateway in multi cluster Istio Service mesh
To deploy NetScaler VPX/MPX as an Ingress Gateway in multi cluster Istio Service mesh, carry out below steps.
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm install citrix-adc-istio-ingress-gateway netscaler/citrix-adc-istio-ingress-gateway --namespace netscaler-system --set ingressGateway.EULA=YES,ingressGateway.netscalerUrl=https://<nsip>[:port],ingressGateway.vserverIP=<IPv4 Address> --set ingressGateway.multiClusterIngress=true
To deploy NetScaler CPX as an Ingress Gateway in multi cluster Istio Service mesh, carry out below steps.
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm install citrix-adc-istio-ingress-gateway netscaler/citrix-adc-istio-ingress-gateway --namespace netscaler-system --set ingressGateway.EULA=YES,citrixCPX=true --set ingressGateway.multiClusterIngress=true
By default, port 15443 of the NetScaler will be used to handle all the inter-cluster traffic coming to services deployed in local cluster. These services are exposed using *.global domain.
To modify the default 15443 port and "global" domain, use ingressGateway.multiClusterListenerPort and ingressGateway.multiClusterSvcDomain options of helm chart.
For example, to use port 25443 and mydomain as the service domain to expose local cluster deployed services to services in remote clusters.
helm install citrix-adc-istio-ingress-gateway netscaler/citrix-adc-istio-ingress-gateway --namespace netscaler-system --set ingressGateway.EULA=YES,ingressGateway.netscalerUrl=https://<nsip>[:port],ingressGateway.vserverIP=<IPv4 Address> --set ingressGateway.multiClusterIngress=true --set ingressGateway.multiClusterListenerPort=25443 --set ingressGateway.multiClusterSvcDomain=mydomain
Follow this as a sample example to deploy NetScaler as Ingress gateway in multi-cluster Istio service mesh.
Using Existing Certificates to deploy NetScaler as an Ingress Gateway
You may want to use the existing certificate and key for authenticating access to an application using NetScaler Ingress Gateway. In that case, you can create a Kubernetes secret from the existing certificate and key. You can mount the Kubernetes secret as data volumes in NetScaler Ingress Gateway.
To create a Kubernetes secret using an existing key named test_key.pem and a certificate named test.pem, use the following command:
kubectl create -n netscaler-system secret tls citrix-ingressgateway-certs --key test_key.pem --cert test.pem
Note: Ensure that Kubernetes secret is created in the same namespace where NetScaler Ingress Gateway is deployed.
To deploy NetScaler VPX or MPX with secret volume, do the following step:
kubectl create secret generic nslogin --from-literal=username=<netscaler-user> --from-literal=password=<netscaler-password> -n netscaler-system
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm install my-release netscaler/citrix-adc-istio-ingress-gateway --namespace netscaler-system --set ingressGateway.EULA=YES,secretName=nslogin,ingressGateway.netscalerUrl=https://<nsip>[:port],ingressGateway.vserverIP=<IPv4 Address>,ingressGateway.secretVolumes[0].name=test-ingressgateway-certs,ingressGateway.secretVolumes[0].secretName=test-ingressgateway-certs,ingressGateway.secretVolumes[0].mountPath=/etc/istio/test-ingressgateway-certs
To deploy NetScaler CPX with secret volume, do the following step:
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts/
helm install my-release netscaler/citrix-adc-istio-ingress-
Deploy citrix-adc-istio-ingress-gateway with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has citrix-adc-istio-ingress-gateway 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 chartcitrix-adc-istio-ingress-gateway is pinned at v1.14.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