Documentation ¶
Index ¶
- Constants
- func AllControlPlanesMatchVersion(client clientset.Interface, clusterVersion *version.Version) (bool, error)
- func AllControlPlanesMatchVersionWithVersioningInfo(allNodesVersioningInfo NodeVersionInfoMap, clusterVersion *version.Version) bool
- func AllNodesMatchClusterVersionWithVersioningInfo(allNodesVersioningInfo NodeVersionInfoMap, clusterVersion *version.Version) bool
- func AllNodesTolerateClusterVersionWithVersioningInfo(allNodesVersioningInfo NodeVersionInfoMap, clusterVersion *version.Version) bool
- func AllWorkerNodesTolerateVersion(client clientset.Interface, clusterVersion *version.Version) (bool, error)
- func AvailableVersions() []*version.Version
- func AvailableVersionsForMap(versions KubernetesVersions) []*version.Version
- func ComponentContainerImageForClusterVersion(component Component, clusterVersion *version.Version) string
- func ComponentVersionForClusterVersion(component Component, clusterVersion *version.Version) string
- func ComponentVersionWithAvailableVersions(component Component, clusterVersion *version.Version, ...) string
- func CreateAndWaitForJob(client clientset.Interface, name string, spec batchv1.JobSpec, timeout int) error
- func CreateJob(client clientset.Interface, name string, spec batchv1.JobSpec) (*batchv1.Job, error)
- func DeleteJob(client clientset.Interface, name string) error
- func DisarmKubelet(client clientset.Interface, node *v1.Node, clusterVersion *version.Version) error
- func DoesResourceExistWithError(err error) (bool, error)
- func DrainNode(client clientset.Interface, node *corev1.Node, drainTimeout time.Duration) error
- func GenerateKubeletRootCert() error
- func GetAdminClientSet() (clientset.Interface, error)
- func GetAdminClientSetWithConfig() (clientset.Interface, *rest.Config, error)
- func GetAllNodes(client clientset.Interface) (*corev1.NodeList, error)
- func GetControlPlaneNodes(client clientset.Interface) (*corev1.NodeList, error)
- func GetNodeWithMachineID(client clientset.Interface, machineID string) (*corev1.Node, error)
- func HostMount(name, mount string) v1.Volume
- func IsControlPlane(node *corev1.Node) bool
- func IsVersionAvailable(kubernetesVersion *version.Version) bool
- func LatestVersion() *version.Version
- func MajorMinorVersion(kubernetesVersion *version.Version) string
- func VolumeMount(name, mount string, mode VolumeMountMode) v1.VolumeMount
- type Addon
- type AddonVersion
- type AddonsVersion
- type ClusterAddonsKnownVersions
- type Component
- type ComponentContainerVersion
- type ComponentHostVersion
- type ContainerImageTag
- type KubernetesVersion
- type KubernetesVersions
- type NodeVersionInfo
- func (nvi NodeVersionInfo) DriftsFromClusterVersion(clusterVersion *version.Version) bool
- func (nvi NodeVersionInfo) EqualsClusterVersion(clusterVersion *version.Version) bool
- func (nvi NodeVersionInfo) IsControlPlane() bool
- func (nvi NodeVersionInfo) LessThanClusterVersion(clusterVersion *version.Version) bool
- func (nvi NodeVersionInfo) String() string
- func (nvi NodeVersionInfo) ToleratesClusterVersion(clusterVersion *version.Version) bool
- func (nvi NodeVersionInfo) Unschedulable() bool
- type NodeVersionInfoMap
- type StaticVersionInquirer
- type VersionInquirer
- type VolumeMountMode
Constants ¶
const ( // KubeletCertAndKeyDir defines kubelet's CA certificate and key directory KubeletCertAndKeyDir = "/var/lib/kubelet/pki" // KubeletCACertAndKeyBaseName defines kubelet's CA certificate and key base name KubeletCACertAndKeyBaseName = "kubelet-ca" // KubeletCACertName defines kubelet's CA certificate name KubeletCACertName = "kubelet-ca.crt" // KubeletCAKeyName defines kubelet's CA key name KubeletCAKeyName = "kubelet-ca.key" // KubeletServerCertAndKeyBaseName defines kubelet server certificate and key base name KubeletServerCertAndKeyBaseName = "kubelet" // KubeletServerCertName defines kubelet server certificate name KubeletServerCertName = "kubelet.crt" // KubeletServerKeyName defines kubelet server key name KubeletServerKeyName = "kubelet.key" )
const ( Cilium Addon = "cilium" Kured Addon = "kured" Dex Addon = "dex" Gangway Addon = "gangway" MetricsServer Addon = "metrics-server" Kucero Addon = "kucero" PSP Addon = "psp" Kubelet Component = "kubelet" ContainerRuntime Component = "cri-o" APIServer Component = "apiserver" ControllerManager Component = "controllermanager" Scheduler Component = "scheduler" Proxy Component = "proxy" Hyperkube Component = "hyperkube" Etcd Component = "etcd" CoreDNS Component = "coredns" Pause Component = "pause" Tooling Component = "tooling" )
const ( // TimeoutWaitForJob is the default seconds to wait for a new job to reach state succeeded TimeoutWaitForJob int = 300 )
Variables ¶
This section is empty.
Functions ¶
func AllControlPlanesMatchVersion ¶ added in v0.7.0
func AllControlPlanesMatchVersion(client clientset.Interface, clusterVersion *version.Version) (bool, error)
AllControlPlanesMatchVersion checks that all control planes are on the same version, and that they match a cluster version
func AllControlPlanesMatchVersionWithVersioningInfo ¶ added in v0.7.0
func AllControlPlanesMatchVersionWithVersioningInfo(allNodesVersioningInfo NodeVersionInfoMap, clusterVersion *version.Version) bool
AllControlPlanesMatchVersionWithVersioningInfo checks that all control planes are on the same version, and that they match a cluster version With the addition of passing in a NodeVersionInfoMap to make it easily testable
func AllNodesMatchClusterVersionWithVersioningInfo ¶ added in v1.0.0
func AllNodesMatchClusterVersionWithVersioningInfo(allNodesVersioningInfo NodeVersionInfoMap, clusterVersion *version.Version) bool
AllNodesMatchVersionWithVersioningInfo returns if all nodes match a specific kubernetes version This can be used to determine e.g. if an upgrade is ongoing
func AllNodesTolerateClusterVersionWithVersioningInfo ¶ added in v1.4.11
func AllNodesTolerateClusterVersionWithVersioningInfo(allNodesVersioningInfo NodeVersionInfoMap, clusterVersion *version.Version) bool
AllNodesTolerateVersionWithVersioningInfo returns if all nodes tolerate a specific kubernetes version This can be used to determine e.g. if an upgrade is ongoing
func AllWorkerNodesTolerateVersion ¶ added in v0.7.0
func AllWorkerNodesTolerateVersion(client clientset.Interface, clusterVersion *version.Version) (bool, error)
AllWorkerNodesTolerateVersion checks that all schedulable worker nodes tolerate the given cluster version
func AvailableVersions ¶ added in v0.7.0
AvailableVersions return the list of platform versions known to skuba
func AvailableVersionsForMap ¶ added in v0.7.0
func AvailableVersionsForMap(versions KubernetesVersions) []*version.Version
func ComponentContainerImageForClusterVersion ¶ added in v1.1.1
func ComponentVersionForClusterVersion ¶ added in v0.7.0
func ComponentVersionWithAvailableVersions ¶ added in v0.7.0
func ComponentVersionWithAvailableVersions(component Component, clusterVersion *version.Version, availableVersions KubernetesVersions) string
func CreateAndWaitForJob ¶
func CreateAndWaitForJob(client clientset.Interface, name string, spec batchv1.JobSpec, timeout int) error
CreateAndWaitForJob creates job and wait until discover job status active, succeeded or timeout
func DisarmKubelet ¶
func DoesResourceExistWithError ¶ added in v1.1.0
DoesResourceExistWithError check the given error from a client-go API call and returns whether the resource exists. If no error was given, it will return true, if the given error was a `IsNotFound` it will return false; otherwise it will return an error
func GenerateKubeletRootCert ¶ added in v1.2.2
func GenerateKubeletRootCert() error
GenerateKubeletRootCert generates kubelet root CA certificate and key and save the generated file locally.
func GetAdminClientSet ¶
func GetAdminClientSetWithConfig ¶ added in v1.3.4
func GetAllNodes ¶ added in v1.2.2
GetAllNodes returns the list of nodes
func GetControlPlaneNodes ¶ added in v0.7.0
GetControlPlaneNodes returns the list of master nodes by matching "node-role.kubernetes.io/master" label.
func GetNodeWithMachineID ¶ added in v1.2.2
GetNodeWithMachineID returns the node matching machine ID.
func IsControlPlane ¶ added in v0.7.0
IsControlPlane check if given node is master node.
func IsVersionAvailable ¶ added in v0.8.0
IsVersionAvailable returns if a specific kubernetes version is available
func LatestVersion ¶ added in v0.7.0
LatestVersion return the latest Kubernetes supported version
func MajorMinorVersion ¶ added in v0.8.0
MajorMinorVersion returns a KubernetesVersion without the patch level
func VolumeMount ¶
func VolumeMount(name, mount string, mode VolumeMountMode) v1.VolumeMount
Types ¶
type AddonVersion ¶ added in v1.1.0
func AddonVersionForClusterVersion ¶ added in v1.1.0
func AddonVersionForClusterVersion(addon Addon, clusterVersion *version.Version) *AddonVersion
type AddonsVersion ¶
type AddonsVersion map[Addon]*AddonVersion
func AllAddonVersionsForClusterVersion ¶ added in v1.1.1
func AllAddonVersionsForClusterVersion(clusterVersion *version.Version) AddonsVersion
type ClusterAddonsKnownVersions ¶ added in v1.3.1
type ClusterAddonsKnownVersions = func(clusterVersion *version.Version) AddonsVersion
type Component ¶
type Component string
func AllComponentContainerImagesForClusterVersion ¶ added in v1.1.1
type ComponentContainerVersion ¶ added in v1.1.1
type ComponentContainerVersion map[Component]*ContainerImageTag
type ComponentHostVersion ¶ added in v1.1.1
type ContainerImageTag ¶ added in v1.1.1
type KubernetesVersion ¶
type KubernetesVersion struct { ComponentHostVersion ComponentHostVersion ComponentContainerVersion ComponentContainerVersion AddonsVersion AddonsVersion }
type KubernetesVersions ¶ added in v0.7.0
type KubernetesVersions map[string]KubernetesVersion
type NodeVersionInfo ¶ added in v0.7.0
type NodeVersionInfo struct { Node *v1.Node ContainerRuntimeVersion *version.Version KubeletVersion *version.Version APIServerVersion *version.Version ControllerManagerVersion *version.Version SchedulerVersion *version.Version EtcdVersion *version.Version }
func (NodeVersionInfo) DriftsFromClusterVersion ¶ added in v0.7.0
func (nvi NodeVersionInfo) DriftsFromClusterVersion(clusterVersion *version.Version) bool
func (NodeVersionInfo) EqualsClusterVersion ¶ added in v0.7.0
func (nvi NodeVersionInfo) EqualsClusterVersion(clusterVersion *version.Version) bool
func (NodeVersionInfo) IsControlPlane ¶ added in v0.7.0
func (nvi NodeVersionInfo) IsControlPlane() bool
func (NodeVersionInfo) LessThanClusterVersion ¶ added in v0.7.0
func (nvi NodeVersionInfo) LessThanClusterVersion(clusterVersion *version.Version) bool
func (NodeVersionInfo) String ¶ added in v0.7.0
func (nvi NodeVersionInfo) String() string
func (NodeVersionInfo) ToleratesClusterVersion ¶ added in v0.7.0
func (nvi NodeVersionInfo) ToleratesClusterVersion(clusterVersion *version.Version) bool
func (NodeVersionInfo) Unschedulable ¶ added in v0.7.0
func (nvi NodeVersionInfo) Unschedulable() bool
type NodeVersionInfoMap ¶ added in v0.7.0
type NodeVersionInfoMap map[string]NodeVersionInfo
func AllNodesVersioningInfo ¶ added in v0.7.0
func AllNodesVersioningInfo(client clientset.Interface) (NodeVersionInfoMap, error)
AllNodesVersioningInfo returns the version info for all nodes in the cluster
type StaticVersionInquirer ¶ added in v0.7.0
type StaticVersionInquirer struct{}
func (StaticVersionInquirer) AvailablePlatformVersions ¶ added in v0.7.0
func (si StaticVersionInquirer) AvailablePlatformVersions() []*version.Version
func (StaticVersionInquirer) NodeVersionInfoForClusterVersion ¶ added in v0.7.0
func (si StaticVersionInquirer) NodeVersionInfoForClusterVersion(node *v1.Node, clusterVersion *version.Version) NodeVersionInfo
type VersionInquirer ¶ added in v0.7.0
type VolumeMountMode ¶
type VolumeMountMode uint
const ( VolumeMountReadOnly VolumeMountMode = iota VolumeMountReadWrite VolumeMountMode = iota )