rancher: [BUG] Rancher managed RKE2 clusters stuck in "Waiting for probes: kube-controller-manager, kube-scheduler"

As the issue occurs on quite every cluster we own, I try to sum up version information for all of them :

Rancher Server Setup

  • Rancher version: 2.6.9 and 2.7.1
  • Installation option (Docker install/Helm Chart):
    • HeIm chart on RKE2 cluster version 1.24
  • Proxy/Cert Details:

Information about the Cluster

  • Kubernetes version:
  • Cluster Type (Local/Downstream):
    • Downstream RKE2 Custom (version 1.24.7+rek2r1, 1.24.8+rke2r1, 1.24.9+rke2r2)

User Information

  • What is the role of the user logged in?
    • Admin

Describe the bug On all our clusters, upgrades are frozen with one/multiple controlplane node(s) stuck in state Waiting for probes: kube-controller-manager, kube-scheduler.

To Reproduce Not sure how to reproduce it, but all our clusters have hundreds days of run time, and they did not have any problem prior to Rancher 2.6.9 / Kubernetes version 1.24.7, but we have mix of cluster with Rancher 2.6.9 and 2.7.1 with clusters in 1.24.7 to 1.24.9. The problem appears after we edit the cluster to upgrade to a newer version.

Result

Upgrade is stuck, waiting for on or more controlpane stuck in state Waiting for probes: kube-controller-manager, kube-scheduler.

Expected Result

We expect upgrades to work without being stuck.

Screenshots

Ex cluster 1 (on controlplane impacted) : image

Ex cluster 2 (all controlplanes impacted) : image

Additional context We tried to upgrade a stuck cluster that was stuck going from 1.24.7 to 1.24.9, by upgrading to 1.24.11, nothing happened. When we restarted rancher-system-agent the node was effectively in 1.24.11, but still stuck in state Waiting for probes: kube-controller-manager, kube-scheduler. (SURE-6264)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 9
  • Comments: 41 (4 by maintainers)

Most upvoted comments

Solution found ! Thanks for the hint Chris Kim and brandond on Rancher Community Slack !

There is no official solution right now, but here is the manual fix that worked for me, you may launch these commands on every nodes that is stuck in Waiting for probes: kube-controller-manager, kube-scheduler state (aka: controlplane nodes).

Here is a shell command to check if probes are okay or not :

(
curl  --cacert /var/lib/rancher/rke2/server/tls/kube-controller-manager/kube-controller-manager.crt \
  https://127.0.0.1:10257/healthz >/dev/null 2>&1 \
  && echo "[OK] Kube Controller probe" \
  || echo "[FAIL] Kube Controller probe";

curl --cacert /var/lib/rancher/rke2/server/tls/kube-scheduler/kube-scheduler.crt \
  https://127.0.0.1:10259/healthz >/dev/null 2>&1  \
  && echo "[OK] Scheduler probe" \
  || echo "[FAIL] Scheduler probe";
)

And below commands I used to force certificate rotation on failed probes :

echo "Rotating kube-controller-manager certificate"
rm /var/lib/rancher/rke2/server/tls/kube-controller-manager/kube-controller-manager.{crt,key}
crictl rm -f $(crictl ps -q --name kube-controller-manager)

echo "Rotating kube-scheduler certificate"
rm /var/lib/rancher/rke2/server/tls/kube-scheduler/kube-scheduler.{crt,key}
crictl rm -f $(crictl ps -q --name kube-scheduler)

Enjoy !

It’s wonderfull that there is still no fix!

If you get this error :

Command 'crictl' not found, ...

You just have to set env var to make crictl available and working :

export CRI_CONFIG_FILE=/var/lib/rancher/rke2/agent/etc/crictl.yaml
export CONTAINERD_ADDRESS=unix:///run/k3s/containerd/containerd.sock
export PATH=$PATH:/var/lib/rancher/rke2/bin

As it still occurs on some clusters, I made a gist with a one line call script to fix this quickly (it is harmless to run it on a patched node).

curl -sL https://gist.githubusercontent.com/AlexisDucastel/689094f402fc75acbc4ae6e0408ee5c5/raw/994b57f4e9b0432283e2c48191ba222a2bb7bfbb/rancher-fix-waiting-for-probes-controller-manager-cert.sh | bash

Cf https://gist.github.com/AlexisDucastel/689094f402fc75acbc4ae6e0408ee5c5

Simple GUI way to resolve “Waiting for probes: kube-controller-manager, kube-scheduler”

  1. Hamburger menu / Cluster management
  2. click on three dots menu in row with cluster you want to fix
  3. select Rotate certificates
  4. in dialog that opens, select “Rotate all service certificates” and then click on Rotate button

After few refreshes, everything should work as expected.

Tested on Rancher 2.7.9 with K3s cluster.

image

User perspective

Rancher is doing a lot of heavy lifting, so as a user, I didn’t expect this kind of issue. The message that appears is not very informative, so at first it all seems like a big problem. Maybe, if the message was “Your certificates are expired. Your should rotate them manually” everything would look much more simple.

@AlexisDucastel - thanks for the bash steps above! 😄

That’s fixed the issue on all of our clusters 🥳

These certs would not be generated with a wide variety of rancher versions, and cluster versions.

All rke2 custom clusters, installed by rancher.

This was the fix.

timeout 1 openssl s_client -connect 127.0.0.1:10257 -showcerts 2>&1 | grep -A 19 -m 1 'BEGIN CERTIFICATE' | sudo tee /var/lib/rancher/rke2/server/tls/kube-controller-manager/kube-controller-manager.crt

timeout 1 openssl s_client -connect 127.0.0.1:10259 -showcerts 2>&1 | grep -A 19 -m 1 'BEGIN CERTIFICATE' | sudo tee /var/lib/rancher/rke2/server/tls/kube-scheduler/kube-scheduler.crt

It’s wonderfull that there is still no fix! @emoxam – This “solution” did not work for me.

Yet SUSE support (thus far not worth the money) continues to reference this post as a solution for the bug Waiting for probes: kube-controller-manager, kube-scheduler.

@AlexisDucastel I really appreciate your description and the steps followed when exposing this issue. It saved me a lot of time.

By checking certificate validity, we can find that the kube-controller-certificate is indeed expired.

# openssl x509 -text -in /var/lib/rancher/rke2/server/tls/kube-controller-manager/kube-controller-manager.crt | grep -A 2 Validity
        Validity
            Not Before: Dec 29 13:14:28 2021 GMT
            Not After : Dec 29 13:14:28 2022 GMT

Yap same on Rancher 2.9.3 - RKE2 v1.28.10+rke2r1

This does not seem to be resolved @Josh-Diamond

we facing this issue too on Rancher 2.9.2 and RKE2 1.29.8. Cluster is just over 1 year old and certificates are not rotating automatically. However this workaround helped: https://github.com/rancher/rancher/issues/41125#issuecomment-1506620040

@Rodri9o , I’m sorry to hear about your dissatisfaction with the support received.

However, please note that this issue is closed as fixed in 2.7.5 as per code changes in this PR the certificates that may result in cluster getting stuck on upgrade are now also rotated when using “Rotate Certificates” feature. It’s highly recommended to rotate certificates periodically (at least once a year) to ensure they do not expire.

The comment referenced is a workaround that can be applied if you’re running Rancher versions prior to 2.7.5 and/or got into the situation described in this issue.

Could you please clarify what your expectations for the fix? Please note that it’s not impossible for you to be running into some other issue that manifests similarly.

@emoxam , you reported quite recently that this issue is not fixed. Please feel free to chime in with more information.

I can confirm that @AlexisDucastel steps (CF: Step 1 ; then Step 2) solve the issue. Can someone from @rancher/all please look into this, or at least give official guidance ?

The issue is still present, I fixed it using the GUI solution from @acosoft quoted before. Tested on rancher 2.8.3 and v1.30.10+rke2r1 I totally agree with him that the certificate rotation should be auotmatic OR the error message should be more explicit.

Simple GUI way to resolve “Waiting for probes: kube-controller-manager, kube-scheduler”

  1. Hamburger menu / Cluster management
  2. click on three dots menu in row with cluster you want to fix
  3. select Rotate certificates
  4. in dialog that opens, select “Rotate all service certificates” and then click on Rotate button

After few refreshes, everything should work as expected.

Tested on Rancher 2.7.9 with K3s cluster.

image

User perspective

Rancher is doing a lot of heavy lifting, so as a user, I didn’t expect this kind of issue. The message that appears is not very informative, so at first it all seems like a big problem. Maybe, if the message was “Your certificates are expired. Your should rotate them manually” everything would look much more simple.

Solution found ! Thanks for the hint Chris Kim and brandond on Rancher Community Slack !

There is no official solution right now, but here is the manual fix that worked for me, you may launch these commands on every nodes that is stuck in Waiting for probes: kube-controller-manager, kube-scheduler state (aka: controlplane nodes).

Here is a shell command to check if probes are okay or not :

(
curl  --cacert /var/lib/rancher/rke2/server/tls/kube-controller-manager/kube-controller-manager.crt \
  https://127.0.0.1:10257/healthz >/dev/null 2>&1 \
  && echo "[OK] Kube Controller probe" \
  || echo "[FAIL] Kube Controller probe";

curl --cacert /var/lib/rancher/rke2/server/tls/kube-scheduler/kube-scheduler.crt \
  https://127.0.0.1:10259/healthz >/dev/null 2>&1  \
  && echo "[OK] Scheduler probe" \
  || echo "[FAIL] Scheduler probe";
)

And below commands I used to force certificate rotation on failed probes :

echo "Rotating kube-controller-manager certificate"
rm /var/lib/rancher/rke2/server/tls/kube-controller-manager/kube-controller-manager.{crt,key}
crictl rm -f $(crictl ps -q --name kube-controller-manager)

echo "Rotating kube-scheduler certificate"
rm /var/lib/rancher/rke2/server/tls/kube-scheduler/kube-scheduler.{crt,key}
crictl rm -f $(crictl ps -q --name kube-scheduler)

Enjoy !

Life saver, thanks!

Ticket #41125 - Test Results - ✅

Verified with HA Helm Rancher on v2.7-6ce75a0b57ad9e88cf135254a9b3b40082788eb6-head:

  1. Fresh install of rancher v2.7-head
  2. Provision a downstream RKE2 AWS Node driver cluster - [ i used a single-node instance w/ k8s v1.26.4+rke2r1 ]
  3. Once active, ssh into instance, and grab expiration date of kube-scheduler cert by running the following command:
openssl x509 -enddate -noout -in /var/lib/rancher/rke2/server/tls/kube-scheduler/kube-scheduler.crt
  1. Note the expiration date:
notAfter=May 23 14:49:52 2024 GMT
  1. Grab expiration date of kube-controller-manager cert by running the following command:
openssl x509 -enddate -noout -in /var/lib/rancher/rke2/server/tls/kube-controller-manager/kube-controller-manager.crt
  1. Note the expiration date:
notAfter=May 23 14:49:52 2024 GMT
  1. From Rancher UI, rotate certificates by navigate to Cluster Management > Cluster > Rotate certificates > Rotate all service certificates and selecting Rotate

  2. Once cluster is active, ssh back into instance and check if certs have been rotated:

    • kube-scheduler:
    notAfter=May 23 15:02:41 2024 GMT
    
    • kube-controller-manager:
    notAfter=May 23 15:02:41 2024 GMT
    
  3. Verified - kube-scheduler cert is rotated; as expected

  4. Verified - kube-controller-manager cert is rotated; as expected

@Josh-Diamond , with https://github.com/rancher/rancher/issues/41613 determined as the root cause for the reopen in “To Test” now, moving this one “To Test” as well. cc: @Sahota1225

Note: This only affects rke2 custom clusters managed by Rancher, for cluster deployed manually with RKE2 and then imported into Rancher upgrades works without any issue.