NetScaler ingress controller

Configure static route on NetScaler VPX or MPX

In a Kubernetes cluster, pods run on an overlay network such as Flannel, Calico, or Weave. The pods in the cluster are assigned an IP address from the overlay network, which is different from the host network.

NetScaler MPX or NetScaler VPX outside the Kubernetes cluster receives all the ingress traffic to the microservices deployed in the Kubernetes cluster. You need to establish network connectivity between NetScaler instance and the pods for the ingress traffic to reach the microservices.

One of the ways to achieve network connectivity between pods and NetScaler MPX or NetScaler VPX instance outside the Kubernetes cluster is to configure routes on NetScaler instance to the overlay network. You can either do this manually or NetScaler Ingress Controller provides an option to automatically configure the network.

Note

Ensure that NetScaler MPX or NetScaler VPX has SNIP configured on the host network. The host network is the network on which the Kubernetes nodes communicate with each other.

Manually configure a route on NetScaler

  1. On the master node in the Kubernetes cluster, get the podCIDR using the following command:

    kubectl get nodes -o jsonpath="{range .items[*]}{'podNetwork: '}{.spec.podCIDR}{'\t'}{'gateway: '}{.status.addresses[0].address}{'\n'}{end}"

      podNetwork: 10.244.0.0/24    gateway: 10.106.162.108
      podNetwork: 10.244.2.0/24    gateway: 10.106.162.109
      podNetwork: 10.244.1.0/24    gateway: 10.106.162.106
    

    If you are using Calico CNI, use the following command to get the podCIDR:

    kubectl get nodes -o jsonpath="{range .items[*]}{'podNetwork: '}{.metadata.annotations.projectcalico\.org/IPv4IPIPTunnelAddr}{'\tgateway: '}{.metadata.annotations.projectcalico\.org/IPv4Address}{'\n'}"

      podNetwork: 192.168.109.0/24      gateway: 10.106.162.108
      podNetwork: 192.168.174.0/24      gateway: 10.106.162.109
      podNetwork: 192.168.76.128/24     gateway: 10.106.162.106
    
  2. Log on to NetScaler instance.

  3. Add a route on NetScaler using the podCIDR information. Use the following command:

    add route <pod_network> <podCIDR_netmask> <gateway>

    Examples:

    add route 192.244.0.0 255.255.255.0 192.106.162.108

    add route 192.244.2.0 255.255.255.0 192.106.162.109

    add route 192.244.1.0 255.255.255.0 192.106.162.106

Automatically configure a route on NetScaler

In the NSIC deployment, you can use the parameter nodeWatch to automatically configure a route on the associated NetScaler instance.

Specify the value of nodeWatch as true to enable automatic route configuration. For example:

helm install my-release netscaler/netscaler-ingress-controller --set nsIP=<NSIP>,license.accept=yes,adcCredentialSecret=<Secret-for-NetScaler-credentials>,nodeWatch=true
<!--NeedCopy-->

Note:

By default, the nodeWatch argument is set to false; set the argument to true to enable the automatic route configuration.

Configure static route on NetScaler VPX or MPX