This message was deleted.
# cluster-api
a
This message was deleted.
m
From fleets code I see:
Copy code
secret, err := i.secrets.Get(kubeonfigSecretNamespace, cluster.Spec.KubeConfigSecret)
        if err != nil {
                return status, err
        }

        logrus.Debugf("Cluster import for '%s/%s'. Setting up agent with kubeconfig from secret '%s/%s'", cluster.Namespace, cluster.Name, kubeConfigSecretNamespace, cluster.Spec.KubeConfigSecret)
        var (
                cfg          = config.Get()
                apiServerURL = string(secret.Data[config.APIServerURLKey])
                apiServerCA  = secret.Data[config.APIServerCAKey]
        )

        if apiServerURL == "" {
                if len(cfg.APIServerURL) == 0 {
                        return status, fmt.Errorf("missing apiServerURL in fleet config for cluster auto registration")
                }
                logrus.Debugf("Cluster import for '%s/%s'. Using apiServerURL from fleet-controller config", cluster.Namespace, cluster.Name)
                apiServerURL = cfg.APIServerURL
        }

        if len(apiServerCA) == 0 {
                apiServerCA = cfg.APIServerCA
        }
It expects kubeConfigSecret to have config key, while CAPI creates key named
value
l
ApiServerURL needs to be the url of the Rancher cluster in this case. It should be populated automatically, fleet has a configMap, named
fleet-controller
somewhere, it should have the URL of the API server. Alternatively you can set the url in the
FleetAddonConfig
instance
m
Is rancher a hard requirement there? my case is a standalone cluster with fleet deployed
Thanks, I've got it sorted
l
It’s not required, purely fleet is needed, but the API server URL has to be available from the child clusters network
m
Cool, I see
Copy code
ApiError: metadata.managedFields must be nil
no longer in main. Any plans for new release any time soon?
👀 1
l
--> #C013SSBKB6U
l
Hi @mammoth-postman-10874, a new release should be out now
m
🚀
😅 1