Stuck at "Waiting for API to be available"

I am trying to import an existing Kubernetes cluster (which was set up by using this installation instructions).

Basic overview:

  • CentOS 8
  • Kubernetes 1.22
  • CRI-O 1.22
  • Rancher 2.5.11

Unfortunately, Rancher is stuck with the message “Waiting for API to be available”. By taking a closer look at the API configuration (which, I presume, was created from information reported back by the cattle cluster agent), I kind of understand why. The API endpoint is set to “”. This is the internal IP of the “kubernetes” service, so of course the Rancher server can’t connect to that.

$ kubectl get service --all-namespaces
NAMESPACE          NAME                              TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE
calico-apiserver   calico-api                        ClusterIP    <none>        443/TCP                  112m
calico-system      calico-kube-controllers-metrics   ClusterIP      <none>        9094/TCP                 114m
calico-system      calico-typha                      ClusterIP   <none>        5473/TCP                 115m
default            kubernetes                        ClusterIP        <none>        443/TCP                  59d
kube-system        kube-dns                          ClusterIP       <none>        53/UDP,53/TCP,9153/TCP   59d

What I don’t understand is, why that IP was reported back to Rancher as API endpoint. Shouldn’t this be the same address, which is reported by the kubectl config view command and which is the actual physical IP adress of my kubernetes CTL node?

$ kubectl config view
apiVersion: v1
- cluster:
    certificate-authority-data: DATA+OMITTED
  name: kubernetes
$ kubectl cluster-info
Kubernetes control plane is running at
CoreDNS is running at
$ ifconfig
ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast

What am I missing? How can successfully “connect” my Kubernetes cluster with Rancher?

We saw this with k8s 1.21. Dropped back to k8s 1.20 and that resolved “Waiting for API to be available”

Found this in the Rancher release notes:
Importing a Kubernetes v1.21 cluster might not work properly. We are planning to add support for Kubernetes v1.21 in the future.