Install and Manage AKO using the AKO Operator
Overview
The AKO operator used to deploy, manage and remove an instance of the AKO Controller. This operator when deployed, creates an instance of the AKO Controller and installs all the relevant objects like:
- AKO stateful set
- Cluster role and Cluster role binding
- Configmap required for the AKO Controller and other artifacts.
This article explains how to:
- Install the AKO operator
- Deploy and manage the AKO controller using the AKO operator
Pre-requisites
For successfully running AKO, the following are the pre-requisites:
-
Ensure that the Avi Controller is of version 18.2.10/ 20.1.2 or higher.
-
Configure an Avi Controller with a vCenter cloud.
-
Ensure that a PG network is a part of the North-South IPAM configured in vCenter.
-
If your POD CIDRs are not route-able, the data path flow is as described below:
-
The client requests a specified hostname/path
-
The DNS virtual service returns an IP address corresponding to the hostname
-
The request is forwarded to the resolved IP address that corresponds to a virtual IP hosted on an Avi Service Engine. The destination IP in the packet is set as the POD IP address on which the application runs.
-
Service Engines use the static route information to reach the POD IP via the next-hop address of the host on which the pod is running.
-
The pod responds and the request is sent back to the client.
- Create a Service Engine Group dedicated to a Kubernetes cluster.
Note: If your POD CIDRs are route-able, then skip step 2. Ensure that you skip static route syncing in this case using the
disableStaticRouteSync
flag in thevalues.yaml
of your helm chart. -
-
Ensure Kubernetes is on version 1.16.
-
Ensure the Helm CLI is pointing to your Kubernetes cluster.
Note: AKO only supports Helm 3.0.0.
Install Using Helm
To install AKO Operator using Helm,
- Create the
avi-system
namespace:kubectl create ns avi-system
- Add this repository to your helm CLI:
helm repo add ako https://avinetworks.github.io/avi-helm-charts/charts/stable/ako
Use the
values.yaml
from this repository to edit values related to Avi configuration. The values and their corresponding index can be found here. - Search the available charts for AKO Operator:
helm search repo NAME CHART VERSION APP VERSION DESCRIPTION ako/ako-operator 1.3.1 1.3.1 A helm chart for AKO Operator
- Install AKO Operator:
helm install ako/ako-operator --generate-name --version 1.3.1 -f values.yaml --set ControllerSettings.controllerIP=<controller_ip> --set avicredentials.username=<avi-ctrl-username> --set avicredentials.password=<avi-ctrl-password> --namespace=avi-system
- Verify the installation:
helm list -n avi-system NAME NAMESPACE ako-operator-2889212993 avi-system
Note: Installing the AKO operator via helm will also add an AKOConfig
object which in turn, will prompt the AKO operator to deploy the AKO Controller.
To know more about the AKOConfig
object and how to manage the AKO Controller using this object, click here.
The list of CRDs added during the AKO operator installation:
- AKOConfig
- HostRule
- HTTPRule
Uninstall AKO Operator Using Helm
To uninstall the AKO operator and the AKO controller, use the following steps:
-
Remove the
aviconfig
object, this cleans up all the related artifacts for the AKO Controller.kubectl delete AKOConfig -n avi-system aviconfig
-
Remove the AKO operator’s resources
helm delete <ako-operator-release-name> -n avi-system
Note: The ako-operator-release-name
is obtained by running the Helm list as shown here.
-
Delete the
avi-system
namespace:kubectl delete ns avi-system
AKOConfig Custom Resource
The AKO Operator manages the AKO Controller. To deploy and manage the Controller, it takes in a custom resource object called AKOConfig
.
To view a sample configuration and understand the fields in the configuration, click here.
Deploying the AKO Controller
The AKO operator was installed using Helm, a default AKOConfig
object called ako-config
is already added and hence, this step is not required for Helm based installation.
Note: If the AKO operator was installed manually, then to install the AKO Controller, add an AKOConfig
object to the avi-system
namespace.
kubectl create -f ako-config.yaml -n avi-system
Managing the AKO Controller
To modify any property of the AKO Controller, change the AKOConfig
object and save the changes.
kubectl edit akoconfig -n avi-system ako-config
Note: If the AKO Controller’s configmap
/statefulset
is edited out-of-band, the changes will be overwritten by the AKO operator.
Removing the AKO Controller
To remove the AKO Controller, simply delete the AKOConfig
object:
kubectl delete akoconfig -n avi-system ako-config
Caveats with Existing AKO Installations
The AKO operator is not supported to work with the standalone deployments of AKO, via helm or otherwise (non-operator-based installations). The reason for being, that the AKO Operator completely manages the AKO Controller and the related artifacts. If users want to switch from a non-operator-based deployment of AKO to AKO operator:
- Uninstall the existing AKO.
- Install the AKO operator (follow this for helm based installation).
- Deploy and manage the AKO Controller (follow this for helm based installation) via the operator.
Document Revision History
Date | Change Summary |
---|---|
December 18, 2020 | Published the Install Guide for AKO Operator |