Tanzu Kubernetes Grid lets you perform various management operations on your NSX Advanced Load Balancer (ALB) deployment.
In Tanzu Kubernetes Grid (TKG), the Avi Kubernetes Operator (AKO) component manages the Avi Controller certificate that clusters use to access NSX ALB.
The Avi Controller certificate periodically expires and must be rotated. After the Avi Controller certificate has been rotated in Avi itself, update the certificate in AKO so that clusters can continue accessing NSX ALB:
Patch the certificate secret with the new string:
kubectl patch secret/avi-controller-ca -n tkg-system-networking -p '{"data": {"certificateAuthorityData": "<base64 encoded string>"}}'
To update the Avi Controller credentials:
Re-encode the credentials into a base64-encoded string.
Patch the certificate secret with the new string:
kubectl edit secret avi-controller-credentials -n tkg-system-networking
Within your default text editor that pops up, update the credentials with the new base64 encoded credentials.
In Tanzu Kubernetes Grid, you can update the Avi Controller IP address or FQDN in an existing management cluster and its workload clusters.
Ensure that you have assigned a security certificate to the Avi Controller, as described in Assign a Certificate to the Controller. The Subject Alternative Name field in the certificate must have the new IP address or FQDN of the Avi Controller.
In the management cluster context, run the kubectl get pods
command, and note the name of the AKO Operator pod in the output. For example, ako-operator-controller-manager-7b74d8b9f9-nlz6n
.
In the Tanzu CLI, run the following command to add the new certificate:
kubectl edit secret avi-controller-ca -n tkg-system-networking
On the Controller UI, complete the following steps:
a. Go to Administration > Controller > Nodes, and click Edit.
b. In the Controller Cluster IP field, update the IP Address or the FQDN.
In the akodeploymentconfig
CR Object for the workload cluster, replace the value that corresponds to the controller
field with the new IP address or FQDN of the Avi Controller:
kubectl edit adc install-ako-for-all
In the akodeploymentconfig
CR Object in the management cluster, replace the value that corresponds to the controller
field with the new IP address or FQDN of the Avi Controller:
kubectl edit adc install-ako-for-management-cluster
Delete the AKO Operator pod:
kubectl delete pod AKO-OPERATOR-POD -n tkg-system-networking
Where AKO-OPERATOR-POD
is the name of the AKO Operator pod, for example, ako-operator-controller-manager-7b74d8b9f9-nlz6n
.
Delete the AKO pod:
kubectl delete pod ako-0 -n avi-system
The AKO and the AKO Operator pods restart, and the new IP address or the FQDN is updated on the management cluster and its workload clusters.
AKODeploymentConfig
CR Object for a ClusterTo know which AKODeploymentConfig
CR Object is used on the current cluster, run the following command:
kubectl --context={management cluster kubeconfig context} get cluster --show-labels
In the output, look at the networking.tkg.tanzu.vmware.com/avi=<AKODeploymentConfig-NAME>
field to view the AKODeploymentConfig object that has been selected by the cluster.
During the NSX Advanced Load Balancer configuration, Tanzu Kubernetes Grid validates the input that you specify for the configuration fields. Errors are logged when the system detects incorrect inputs. If the AVI_ENABLE
field is set to true
when deploying a management cluster, the Tanzu CLI performs a validation on the input that you specify for the following fields:
AVI_CONTROLLER
AVI_USERNAME
AVI_PASSWORD
AVI_CA_DATA_B64
AVI_CLOUD_NAME
AVI_SERVICE_ENGINE_GROUP
AVI_DATA_NETWORK
AVI_DATA_NETWORK_CIDR
AVI_MANAGEMENT_CLUSTER_SERVICE_ENGINE_GROUP
AVI_MANAGEMENT_CLUSTER_CONTROL_PLANE_VIP_NETWORK_NAME
AVI_MANAGEMENT_CLUSTER_VIP_NETWORK_NAME
AVI_CONTROL_PLANE_NETWORK
AVI_MANAGEMENT_CLUSTER_CONTROL_PLANE_VIP_NETWORK_CIDR
AVI_MANAGEMENT_CLUSTER_VIP_NETWORK_CIDR
AVI_CONTROL_PLANE_NETWORK_CIDR
When you create an AKODeploymentConfig
object, Tanzu Kubernetes Grid checks whether:
AKODeploymentConfig
object)spec.AdminCredentialRef
, spec.CertificateAuthorityRef
, and spec.Controller
fields have the correct input to connect to the Avi Controller.spec.CloudName
exists or it uses the AVI client that was initialized.spec.ServiceEngineGroup
exists or it uses the AVI client that was initialized.spec.ControlPlaneNetwork.Name
exists or it uses the AVI client that was initialized.spec.DataNetwork.Name
exists or it uses the AVI client that was initialized.spec.ControlPlaneNetwork.Name
has an IPAM profile configured or it does not use the AVI client that was initialized.spec.ControlPlaneNetwork.CIDR
has a valid format.spec.DataNetwork.CIDR
has a valid format.When you update an AKODeploymentConfig
object, Tanzu Kubernetes Grid checks whether spec.ClusterSelector
and spec.ControlPlaneNetwork
are unchanged. You cannot delete the install-ako-for-management-cluster
AKODeploymentConfig file.