Documentation ¶
Index ¶
- func CheckClusterHealth(_ clientset.Interface) error
- func FetchConfiguration(_ clientset.Interface, _ io.Writer, _ string) (*kubeadmapiext.MasterConfiguration, error)
- func IsControlPlaneSelfHosted(_ clientset.Interface) bool
- func PerformPostUpgradeTasks(_ clientset.Interface, _ *kubeadmapi.MasterConfiguration, _ *version.Version) error
- func PerformStaticPodControlPlaneUpgrade(_ clientset.Interface, _ *kubeadmapi.MasterConfiguration, _ *version.Version) error
- type ClusterState
- type KubeVersionGetter
- func (g *KubeVersionGetter) ClusterVersion() (string, *versionutil.Version, error)
- func (g *KubeVersionGetter) KubeadmVersion() (string, *versionutil.Version, error)
- func (g *KubeVersionGetter) KubeletVersions() (map[string]uint16, error)
- func (g *KubeVersionGetter) VersionFromCILabel(_, _ string) (string, *versionutil.Version, error)
- type Upgrade
- type VersionGetter
- type VersionSkewPolicyErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckClusterHealth ¶
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
func FetchConfiguration ¶
func FetchConfiguration(_ clientset.Interface, _ io.Writer, _ string) (*kubeadmapiext.MasterConfiguration, error)
FetchConfiguration fetches configuration required for upgrading your cluster from a file (which has precedence) or a ConfigMap in the cluster
func IsControlPlaneSelfHosted ¶
IsControlPlaneSelfHosted returns whether the control plane is self hosted or not
func PerformPostUpgradeTasks ¶
func PerformPostUpgradeTasks(_ clientset.Interface, _ *kubeadmapi.MasterConfiguration, _ *version.Version) error
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
func PerformStaticPodControlPlaneUpgrade ¶
func PerformStaticPodControlPlaneUpgrade(_ clientset.Interface, _ *kubeadmapi.MasterConfiguration, _ *version.Version) error
PerformStaticPodControlPlaneUpgrade upgrades a static pod-hosted control plane
Types ¶
type ClusterState ¶
type ClusterState struct { // KubeVersion describes the version of the Kubernetes API Server, Controller Manager, Scheduler and Proxy. KubeVersion string // DNSVersion describes the version of the kube-dns images used and manifest version DNSVersion string // KubeadmVersion describes the version of the kubeadm CLI KubeadmVersion string // KubeletVersions is a map with a version number linked to the amount of kubelets running that version in the cluster KubeletVersions map[string]uint16 }
ClusterState describes the state of certain versions for a cluster
type KubeVersionGetter ¶
type KubeVersionGetter struct {
// contains filtered or unexported fields
}
KubeVersionGetter handles the version-fetching mechanism from external sources
func NewKubeVersionGetter ¶
func NewKubeVersionGetter(client clientset.Interface, writer io.Writer) *KubeVersionGetter
NewKubeVersionGetter returns a new instance of KubeVersionGetter
func (*KubeVersionGetter) ClusterVersion ¶
func (g *KubeVersionGetter) ClusterVersion() (string, *versionutil.Version, error)
ClusterVersion gets API server version
func (*KubeVersionGetter) KubeadmVersion ¶
func (g *KubeVersionGetter) KubeadmVersion() (string, *versionutil.Version, error)
KubeadmVersion gets kubeadm version
func (*KubeVersionGetter) KubeletVersions ¶
func (g *KubeVersionGetter) KubeletVersions() (map[string]uint16, error)
KubeletVersions gets the versions of the kubelets in the cluster
func (*KubeVersionGetter) VersionFromCILabel ¶
func (g *KubeVersionGetter) VersionFromCILabel(_, _ string) (string, *versionutil.Version, error)
VersionFromCILabel resolves different labels like "stable" to action semver versions using the Kubernetes CI uploads to GCS
type Upgrade ¶
type Upgrade struct { Description string Before ClusterState After ClusterState }
Upgrade defines an upgrade possibility to upgrade from a current version to a new one
func GetAvailableUpgrades ¶
func GetAvailableUpgrades(_ VersionGetter, _, _ bool) ([]Upgrade, error)
GetAvailableUpgrades fetches all versions from the specified VersionGetter and computes which kinds of upgrades can be performed
func (*Upgrade) CanUpgradeKubelets ¶
CanUpgradeKubelets returns whether an upgrade of any kubelet in the cluster is possible
type VersionGetter ¶
type VersionGetter interface { // ClusterVersion should return the version of the cluster i.e. the API Server version ClusterVersion() (string, *versionutil.Version, error) // KubeadmVersion should return the version of the kubeadm CLI KubeadmVersion() (string, *versionutil.Version, error) // VersionFromCILabel should resolve CI labels like `latest`, `stable`, `stable-1.8`, etc. to real versions VersionFromCILabel(string, string) (string, *versionutil.Version, error) // KubeletVersions should return a map with a version and a number that describes how many kubelets there are for that version KubeletVersions() (map[string]uint16, error) }
VersionGetter defines an interface for fetching different versions. Easy to implement a fake variant of this interface for unit testing
type VersionSkewPolicyErrors ¶
VersionSkewPolicyErrors describes version skew errors that might be seen during the validation process in EnforceVersionPolicies
func EnforceVersionPolicies ¶
func EnforceVersionPolicies(_ VersionGetter, _ string, _ *version.Version, _, _ bool) *VersionSkewPolicyErrors
EnforceVersionPolicies enforces that the proposed new version is compatible with all the different version skew policies