kubernetes

package
v0.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cilium  Addon = "cilium"
	Tooling Addon = "tooling"
	Kured   Addon = "kured"
	Dex     Addon = "dex"
	Gangway Addon = "gangway"

	ContainerRuntime Component = "cri-o"
	Kubelet          Component = "kubelet"

	Hyperkube Component = "hyperkube"
	Etcd      Component = "etcd"
	CoreDNS   Component = "coredns"
	Pause     Component = "pause"
)

Variables

View Source
var (
	Versions = KubernetesVersions{
		"1.15.2": KubernetesVersion{
			ControlPlaneComponentsVersion: ControlPlaneComponentsVersion{
				HyperkubeVersion: "v1.15.2",
				EtcdVersion:      "3.3.11",
				CoreDNSVersion:   "1.3.1",
				PauseVersion:     "3.1",
			},
			ComponentsVersion: ComponentsVersion{
				KubeletVersion:          "1.15.2",
				ContainerRuntimeVersion: "1.15.0",
			},
			AddonsVersion: AddonsVersion{
				CiliumVersion:  "1.5.3",
				ToolingVersion: "0.1.0",
				KuredVersion:   "1.2.0",
				DexVersion:     "2.16.0",
				GangwayVersion: "3.1.0",
			},
		},
		"1.15.0": KubernetesVersion{
			ControlPlaneComponentsVersion: ControlPlaneComponentsVersion{
				HyperkubeVersion: "v1.15.0",
				EtcdVersion:      "3.3.11",
				CoreDNSVersion:   "1.3.1",
				PauseVersion:     "3.1",
			},
			ComponentsVersion: ComponentsVersion{
				KubeletVersion:          "1.15.0",
				ContainerRuntimeVersion: "1.15.0",
			},
			AddonsVersion: AddonsVersion{
				CiliumVersion:  "1.5.3",
				ToolingVersion: "0.1.0",
				KuredVersion:   "1.2.0",
				DexVersion:     "2.16.0",
				GangwayVersion: "3.1.0",
			},
		},
		"1.14.1": KubernetesVersion{
			ControlPlaneComponentsVersion: ControlPlaneComponentsVersion{
				HyperkubeVersion: "v1.14.1",
				EtcdVersion:      "3.3.11",
				CoreDNSVersion:   "1.2.6",
				PauseVersion:     "3.1",
			},
			ComponentsVersion: ComponentsVersion{
				ContainerRuntimeVersion: "1.14.1",
				KubeletVersion:          "1.14.1",
			},
			AddonsVersion: AddonsVersion{
				CiliumVersion:  "1.5.3",
				ToolingVersion: "0.1.0",
				KuredVersion:   "1.2.0",
				DexVersion:     "2.16.0",
				GangwayVersion: "3.1.0",
			},
		},
	}
)

Functions

func AllControlPlanesMatchVersion added in v0.7.0

func AllControlPlanesMatchVersion(currentClusterVersion *version.Version) (bool, error)

AllControlPlanesMatchVersion checks that all control planes are on the same version, and that they match the current cluster version

func AllControlPlanesMatchVersionWithVersioningInfo added in v0.7.0

func AllControlPlanesMatchVersionWithVersioningInfo(allNodesVersioningInfo NodeVersionInfoMap, currentClusterVersion *version.Version) bool

AllControlPlanesMatchVersionWithVersioningInfo checks that all control planes are on the same version, and that they match the current cluster version With the addition of passing in a NodeVersionInfoMap to make it easily testable

func AllWorkerNodesTolerateVersion added in v0.7.0

func AllWorkerNodesTolerateVersion(clusterVersion *version.Version) (bool, error)

AllWorkerNodesTolerateVersion checks that all schedulable worker nodes tolerate the given cluster version

func AvailableVersions added in v0.7.0

func AvailableVersions() []*version.Version

AvailableVersions return the list of platform versions known to skuba

func AvailableVersionsForMap added in v0.7.0

func AvailableVersionsForMap(versions KubernetesVersions) []*version.Version

func ComponentVersionForClusterVersion added in v0.7.0

func ComponentVersionForClusterVersion(component Component, clusterVersion *version.Version) string

func ComponentVersionWithAvailableVersions added in v0.7.0

func ComponentVersionWithAvailableVersions(component Component, clusterVersion *version.Version, availableVersions KubernetesVersions) string

func CreateAndWaitForJob

func CreateAndWaitForJob(name string, spec batchv1.JobSpec) error

func CreateJob

func CreateJob(name string, spec batchv1.JobSpec) (*batchv1.Job, error)

func CurrentAddonVersion

func CurrentAddonVersion(addon Addon) string

func CurrentComponentVersion

func CurrentComponentVersion(component Component) string

func DeleteJob

func DeleteJob(name string) error

func DisarmKubelet

func DisarmKubelet(node *v1.Node) error

func DrainNode

func DrainNode(node *v1.Node, drainTimeout time.Duration) error

func GetAdminClientSet

func GetAdminClientSet() (*clientset.Clientset, error)

func GetControlPlaneNodes added in v0.7.0

func GetControlPlaneNodes() (*v1.NodeList, error)

func GetNodeWithMachineId added in v0.7.0

func GetNodeWithMachineId(machineId string) (*v1.Node, error)

func HostMount

func HostMount(name, mount string) v1.Volume

func IsControlPlane added in v0.7.0

func IsControlPlane(node *v1.Node) bool

func IsVersionAvailable added in v0.8.0

func IsVersionAvailable(kubernetesVersion *version.Version) bool

IsVersionAvailable returns if a specific kubernetes version is available

func LatestVersion added in v0.7.0

func LatestVersion() *version.Version

LatestVersion return the latest Kubernetes supported version

func MajorMinorVersion added in v0.8.0

func MajorMinorVersion(kubernetesVersion *version.Version) string

MajorMinorVersion returns a KubernetesVersion without the patch level

func VolumeMount

func VolumeMount(name, mount string, mode VolumeMountMode) v1.VolumeMount

Types

type Addon

type Addon string

type AddonsVersion

type AddonsVersion struct {
	CiliumVersion  string
	ToolingVersion string
	KuredVersion   string
	DexVersion     string
	GangwayVersion string
}

type Component

type Component string

type ComponentsVersion

type ComponentsVersion struct {
	ContainerRuntimeVersion string
	KubeletVersion          string
}

type ControlPlaneComponentsVersion

type ControlPlaneComponentsVersion struct {
	HyperkubeVersion string
	EtcdVersion      string
	CoreDNSVersion   string
	PauseVersion     string
}

type KubernetesVersion

type KubernetesVersion struct {
	ControlPlaneComponentsVersion ControlPlaneComponentsVersion
	ComponentsVersion             ComponentsVersion
	AddonsVersion                 AddonsVersion
}

type KubernetesVersions added in v0.7.0

type KubernetesVersions map[string]KubernetesVersion

type NodeVersionInfo added in v0.7.0

type NodeVersionInfo struct {
	Nodename                 string
	ContainerRuntimeVersion  *version.Version
	KubeletVersion           *version.Version
	APIServerVersion         *version.Version
	ControllerManagerVersion *version.Version
	SchedulerVersion         *version.Version
	EtcdVersion              *version.Version
	Unschedulable            bool
}

func NodeVersioningInfo added in v0.7.0

func NodeVersioningInfo(nodeName string) (NodeVersionInfo, error)

NodeVersioningInfo returns related versioning information about a node

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

type NodeVersionInfoMap added in v0.7.0

type NodeVersionInfoMap map[string]NodeVersionInfo

func AllNodesVersioningInfo added in v0.7.0

func AllNodesVersioningInfo() (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 VersionInquirer interface {
	AvailablePlatformVersions() []*version.Version
	NodeVersionInfoForClusterVersion(node *v1.Node, version *version.Version) NodeVersionInfo
}

type VolumeMountMode

type VolumeMountMode uint
const (
	VolumeMountReadOnly  VolumeMountMode = iota
	VolumeMountReadWrite VolumeMountMode = iota
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL