mirror of
https://github.com/rancher/rke.git
synced 2025-09-16 06:59:25 +00:00
Attempt upgrade on NotReady hosts
This commit is contained in:
@@ -79,10 +79,11 @@ const (
|
||||
DefaultKubeAPIArgAuditLogPathValue = "/var/log/kube-audit/audit-log.json"
|
||||
DefaultKubeAPIArgAuditPolicyFileValue = "/etc/kubernetes/audit-policy.yaml"
|
||||
|
||||
DefaultMaxUnavailable = "10%"
|
||||
DefaultNodeDrainTimeout = 120
|
||||
DefaultNodeDrainGracePeriod = -1
|
||||
DefaultNodeDrainIgnoreDaemonsets = true
|
||||
DefaultMaxUnavailableWorker = "10%"
|
||||
DefaultMaxUnavailableControlplane = "1"
|
||||
DefaultNodeDrainTimeout = 120
|
||||
DefaultNodeDrainGracePeriod = -1
|
||||
DefaultNodeDrainIgnoreDaemonsets = true
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -220,14 +221,16 @@ func (c *Cluster) setClusterDefaults(ctx context.Context, flags ExternalFlags) e
|
||||
|
||||
func (c *Cluster) setNodeUpgradeStrategy() {
|
||||
if c.UpgradeStrategy == nil {
|
||||
// we need to escape the "%" at the end of "10%" here so its not interpreted
|
||||
logrus.Debugf("No input provided for maxUnavailable, setting it to default value of %v", DefaultMaxUnavailable+"%")
|
||||
logrus.Debugf("No input provided for maxUnavailableWorker, setting it to default value of %v percent", strings.TrimRight(DefaultMaxUnavailableWorker, "%"))
|
||||
logrus.Debugf("No input provided for maxUnavailableControlplane, setting it to default value of %v", DefaultMaxUnavailableControlplane)
|
||||
c.UpgradeStrategy = &v3.NodeUpgradeStrategy{
|
||||
MaxUnavailable: DefaultMaxUnavailable,
|
||||
MaxUnavailableWorker: DefaultMaxUnavailableWorker,
|
||||
MaxUnavailableControlplane: DefaultMaxUnavailableControlplane,
|
||||
}
|
||||
return
|
||||
}
|
||||
setDefaultIfEmpty(&c.UpgradeStrategy.MaxUnavailable, DefaultMaxUnavailable)
|
||||
setDefaultIfEmpty(&c.UpgradeStrategy.MaxUnavailableWorker, DefaultMaxUnavailableWorker)
|
||||
setDefaultIfEmpty(&c.UpgradeStrategy.MaxUnavailableControlplane, DefaultMaxUnavailableControlplane)
|
||||
if !c.UpgradeStrategy.Drain {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user