mirror of
https://github.com/rancher/rke.git
synced 2025-09-13 05:34:11 +00:00
Add cluster validation and regenerate kubeapi cert
This commit is contained in:
@@ -2,6 +2,7 @@ package k8s
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"k8s.io/api/core/v1"
|
||||
@@ -23,6 +24,7 @@ func CordonUncordon(k8sClient *kubernetes.Clientset, nodeName string, cordoned b
|
||||
node, err := k8sClient.CoreV1().Nodes().Get(nodeName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
logrus.Debugf("Error getting node %s: %v", nodeName, err)
|
||||
time.Sleep(time.Second * 5)
|
||||
continue
|
||||
}
|
||||
if node.Spec.Unschedulable == cordoned {
|
||||
@@ -33,6 +35,7 @@ func CordonUncordon(k8sClient *kubernetes.Clientset, nodeName string, cordoned b
|
||||
_, err = k8sClient.CoreV1().Nodes().Update(node)
|
||||
if err != nil {
|
||||
logrus.Debugf("Error setting cordoned state for node %s: %v", nodeName, err)
|
||||
time.Sleep(time.Second * 5)
|
||||
continue
|
||||
}
|
||||
updated = true
|
||||
|
Reference in New Issue
Block a user