kubernetes

package
v1.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Cilium  Addon = "cilium"
	Kured   Addon = "kured"
	Dex     Addon = "dex"
	Gangway Addon = "gangway"
	PSP     Addon = "psp"

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

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

	Tooling Component = "tooling"
)

Variables

This section is empty.

Functions

func AllControlPlanesMatchVersion added in v0.7.0

func AllControlPlanesMatchVersion(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 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 ComponentContainerImageForClusterVersion added in v1.1.1

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

func ComponentContainerImageWithAvailableVersions added in v1.1.1

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

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(client clientset.Interface, name string, spec batchv1.JobSpec) error

func CreateJob

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

func DeleteJob

func DeleteJob(client clientset.Interface, name string) error

func DisarmKubelet

func DisarmKubelet(client clientset.Interface, node *v1.Node, clusterVersion *version.Version) error

func DoesResourceExistWithError added in v1.1.0

func DoesResourceExistWithError(err error) (bool, error)

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 DrainNode

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

func GetAdminClientSet

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

func GetControlPlaneNodes added in v0.7.0

func GetControlPlaneNodes(client kubernetes.Interface) (*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 AddonVersion added in v1.1.0

type AddonVersion struct {
	Version         string
	ManifestVersion uint
}

func AddonVersionForClusterVersion added in v1.1.0

func AddonVersionForClusterVersion(addon Addon, clusterVersion *version.Version) *AddonVersion

func AddonVersionWithAvailableVersions added in v1.1.0

func AddonVersionWithAvailableVersions(addon Addon, clusterVersion *version.Version, availableVersions KubernetesVersions) *AddonVersion

type AddonsVersion

type AddonsVersion map[Addon]*AddonVersion

func AllAddonVersionsForClusterVersion added in v1.1.1

func AllAddonVersionsForClusterVersion(clusterVersion *version.Version) AddonsVersion

type Component

type Component string

func AllComponentContainerImagesForClusterVersion added in v1.1.1

func AllComponentContainerImagesForClusterVersion(clusterVersion *version.Version) []Component

func AllComponentContainerImagesWithAvailableVersions added in v1.1.1

func AllComponentContainerImagesWithAvailableVersions(clusterVersion *version.Version, availableVersions KubernetesVersions) []Component

type ComponentContainerVersion added in v1.1.1

type ComponentContainerVersion map[Component]*ContainerImageTag

type ComponentHostVersion added in v1.1.1

type ComponentHostVersion struct {
	KubeletVersion          string
	ContainerRuntimeVersion string
}

type ContainerImageTag added in v1.1.1

type ContainerImageTag struct {
	Name string
	Tag  string
}

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 {
	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