Upgrade is performed by updating node configuration (node by node, service by service), watching internal resource state to get new configuration version and verifying that pod with matching version successfully propagated to the API server state and pod is ready. Process is similar to the rolling update of the DaemonSet. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package kubernetes
|
|
|
|
import (
|
|
appsv1 "k8s.io/api/apps/v1"
|
|
)
|
|
|
|
const (
|
|
namespace = "kube-system"
|
|
checkpointerAnnotation = "checkpointer.alpha.coreos.com/checkpoint"
|
|
checkpointedPodAnnotation = "checkpointer.alpha.coreos.com/checkpoint-of"
|
|
|
|
kubeAPIServer = "kube-apiserver"
|
|
kubeControllerManager = "kube-controller-manager"
|
|
kubeScheduler = "kube-scheduler"
|
|
kubeProxy = "kube-proxy"
|
|
)
|
|
|
|
// UpgradeOptions represents Kubernetes control plane upgrade settings.
|
|
type UpgradeOptions struct {
|
|
FromVersion string
|
|
ToVersion string
|
|
|
|
ControlPlaneEndpoint string
|
|
|
|
extraUpdaters []daemonsetUpdater
|
|
podCheckpointerExtraUpdaters []daemonsetUpdater
|
|
masterNodes []string
|
|
}
|
|
|
|
type daemonsetUpdater func(ds string, daemonset *appsv1.DaemonSet) error
|