Loss of VKS Guest Cluster API access and "401 Unauthorized" errors on ako-controller-manager caused by Datastore capacity exhaustion
search cancel

Loss of VKS Guest Cluster API access and "401 Unauthorized" errors on ako-controller-manager caused by Datastore capacity exhaustion

book

Article ID: 439123

calendar_today

Updated On:

Products

Tanzu Kubernetes Runtime VMware vSphere ESXi

Issue/Introduction

While changing the StorageClass for Control Plane nodes for one of the VKS Guest Clusters, the following symptoms may occur:

  • Complete loss of kubectl API access to the guest clusters.
  • Guest cluster nodes become unpingable from the Supervisor cluster.
  • AVI UI: The Virtual Services for the guest cluster control plane (port 6443) show empty backend server pools.
  • The ako-controller-manager pod running on the Supervisor cluster reports the following error:

    kubectl logs vmware-system-ako-ako-controller-manager-##### -n vmware-system-ako 
    YYYY-MM-DDTHH:MM:SS    ERROR    cache/avi_ctrl_clients.go:72    AVI controller initialization failed
    YYYY-MM-DDTHH:MM:SS    FATAL    ako-main/main.go:243    Avi client not initialized
    YYYY-MM-DDTHH:MM:SS    1 avisession.go:383] response error: HTTP 401 Unauthorized: map[detail:Authentication credentials were not provided]

Environment

VMware vSphere Kubernetes Service

Cause

  • This issue is caused by the underlying vSphere datastore hosting the cluster nodes reaching 100% storage capacity, which triggers a cascading failure from the hypervisor level up to the Kubernetes ingress routing layer.
  • When a datastore fills up, ESXi automatically stuns the virtual machines to prevent guest operating system corruption. This instantly freezes the networking stacks of the VMs, making the nodes unpingable.
  • Because the storage is locked, the Kubernetes control plane is entirely unable to read, mount, or rotate the service account tokens required by the system pods.
  • As the cluster attempts to perform the node roll, the AKO pod tries to update the Avi Controller with the IPs of the new control plane nodes. However, due to the locked storage, AKO passes missing or invalid credentials to the Avi Controller.
  • The Avi Controller rejects the unauthorized update request (401 Unauthorized), resulting in empty backend server pools and a complete loss of API routing to the guest cluster.

Resolution

To resolve the issue, the underlying capacity on the vSphere datastore must be restored by performing one of the below steps: 

  • Expand the datastore capacity at the storage array level.
  • Perform a Storage vMotion to move other non-critical VMs to a different datastore.
  • Delete stale snapshots or unnecessary files occupying the datastore.