smartxworks / virtink

Lightweight Virtualization Add-on for Kubernetes
Apache License 2.0
503 stars 42 forks source link

Does not work in a KinD cluster #72

Closed ManasPecenek closed 1 year ago

ManasPecenek commented 1 year ago

Even though the VM I used to install the KinD cluster satisfies the conditions, it does not work. When I run "kubectl get vm" I can see it running, and also the relevant pod is running too. However, I cannot ssh into the virtink VM. For the record, I successfully created a VM inside a KinD cluster via KubeVirt. I wonder what the difference is and what actually causes it.

fengye87 commented 1 year ago

@ManasPecenek Could you share your VM yaml and the rootfs Dockerfile if any? And where were you trying to SSH from? Outside the KinD cluster or inside?

ManasPecenek commented 1 year ago

@fengye87 My vm yaml is the one in the documentation. And I am trying to ssh like mentioned here, creating a pod, installing OpenSSH and then sshing into the VM. But doesn't work, I even cannot ping the vm inside that pod

fengye87 commented 1 year ago

@ManasPecenek I guess you are using KinD's default CNI? This CNI was known not to work with Virtink's bridge network. Virtink should work in KinD with CNIs like Calico.

ManasPecenek commented 1 year ago

@fengye87 Thanks for the reminder. I will try with calico this time

ManasPecenek commented 1 year ago

@fengye87 It worked with Calico. Huge thanks

ManasPecenek commented 1 year ago

Solved by using Calico instead of KinD's default CNI

networking:
  disableDefaultCNI: true # disable kindnet
  podSubnet: 192.168.0.0/16 # set to Calico's default subnet

and then

kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/calico.yaml