The vmware-system-vmop-controller-manager (vmop) pods enter a CrashLoopBackOff state. Running kubectl describe on the affected vMop pod displays the last state as Terminated with Reason: OOMKilled.
kubectl describe pod vmware-system-vmop-controller-manager-######-#### -n vmware-system-vmopName: vmware-system-vmop-controller-manager-######-#####Namespace: vmware-system-vmopPriority: 0Service Account: defaultNode: <Node_ID>/##.##.##.98Start Time: <Date><Time>Labels: control-plane=controller-manager controller-tools.k8s.io=1.0 name=vmoperator-controller-manager pod-template-hash=########Annotations: prometheus.io/port: 9848 prometheus.io/scheme: https prometheus.io/scrape: trueStatus: RunningIP: ##.##.##.98IPs: IP: ##.##.##.98Controlled By: ReplicaSet/vmware-system-vmop-controller-manager-##########Containers: manager: Container ID: containerd://######################################################### Image: localhost:5000/vmware/vmop:0.1.0-8ceb511-1.8.6-010e27a-24571392 Image ID: localhost:5000/vmware/vmop@sha256:#################################### Ports: 9878/TCP, 9445/TCP Host Ports: 9878/TCP, 9445/TCP Command: /manager Args: --metrics-addr=127.0.0.1:8083 State: Running Started: <Date><Time> Last State: Terminated Reason: OOMKilled Exit Code: 137 Started: <Date><Time> Finished: <Date><Time> Ready: True Restart Count: 4 Limits: cpu: 750m memory: 550Mi Requests: cpu: 100m memory: 75Mi
VMware vSphere Kubernetes Service
This issue occurs when manually associating the Kubernetes Service Content Library with individual vSphere Namespaces via the "VM Service" card, while the same library already exists configured at the Supervisor Cluster level.
When a Content Library associates directly with a namespace, the VM Operator (vMop) attempts to create VirtualMachineImage (VMI) Custom Resources for every image in that library within every namespace. The accumulation of metadata from these redundant Custom Resources across numerous namespaces exceeds the memory limits of the vmware-system-vmop-controller-manager pod, resulting in an OOMKilled (Out of Memory) crash.
Notes:
ClusterContentLibrary set at the Supervisor level will automatically propagate to all namespaces.Validation
kubectl get contentlibraries -A
NAMESPACE NAME VSPHERENAME VSPHERENAME TYPE WRITABLE ALLOWIMPORT STORAGETYPE AGEnamespace-01 cl-[library-id] Kubernetes Service Content Library Subscribed false false Datastore 25hnamespace-02 cl-[library-id] Kubernetes Service Content Library Subscribed false false Datastore 369dnamespace-03 cl-[library-id] Kubernetes Service Content Library Subscribed false false Datastore 370d
namespace-09 cl-[library-id] Kubernetes Service Content Library Subscribed false false Datastore 17dnamespace-10 cl-[library-id] Kubernetes Service Content Library Subscribed false false Datastore 17dnamespace-11 cl-[library-id] Kubernetes Service Content Library Subscribed false false Datastore 62dnamespace-12 cl-[library-id] Kubernetes Service Content Library Subscribed false false Datastore 152dnamespace-13 cl-[library-id] Kubernetes Service Content Library Subscribed false false Datastore 152d
cl-[library-id] library typically appears associated with multiple namespaces (namespace-01 to namespace-13). Because each namespace associates a ContentLibrary to it, this results in several virtualMachineImages (vmi) being created in each namespace.OOMKilled.kubectl get vmi -A | wc -l
3000
Workload Management > Namespace > VM Service) to confirm if the "Kubernetes Service Content Library" associates manually with each namespace.Remove the redundant Content Library associations from the individual vSphere Namespaces. The Supervisor-level library continues to provide the necessary images.
Notes:
Confirm that the VirtualMachineImages (vmi) used to create the VKS cluster VirtualMachine (VM) exist on clustercontentlibraries (ccl). If not, the cluster nodes recreate.
VirtualMachine (VM) in the namespace.kubectl get vm -n <namespace> -o custom-columns="NAMESPACE:.metadata.namespace,VM_NAME:.metadata.name,IMAGE_NAME:.spec.imageName"
Example:
kubectl get vm -n cluster-ns -o custom-columns="NAMESPACE:.metadata.namespace,VM_NAME:.metadata.name,IMAGE_NAME:.spec.imageName"
NAMESPACE VM_NAME IMAGE_NAME<namespace> cluster-node-pool-######## vmi-Id<namespace> cluster-#####-#### vmi-Id
VirtualMachineImages (vmi) ID retrieved from step 1 exists as clustervirtualmachineimages (cvmi).kubectl get cvmi <vmi-Id>
Example:kubectl get cvmi vmi-Id
NAME DISPLAY NAME IMAGE VERSION OS NAME OS VERSION HARDWARE VERSIONvmi-Id ob-########-photon-5-amd64-vmi-k8s-v1.30.1---vmware.1-fips-tkg.5 v1.30.1+vmware.1-fips-tkg.5 vmwarePhoton64Guest 17
kubectl get vmi vmi-Id -n <namespace>
NAME DISPLAY NAME IMAGE VERSION OS NAME OS VERSION HARDWARE VERSION CAPABILITIESvmi-Id ob-########-photon-5-amd64-vmi-k8s-v1.30.1---vmware.1-fips-tkg.5 v1.30.1+vmware.1-fips-tkg.5 vmwarePhoton64Guest 17
Confirm that the Content Library name associated with the "VM Service" card for each VKS Cluster Namespace matches the ClusterContentLibrary.
To check the ClusterContentLibrary: Log in to vCenter Server > Workload Management > Supervisors > Click the Supervisor Cluster Name > Configure > General > Kubernetes Service > Content Library.
To check the Content Library name on the Namespaces "VM Service" card: From the vSphere Client home menu, select Workload Management > Click the Namespaces tab > Select the namespace > Summary > Click Manage Content Libraries.
Remove the content library from the Namespaces under the "VM service" card.
From the vSphere Client home menu, select Workload Management > Click the Namespaces tab > Select the namespace > Summary > Click Manage Content Libraries.
Uncheck the box corresponding to the Content Library Name (e.g., Kubernetes Service Content Library) and click OK to save changes.
Confirm that the vmware-system-vmop-controller-manager (vmop) pods operate in a running state. The VirtualMachineImages (vmi) objects under the Namespaces fail to remove if the vMop pods are not running.
CrashLoopBackOff status with an OOMKilled error after increasing the vmop container memory, it indicates the number of VirtualMachineImages (vmi) under all Namespaces remains extremely high. Perform the following to resolve:VirtualMachineImages (vmi) objects under the Namespaces disconnected from the Content Library:kubectl delete vmi --all -n <cluster-namespaces>
VirtualMachineImages (vmi) lowers, the vmop pods enter a running state and handle the deletion of the remaining VirtualMachineImages (vmi) objects.VirtualMachineImages (vmi) objects exist under the cluster namespace:kubectl get vmi -n <cluster-namespace>Example:kubectl get vmi -n <namespace>No resources found in <namespace> namespace.kubeadmcontrolplane and machinedeployment objects:kubectl get kcp,md -n <cluster-namespace>For additional technical context, review the following knowledge base articles: