Supervisor service pods fail to start after a Supervisor upgrade: "running pod … in an untrusted namespace on the control plane VM is not allowed"
search cancel

Supervisor service pods fail to start after a Supervisor upgrade: "running pod … in an untrusted namespace on the control plane VM is not allowed"

book

Article ID: 463194

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

After the Supervisor is upgraded, a Supervisor Service is failing to come up even though it was healthy in the previous Supervisor version.

The following symptoms are observed:

  • The supervisor service PackageInstall stays in Reconciling or reports Reconcile failed:

      kubectl get pkgi -n vmware-system-supervisor-services <packageinstall-name>

  • The supervisor service kapp App status is reporting a similar error:

       get kapp App status:

            kubectl get app -n vmware-system-supervisor-services <packageinstall-name> -o yaml

         Error: Deployment has encountered replica failure: FailedCreate, message: admission webhook "validate.cpvmpod.appplatform.vmware.com" denied the request: running pod <supervisor-service-namespace>/<pod-name> in an untrusted namespace on the control plane VM is not allowed

  • The supervisor service namespace is missing the managedBy and appplatform.vmware.com/serviceId labels:

      kubectl get ns <supervisor-service-namespace> --show-labels

Environment

  • Upgrading to VMware vSphere Supervisor 9.1.x
  • Supervisor Service installed on an earlier Supervisor release

Cause

The supervisor service namespace (<supervisor-service-namespace>) is missing the labels managedBy=vSphere-AppPlatform and appplatform.vmware.com/serviceId=<service-id>.

The admission webhook validate.cpvmpod.appplatform.vmware.com only lets a pod run on the Supervisor control plane VMs if its namespace carries both labels. Without them, the webhook treats the namespace as untrusted and rejects every new service pod. This happens whenever the pods are recreated, for example during a Supervisor upgrade or a service version upgrade.

Resolution

  1. SSH to the vCenter Server Appliance as root, and run the following to get a Supervisor control plane VM IP and its password: 

    /usr/lib/vmware-wcp/decryptK8Pwd.py


  2. SSH to the Supervisor control plane VM as root, and set the admin kubeconfig:

    export KUBECONFIG=/etc/kubernetes/admin.conf

  3. Find the supervisor service namespace:

    kubectl get ns | grep svc-<service-name>

  4. Confirm the service ID the PackageInstall uses:

    kubectl get pkgi -n vmware-system-supervisor-services <packageinstall-name> -o jsonpath='{.metadata.labels.appplatform\.vmware\.com/serviceId}{"\n"}'

  5. Add the missing labels to the namespace. Replace <supervisor-service-namespace> with the namespace from step 3, and <service-id> with the value from step 4:

    kubectl label ns <supervisor-service-namespace> managedBy=vSphere-AppPlatform appplatform.vmware.com/serviceId=<service-id>

  6. Verify that the supervisor service pods reach Running and the PackageInstall shows Reconcile succeeded. This can take several minutes:

    kubectl get pods -n <supervisor-service-namespace>
    kubectl get pkgi -n vmware-system-supervisor-services <packageinstall-name>