operatingsystemconfig

package
v1.41.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultInterval is the default interval for retry operations.
	DefaultInterval = 5 * time.Second
	// DefaultSevereThreshold is the default threshold until an error reported by another component is treated as
	// 'severe'.
	DefaultSevereThreshold = 30 * time.Second
	// DefaultTimeout is the default timeout and defines how long Gardener should wait for a successful reconciliation
	// of an OperatingSystemConfig resource.
	DefaultTimeout = 3 * time.Minute
)

Variables

View Source
var (
	// DownloaderConfigFn is a function for computing the cloud config downloader units and files.
	DownloaderConfigFn = downloader.Config
	// OriginalConfigFn is a function for computing the downloaded cloud config user data units and files.
	OriginalConfigFn = original.Config
)

exposed for testing

View Source
var TimeNow = time.Now

TimeNow returns the current time. Exposed for testing.

Functions

func Key

func Key(workerName string, kubernetesVersion *semver.Version) string

Key returns the key that can be used as secret name based on the provided worker name and Kubernetes version.

Types

type Data

type Data struct {
	// Content is the actual cloud-config user data.
	Content string
	// Command is the command for reloading the cloud-config (in case a new version was downloaded).
	Command *string
	// Units is the list of systemd unit names.
	Units []string
}

Data contains the actual content, a command to load it and all units that shall be considered for restart on change.

type DownloaderValues

type DownloaderValues struct {
	// APIServerURL is the address (including https:// protocol prefix) to the kube-apiserver (from which the original
	// cloud-config user data will be downloaded).
	APIServerURL string
}

DownloaderValues are configuration values required for the 'provision' OperatingSystemConfigPurpose.

type Interface

type Interface interface {
	component.DeployMigrateWaiter
	// DeleteStaleResources deletes unused OperatingSystemConfig resources from the shoot namespace in the seed.
	DeleteStaleResources(context.Context) error
	// WaitCleanupStaleResources waits until all unused OperatingSystemConfig resources are cleaned up.
	WaitCleanupStaleResources(context.Context) error
	// SetAPIServerURL sets the APIServerURL value.
	SetAPIServerURL(string)
	// SetCABundle sets the CABundle value.
	SetCABundle(*string)
	// SetKubeletCACertificate sets the KubeletCACertificate value.
	SetKubeletCACertificate(string)
	// SetSSHPublicKeys sets the SSHPublicKeys value.
	SetSSHPublicKeys([]string)
	// WorkerNameToOperatingSystemConfigsMap returns a map whose key is a worker name and whose value is a structure
	// containing both the downloader and the original operating system config data.
	WorkerNameToOperatingSystemConfigsMap() map[string]*OperatingSystemConfigs
}

Interface is an interface for managing OperatingSystemConfigs.

func New

func New(
	logger logrus.FieldLogger,
	client client.Client,
	values *Values,
	waitInterval time.Duration,
	waitSevereThreshold time.Duration,
	waitTimeout time.Duration,
) Interface

New creates a new instance of Interface.

type OperatingSystemConfigs

type OperatingSystemConfigs struct {
	// Downloader is the data for the downloader script.
	Downloader Data
	// Original is the data for the to-be-downloaded cloud-config user data.
	Original Data
}

OperatingSystemConfigs contains operating system configs for the downloader script as well as for the original cloud config.

type OriginalValues

type OriginalValues struct {
	// CABundle is the bundle of certificate authorities that will be added as root certificates.
	CABundle *string
	// ClusterDNSAddress is the address for in-cluster DNS.
	ClusterDNSAddress string
	// ClusterDomain is the Kubernetes cluster domain.
	ClusterDomain string
	// Images is a map containing the necessary container images for the systemd units (hyperkube and pause-container).
	Images map[string]*imagevector.Image
	// KubeletCACertificate is the certificate authority for the kubelet.
	KubeletCACertificate string
	// KubeletCLIFlags is the set of configurable kubelet CLI flags. If the respective worker pool provides kubelet
	// configuration as well then this might get overwritten.
	KubeletCLIFlags components.ConfigurableKubeletCLIFlags
	// KubeletConfigParameters is the set of configurable kubelet config parameters. If the respective worker pool
	// provides kubelet configuration as well then this might get overwritten.
	KubeletConfigParameters components.ConfigurableKubeletConfigParameters
	// MachineTypes is a list of machine types.
	MachineTypes []gardencorev1beta1.MachineType
	// SSHPublicKeys is a list of public SSH keys.
	SSHPublicKeys []string
	// PromtailEnabled states whether Promtail shall be enabled.
	PromtailEnabled bool
	// LokiIngressHostName is the ingress host name of the shoot's Loki.
	LokiIngressHostName string
}

OriginalValues are configuration values required for the 'reconcile' OperatingSystemConfigPurpose.

type Values

type Values struct {
	// Namespace is the namespace for the OperatingSystemConfig resource.
	Namespace string
	// KubernetesVersion is the version for the kubelets of all worker pools.
	KubernetesVersion *semver.Version
	// Workers is the list of worker pools.
	Workers []gardencorev1beta1.Worker

	// DownloaderValues are configuration values required for the 'provision' OperatingSystemConfigPurpose.
	DownloaderValues
	// OriginalValues are configuration values required for the 'reconcile' OperatingSystemConfigPurpose.
	OriginalValues
}

Values contains the values used to create an OperatingSystemConfig resource.

Directories

Path Synopsis
Package operatingsystemconfig is a generated GoMock package.
Package operatingsystemconfig is a generated GoMock package.
components/kubelet/mock
Package kubelet is a generated GoMock package.
Package kubelet is a generated GoMock package.
components/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
mock
Package utils is a generated GoMock package.
Package utils is a generated GoMock package.

Jump to

Keyboard shortcuts

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