Multiple AKO instances can be deployed in a cluster to create namespace based isolation. This will allow AKO to operate over a group of Kubernetes namespaces, in order to handle objects from these namespaces only.
To run multiple AKO, the following features are used:
Namespace Sync Feature
AKO installation in User Provided Namespace
Configuring Multiple AKO Instances
Primary AKO installation
Non-Primary AKO Installation
Avi Object Name Convention
Namespace Sync Feature
The namespace sync feature allows Kubernetes/OpenShift objects from specific namespaces to be synced with AKO based NSX Advanced Load Balancer Controller. For that, namespace has to be labelled with same key:value pair as the labelKey and labelValue mentioned in values.yaml file. For more information on namespace sync feature, see Namespace Sync in AKO.
AKO installation in User Provided Namespace
While installing AKO, using helm, flag -n
or --namespace
can be used to specify namespace in which AKO has to be installed. If this flag is not specified, AKO will be installed in the avi-system namespace.
Configuring Multiple AKO Instances
In multiple AKO deployment, one AKO instance works as primary AKO instance. This AKO instance is responsible for VRF, static route configuration apart from syncing up Kubernetes/OpenShift objects from set of namespaces.
The flag primaryInstance present in values.yaml denotes whether AKO instance is primary or not. This flag takes boolean true
/false
value. True
indicates AKO instance is primary.
In multiple AKO deployment, only one AKO instance must be primary.
Each AKO must be deployed in a different namespace.
Primary AKO installation
In the following example, primary AKO instance is running in avi-system namespace with namespace sync filter app: migrate. So this AKO will sync up Kubernetes/OpenShift objects from namespaces who has labels app: migrate
.
helm install ako/ako --generate-name --version 1.10.1 -f /path/to/values.yaml --set ControllerSettings.controllerHost=<controller IP or Hostname> --set avicredentials.username=<avi-ctrl-username> --set avicredentials.password=<avi-ctrl-password> --set AKOSettings.namespaceSelector.labelKey="app" --set AKOSettings.namespaceSelector.labelValue="migrate" --set AKOSettings.primaryInstance=true --namespace=avi-system
The helm install command without primaryInstance parameter will deploy primary AKO instance.
Non-Primary AKO Installation
In the following example, non-primary AKO instance is running in blue namespace with namespace sync filter key: value2
. So this AKO will sync up Kubernetes/OpenShift objects from namespaces who has labels key: value2
.
helm install ako/ako --generate-name --version 1.10.1 -f /path/to/values.yaml --set ControllerSettings.controllerHost=<controller IP or Hostname> --set avicredentials.username=<avi-ctrl-username> --set avicredentials.password=<avi-ctrl-password> --set AKOSettings.namespaceSelector.labelKey="key" --set AKOSettings.namespaceSelector.labelValue="value2" --set AKOSettings.primaryInstance=false --namespace=blue
Few things that to be considered in multiple AKO instances deployment:
All AKO instances must interact with same NSX Advanced Load Balancer Controller
Each Kubernetes/OpenShift namespace must be handled by one AKO only
All AKO must be deployed either in ClusterIP or NodePort or NodePortLocal mode
Avi Object Name Convention
For non-primary AKO instance, naming convention for shared VS is: Shared-VS-Name = <cluster-name>–<AKO-namespace>-Shared-L7-<Shard number>. Here <AKO-namespace> is namespace in which AKO pod is deployed.
Non-primary AKO instance will create objects with
username
= ako-<cluster-name>-<AKO-namespace>