# Functions
BuildUpgradedDaemonSetsFromConfig takes a config object and the current version and returns the DaemonSet objects to post to the master.
CheckClusterHealth makes sure: - the API /healthz endpoint is healthy - all Nodes are Ready - (if self-hosted) that there are DaemonSets with at least one Pod for all control plane components - (if static pod-hosted) that all required Static Pod manifests exist on disk.
EnforceVersionPolicies enforces that the proposed new version is compatible with all the different version skew policies.
FetchConfiguration fetches configuration required for upgrading your cluster from a file (which has precedence) or a ConfigMap in the cluster.
GetAvailableUpgrades fetches all versions from the specified VersionGetter and computes which kinds of upgrades can be performed.
IsControlPlaneSelfHosted returns whether the control plane is self hosted or not.
NewDaemonSetPrepuller creates a new instance of the DaemonSetPrepuller struct.
NewKubeStaticPodPathManager creates a new instance of KubeStaticPodPathManager.
NewKubeStaticPodPathManagerUsingTempDirs creates a new instance of KubeStaticPodPathManager with temporary directories backing it.
NewKubeVersionGetter returns a new instance of KubeVersionGetter.
PerformPostUpgradeTasks runs nearly the same functions as 'kubeadm init' would do Note that the markmaster phase is left out, not needed, and no token is created as that doesn't belong to the upgrade.
PrepullImagesInParallel creates DaemonSets synchronously but waits in parallel for the images to pull.
SelfHostedControlPlane upgrades a self-hosted control plane It works as follows: - The client gets the currently running DaemonSets and their associated Pods used for self-hosting the control plane - A temporary DaemonSet for the component in question is created; but nearly identical to the DaemonSet for the self-hosted component running right now - Why use this temporary DaemonSet? Because, the RollingUpdate strategy for upgrading DaemonSets first kills the old Pod, and then adds the new one - This doesn't work for self-hosted upgrades, as if you remove the only API server for instance you have in the cluster, the cluster essentially goes down - So instead, a nearly identical copy of the pre-upgrade DaemonSet is created and applied to the cluster.
StaticPodControlPlane upgrades a static pod-hosted control plane.
# Constants
MaximumAllowedMinorVersionKubeletSkew describes how many minor versions the control plane version and the kubelet can skew in a kubeadm cluster.
MaximumAllowedMinorVersionUpgradeSkew describes how many minor versions kubeadm can upgrade the control plane version in one go.
# Structs
ClusterState describes the state of certain versions for a cluster.
DaemonSetPrepuller makes sure the control plane images are availble on all masters.
KubeStaticPodPathManager is a real implementation of StaticPodPathManager that is used when upgrading a static pod cluster.
KubeVersionGetter handles the version-fetching mechanism from external sources.
Upgrade defines an upgrade possibility to upgrade from a current version to a new one.
VersionSkewPolicyErrors describes version skew errors that might be seen during the validation process in EnforceVersionPolicies.
# Interfaces
Prepuller defines an interface for performing a prepull operation in a create-wait-delete fashion in parallel.
StaticPodPathManager is responsible for tracking the directories used in the static pod upgrade transition.
VersionGetter defines an interface for fetching different versions.