NetScaler ingress controller

Add DNS records using NetScaler Ingress Controller

A DNS address record is a mapping of the domain name to the IP address. When you want to use NetScaler as a DNS resolver, you can add the DNS records on NetScaler using NetScaler Ingress Controller.

For more information on creating DNS records on NetScaler, see the NetScaler documentation.

Adding DNS records for Ingress resources

You need to enable the following environment variable during the NetScaler Ingress Controller deployment to add DNS records for an Ingress resource.

NS_CONFIG_DNS_REC: This variable is configured at the boot time and cannot be changed at runtime. Possible values are true or false. The default value is false and you need to set it as true to enable the DNS server configuration. When you set the value as true, an address record is created on NetScaler.

Adding DNS records for services of type LoadBalancer

You need to perform the following tasks to add DNS records for services of type LoadBalancer:

  • Enable the NS_SVC_LB_DNS_REC environment variable by setting the value as True for adding DNS records for a service of type LoadBalancer.
  • Specify the DNS host name using the service.citrix.com/dns-hostname annotation.

When you create a service of type LoadBalancer with the service.citrix.com/dns-hostname annotation, NetScaler Ingress Controller adds the DNS record on NetScaler. The DNS record is configured using the domain name specified in the annotation and the external IP address assigned to the service.

When you delete a service of type LoadBalancer with the service.citrix.com/dns-hostname annotation, NetScaler Ingress Controller removes the DNS records from the NetScaler. NetScaler Ingress Controller also removes the stale entries of DNS records during boot up if the service is not available.

The following example shows a sample service of type LoadBalancer with the annotation configuration to add DNS records to NetScaler:

apiVersion: v1
kind: Service
metadata:
  name: guestbook
  annotations:
      service.citrix.com/dns-hostname: "guestbook.com"
spec:
  loadBalancerIP: "192.2.212.16"
  type: LoadBalancer
  ports:
  - port: 9006
    targetPort: 80
    protocol: TCP
  selector:
    app: guestbook
<!--NeedCopy-->
Add DNS records using NetScaler Ingress Controller