hyperconverged-cluster-operator: HCO Deployment via OLM not completed due to SSP Operator CrashLoopBackOff: no matches for kind "VirtualMachine" in version "kubevirt.io/v1"

What happened: I am deploying HCO v1.10.1 via OLM: https://operatorhub.io/operator/community-kubevirt-hyperconverged. HCO Deployment via OLM on kubernetes (k3s) is failing due to SSP Operator CrashLoopBackOff with error message: no matches for kind “VirtualMachine” in version “kubevirt.io/v1”

$ kubectl logs -n operators ssp-operator-7d8b9b4c9f-rl97h
...
{"level":"error","ts":"2024-06-24T12:44:08Z","logger":"controller-runtime.source","msg":"if kind is a CRD, it should be installed before calling Start","kind":"VirtualMachine.kubevirt.io","error":"no matches for kind \"VirtualMachine\" in version \"kubevirt.io/v1\"","stacktrace":"sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start.func1.1\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/source/source.go:143\nk8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext\n\t/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:154\nk8s.io/apimachinery/pkg/util/wait.waitForWithContext\n\t/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:207\nk8s.io/apimachinery/pkg/util/wait.poll\n\t/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/poll.go:260\nk8s.io/apimachinery/pkg/util/wait.PollImmediateUntilWithContext\n\t/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/poll.go:200\nsigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start.func1\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/source/source.go:136"}
{"level":"error","ts":"2024-06-24T12:44:18Z","msg":"Could not wait for Cache to sync","controller":"vm-controller","controllerGroup":"kubevirt.io","controllerKind":"VirtualMachine","error":"failed to wait for vm-controller caches to sync: timed out waiting for cache to be synced","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.1\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:216\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:242\nsigs.k8s.io/controller-runtime/pkg/manager.(*runnableGroup).reconcile.func1\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/manager/runnable_group.go:219"}
{"level":"info","ts":"2024-06-24T12:44:18Z","msg":"Stopping and waiting for non leader election runnables"}
{"level":"info","ts":"2024-06-24T12:44:18Z","logger":"setup","msg":"shutting down Prometheus metrics server"}
{"level":"info","ts":"2024-06-24T12:44:18Z","msg":"Stopping and waiting for leader election runnables"}
{"level":"info","ts":"2024-06-24T12:44:18Z","msg":"Shutdown signal received, waiting for all workers to finish","controller":"service-controller","controllerGroup":"","controllerKind":"Service"}
{"level":"info","ts":"2024-06-24T12:44:18Z","msg":"Shutdown signal received, waiting for all workers to finish","controller":"ssp","controllerGroup":"ssp.kubevirt.io","controllerKind":"SSP"}
{"level":"info","ts":"2024-06-24T12:44:18Z","msg":"All workers finished","controller":"ssp","controllerGroup":"ssp.kubevirt.io","controllerKind":"SSP"}
{"level":"info","ts":"2024-06-24T12:44:18Z","msg":"All workers finished","controller":"service-controller","controllerGroup":"","controllerKind":"Service"}
{"level":"info","ts":"2024-06-24T12:44:18Z","msg":"Stopping and waiting for caches"}
{"level":"info","ts":"2024-06-24T12:44:18Z","msg":"Stopping and waiting for webhooks"}
{"level":"info","ts":"2024-06-24T12:44:18Z","logger":"controller-runtime.webhook","msg":"shutting down webhook server"}
{"level":"info","ts":"2024-06-24T12:44:18Z","msg":"Wait completed, proceeding to shutdown the manager"}
{"level":"error","ts":"2024-06-24T12:44:18Z","msg":"problem running manager","error":"failed to wait for vm-controller caches to sync: timed out waiting for cache to be synced","stacktrace":"kubevirt.io/ssp-operator/controllers.CreateAndStartReconciler\n\t/workspace/controllers/setup.go:42\nmain.main\n\t/workspace/main.go:273\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}
{"level":"error","ts":"2024-06-24T12:44:18Z","logger":"setup","msg":"unable to create or start controller","controller":"SSP","error":"failed to wait for vm-controller caches to sync: timed out waiting for cache to be synced","stacktrace":"main.main\n\t/workspace/main.go:274\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}

I see some other related issues: #2129 https://github.com/kubevirt/ssp-operator/pull/437

What you expected to happen: Successfully deploy HCO via OLM on plain kubernetes (k3s)

How to reproduce it (as minimally and precisely as possible): Install the OLM:

curl -sfL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.28.0/install.sh -o install.sh
chmod +x install.sh
./install.sh v0.28.0

$ kubectl get pod -n olm
NAME                                                              READY   STATUS      RESTARTS   AGE
9d43648572067970b101a79436994f36a334198b0f0b32f4ae11551bd44z9pz   0/1     Completed   0          54m
catalog-operator-6fbb6bd9bb-b6qcb                                 1/1     Running     0          62m
olm-operator-574697c48b-gg8z9                                     1/1     Running     0          62m
operatorhubio-catalog-tbfsd                                       1/1     Running     0          59m
packageserver-866b46c5c7-9gsxm                                    1/1     Running     0          59m
packageserver-866b46c5c7-nz8g6                                    1/1     Running     0          59m

Deploy kubevirt-hyperconverged:

curl -sfL https://operatorhub.io/install/community-kubevirt-hyperconverged.yaml -o community-kubevirt-hyperconverged.yaml
vim community-kubevirt-hyperconverged.yaml # just edit the name
kubectl create -f community-kubevirt-hyperconverged.yaml

file community-kubevirt-hyperconverged.yaml (just edit the name):

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: kubevirt-hyperconverged
  namespace: operators
spec:
  channel: stable
  name: community-kubevirt-hyperconverged
  source: operatorhubio-catalog
  sourceNamespace: olm
$ kubectl get pod -n operators
NAME                                                  READY   STATUS             RESTARTS      AGE
cdi-operator-7d9ff47dcc-t9ms6                         1/1     Running            0             38m
cluster-network-addons-operator-5b54878c48-mr89l      2/2     Running            0             37m
hco-operator-7fd5bd9fcb-lgbxz                         1/1     Running            0             45m
hco-webhook-6c4f88557f-rgqdc                          1/1     Running            0             45m
hostpath-provisioner-operator-54dcb9dd45-8x5q9        1/1     Running            0             38m
hyperconverged-cluster-cli-download-5dfbc88f5-7jbdt   1/1     Running            0             18m
mtq-operator-56d644c994-nrgx4                         1/1     Running            0             18m
ssp-operator-7d8b9b4c9f-rl97h                         1/1     CrashLoopBackOff   2 (26s ago)   6m40s
virt-operator-768f87488d-m45hh                        1/1     Running            0             38m
virt-operator-768f87488d-wq4z8                        1/1     Running            0             38m

Additional context: I have successfully deployed and testing manual deployment of KubeVirt & CDI Operator (Not HCO) on the same kubernetes k3s cluster & architecture. The Kubernetes k3s cluster already re-deployed (to make sure it’s clean without previous kubevirt resources/crds)

Environment:

  • KubeVirt version (use virtctl version): N/A (kubevirt-hyperconverged-operator v1.10.1)
  • Kubernetes version (use kubectl version): v1.28.9+k3s1
  • VM or VMI specifications: N/A
  • Cloud provider or hardware configuration: KVM with Nested Virtualization
  • OS (e.g. from /etc/os-release): Ubuntu 22.04.4 LTS (Jammy Jellyfish)
  • Kernel (e.g. uname -a): Linux 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools: via OLM (OperatorHub.io)
  • Others: CNI: Calico with Multus, Ingress: nginx, Storage: ceph-csi-rbd & ceph-csi-cephfs

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (3 by maintainers)

Most upvoted comments

Do you mean the CR for the HyperConverged, like on this example hco.cr.yaml

Yes, please. The Kubevirt operator will create the VirtualMachine CRD only at that step and that specific version of the SSP operator is going to crash until the the VirtualMachine CRD is there.

@kgfathur is this still happening once you create the CR for the HCO operator?