rancher-sandbox / cluster-api-provider-harvester

A Cluster API Infrastructure Provider for Harvester
Apache License 2.0
21 stars 6 forks source link

Bug: Harvester-Cloud Provider - failed to get instance metadata #40

Closed PatrickLaabs closed 2 months ago

PatrickLaabs commented 2 months ago

What happened: When deploying a 3-ControlPlane & 2 Worker Node Cluster on Harvester the harverster-cloud-provider in Version (v0.2.0) reports following errors:

I0609 10:04:39.804475       1 node_controller.go:415] Initializing node test-rk-workers-qrm4l-j6hkz with cloud provider

E0609 10:04:39.805118       1 node_controller.go:229] error syncing 'test-rk-workers-qrm4l-j6hkz': failed to get instance metadata for node test-rk-workers-qrm4l-j6hkz: an empty namespace
 may not be set when a resource name is provided, requeuing

W0609 10:05:10.554930       1 reflector.go:347] github.com/rancher/lasso/pkg/cache/cache.go:145: watch of *v1.VirtualMachineInstance ended with: an error on the server ("unable to decode
an event from the watch stream: stream error: stream ID 261; INTERNAL_ERROR; received from peer") has prevented the request from succeeding

What did you expect to happen:

How to reproduce it:

Anything else you would like to add:

I also checked the provided kubeconfig 'cloud-config' for the harvester cloud provider. This one is correct and may not be the cause of this issue.

Environment:

PatrickLaabs commented 2 months ago

I upgraded the harvester-cloud-provider to version v0.2.1, rke2 control & bootstrap to v0.2.7, my Harvester Cluster to version 1.2.2 and tried different versions of the rke2-image - nothing helped on that 😞

PatrickLaabs commented 2 months ago

I upgraded now to Harvester v1.3.0. The error still persists, and - I guess - that my Harvester Instance may not the root of this issue. But maybe I am missing something on my Harvester configuration?

/help

PatrickLaabs commented 2 months ago

Ok, i have found the issue..

My Kubeconfig of my Harvester Cluster (which we encode as base64, while the init process) was missing the namespace. I manually edited the kubeconfig and added the namespace to it, and re-applied the cloud-config secret with the new kubeconfig, and restartet the harvester-cloud-provider pods.

Now my containers are being created.

I wonder why I was missing the namespace in the kubeconfig, but well.. I will figure it out 👍