kind

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package kind provide utilities for CAPD interoperability with kindest/node images.

CAPD doesn't have direct dependencies from Kind, however, it is using kindest/node images.

As a consequence CAPD must stay in sync with Kind with regards to how kindest/node images are run when creating a new DockerMachine.

kindest/node images are created using a specific Kind version, and thus it is required to keep into account the mapping between the Kubernetes version for a kindest/node and the Kind version that created that image, so we can run it properly.

NOTE: This is the same reason why in the Kind release documentation there is a specific list of kindest/node images - uniquely identified by a sha - to be used with a Kind release.

For sake of simplification, we are grouping a set of Kind versions that runs kindest/node images in the same way into Kind mode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapping

type Mapping struct {
	KubernetesVersion semver.Version
	Mode              Mode
	Image             string
}

Mapping defines a mapping between a Kubernetes version, a Mode, and a pre-built Image sha.

func GetMapping

func GetMapping(k8sVersion semver.Version, customImage string) Mapping

GetMapping return the Mapping for a given Kubernetes version/custom image. If a custom image is provided, return the corresponding Mapping if defined, otherwise return the mapping for target K8sVersion if defined; if there is no exact match for a given Kubernetes version/custom image, a best effort mapping is returned. NOTE: returning a best guess mapping is a way to try to make things to work when new images are published and either CAPD code in this file is not yet updated or users/CI are using older versions of CAPD. Even if this can lead to CAPD failing in not obvious ways, we consider this an acceptable trade off given that this is a provider to be used for development only and this approach allow us bit more of flexibility in using Kindest/node images published after CAPD version is cut (without doing code changes in the list above and/or cherry-picks).

type Mode

type Mode string

Mode defines a set of Kind versions that are running images in a consistent way.

const (
	// ModeNone defined a Mode to be used when creating the CAPD load balancer, which doesn't
	// use a kindest/node image.
	ModeNone Mode = "None"

	// Mode0_19 is a Mode that identifies kind v0.19 and older; all those versions
	// are running images in a consistent way (or are too old at the time of this implementation).
	Mode0_19 Mode = "kind 0.19"

	// Mode0_20 is a Mode that identifies kind v0.20 and newer; all those versions
	// are running images in a consistent way, that differs from Mode0_19 because
	// of the adoption of CgroupnsMode = "private" when running images.
	Mode0_20 Mode = "kind 0.20"
)

Jump to

Keyboard shortcuts

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