Deriving GslbService FQDNs

Overview

AMKO decides the fully qualified domain name (FQDN) for the GSLB services based on two modes.

  • Default Mode
  • Custom Global FQDN Mode

This articles explains the two modes in detail, and describes how and when to use each mode.

Default Mode

In this mode, the hostname(s) field in the status of the Ingress/Route/Service of type Loadbalancer object is used to determine the hostname of the GSLB Service. Each hostname uniquely maps to a GS FQDN automatically. For common hostname across clusters, a single GSLB Service is created with pool members from each cluster that share the hostname.

When to Use the Default Mode

When you have two instances of an application deployed on two different clusters which have the same FQDNs, and you want to expose all these application as GslbServices in one shot, use the Default Mode.

Custom Global FQDN Mode

In this mode, AMKO checks the AKO HostRules to figure out the GslbService FQDN. To expose an application via GSLB, the user must provide a mapping between the local FQDN and the global FQDN via AKO’s HostRule object. If the user wishes to map two application instances (which have different FQDNs) in two different clusters, they have to create HostRules in both clusters specifying the mapping.

Local vs Global

Specifying the Custom Global FQDN Mode

Set the useCustomGlobalFqdn field to True in the GSLBConfig object. This is a static operation and if changed while AMKO is already deployed, the changes won’t take any effect. If useCustomGlobalFqdn was previously set to False and then changed to True, and if AMKO is rebooted, the pre-created GslbServices in Avi will be deleted.

Local

When to Use the Custom Global FQDN Mode

If you have site local FQDNs and you want to use DNS load balancing for these application instances, a common GSLB FQDN can be used.
Here, the common GSLB FQDN maps the VIPs of the site local FQDN as pool members.

Global

The number of GSLB services can be reduced by grouping related (FQDN and its aliases) together into one GSLB Service.

The field useCustomGlobalFqdn is set to True when AMKO is required to create GSLB Services only when global to local FQDN mapping is given.

A new field called includeAliases is introduced in the HostRule CRD.

A sample configuration of includeAliases is as shown below:


  virtualhost:
    aliases:
    - alias1.greenapp.avi.internal
    - alias2.greenapp.avi.internal
    fqdn: green-secure-app.avi.internal    #local-fqdn
    fqdnType: Exact
    gslb:
      fqdn: global-greenapp.avi.internal   #global-fqdn
      includeAliases: false                 #defaultValue: false
 

By default, includeAliases is set to false. In this case, AMKO will create a GSLB Service with name equal global-fqdn. Aliases provided in the hostrule will be ignored.

On setting includeAliases to True, AMKO creates a GSLB Service with name equal global-fqdn. All the aliases mentioned in the hostrule will be added as Application Names in the GSLB Service.

Global

When useCustomGlobalFqdn is set to False, AMKO creates a GSLB Service with name equal to the local-fqdn/hostname of the kubernetes object. All the aliases mentioned in the hostrule will be added as Application Names in the GSLB Service.

Global

Note:
Currently when using local to global FQDN mapping (useCustomGlobalFqdn: true), AMKO creates a GSLB service for ingress/route/service only if there is a HostRule with local to global FQDN mapping.