VKS Nodes Stuck in NotReady During Upgrade Due to PolicyViolation
search cancel

VKS Nodes Stuck in NotReady During Upgrade Due to PolicyViolation

book

Article ID: 436722

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

During a VKS Cluster upgrade or update, the process stalls or becomes unresponsive. Affected clusters typically exhibit the following behaviors:

  • VKS Guest Cluster upgrades or updates become unresponsive or stall.
  • Control plane nodes remain in a NotReady state indefinitely.
  • Executing kubectl get pods -A shows critical system components and Container Network Interface (CNI) pods (for example, antrea, antrea-preupgrade, and kapp-controller) in a failure loop, displaying a status of ImagePullBackOff or CrashLoopBackOff.
  • Third-party admission controllers intercept pod creation requests and prevent the pull of necessary system images. Executing kubectl describe pod <failing_pod_name> -n <namespace_name> displays PolicyViolation warnings or timeout errors in the events log.

  Type     Reason            Age                       From               Message
  ----     ------            ----                      ----               -------
  Warning  PolicyViolation   17m                       kyverno-scan       policy restrict-image-registries/validate-registries fail: [example_rule_1] Unmanaged image registry is not allowed. Allowed registries: case.artifacts.example.com/, registry.example.gitlab-dedicated.com/, example.jfrog.io/, example2.jfrog.io/, md-example.jfrog.io/, en-example.jfrog.io/, en1-example.jfrog.io/, en3-example.jfrog.io/, mdt-example.jfrog.io/, example.pe.jfrog.io/, example2.pe.jfrog.io/

Cause

A circular dependency between fail-closed third-party admission webhooks (such as Kyverno or Gatekeeper) and the Container Network Interface (CNI) prevents the update.

The API server cannot reach the webhooks to validate pod creation because the CNI network is uninitialized on the new nodes. The fail-closed webhook policy (failurePolicy: Fail) automatically rejects the CNI pod deployment due to the network timeout, which stalls the node rollout.

Resolution

To resolve this issue, engage the third-party admission controller vendor or the internal security policy administrator to modify the restrictive policies.

  1. Identify the third-party admission controller (such as Kyverno or OPA Gatekeeper) responsible for the PolicyViolation errors in the cluster.
  2. Contact the third-party vendor or the internal security team for support.
  3. Request an update to the webhook configuration or cluster policy to exclude VMware system namespaces from the image registry restrictions.
  4. Verify that the CNI pods successfully pull the required images and transition to a Running state.

Note: Once the CNI initializes, the webhook controllers become reachable, and the cluster update automatically proceeds.

Additional Information

Alternative Remediation

If modifying the policy is not immediately possible, follow KB 387563 to temporarily remove or scale down the conflicting third-party webhook configurations to allow the CNI to initialize and the upgrade to complete.