kubernetes

package
v1.4.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MPL-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Package kubernetes provides cluster-wide kubernetes utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectLowestVersion

func DetectLowestVersion(ctx context.Context, cluster UpgradeProvider, options UpgradeOptions) (string, error)

DetectLowestVersion returns lowest Kubernetes components versions in the cluster.

func UpgradeTalosManaged

func UpgradeTalosManaged(ctx context.Context, cluster UpgradeProvider, options UpgradeOptions) error

UpgradeTalosManaged the Kubernetes control plane.

Types

type K8sComponentItem

type K8sComponentItem struct {
	Node      string
	Component string
	Value     string
}

K8sComponentItem represents a component item.

type K8sComponentRemovedItemsError

type K8sComponentRemovedItemsError struct {
	AdmissionFlags []K8sComponentItem
	CLIFlags       []K8sComponentItem
	FeatureGates   []K8sComponentItem
}

K8sComponentRemovedItemsError is an error type for removed items.

func (K8sComponentRemovedItemsError) Error

Error returns the error message.

func (K8sComponentRemovedItemsError) ErrorOrNil

func (e K8sComponentRemovedItemsError) ErrorOrNil() error

ErrorOrNil returns the error if it exists.

func (*K8sComponentRemovedItemsError) PopulateRemovedAdmissionPlugins

func (e *K8sComponentRemovedItemsError) PopulateRemovedAdmissionPlugins(node, component string, apiServerCLIFlags []string, removedAdmissionPlugins []string)

PopulateRemovedAdmissionPlugins populates the removed admission plugins.

func (*K8sComponentRemovedItemsError) PopulateRemovedCLIFlags

func (e *K8sComponentRemovedItemsError) PopulateRemovedCLIFlags(node, component string, apiServerCLIFlags []string, removedFlags []string)

PopulateRemovedCLIFlags populates the removed flags.

func (*K8sComponentRemovedItemsError) PopulateRemovedFeatureGates

func (e *K8sComponentRemovedItemsError) PopulateRemovedFeatureGates(node, component string, apiServerCLIFlags []string, removedFeatureGates []string)

PopulateRemovedFeatureGates populates the removed feature gates.

type K8sUpgradeChecks

type K8sUpgradeChecks struct {
	// contains filtered or unexported fields
}

K8sUpgradeChecks is a set of checks to run before upgrading k8s components.

func NewK8sUpgradeChecks

func NewK8sUpgradeChecks(state state.State, options UpgradeOptions, controlPlaneNodes []string) (*K8sUpgradeChecks, error)

NewK8sUpgradeChecks initializes and returns K8sUpgradeChecks.

func (*K8sUpgradeChecks) Run

func (checks *K8sUpgradeChecks) Run(ctx context.Context) error

Run executes the checks. nolint: gocyclo

type UpgradeOptions

type UpgradeOptions struct {
	FromVersion string
	ToVersion   string

	ControlPlaneEndpoint string
	LogOutput            io.Writer
	UpgradeKubelet       bool
	DryRun               bool
	// contains filtered or unexported fields
}

UpgradeOptions represents Kubernetes control plane upgrade settings.

func (*UpgradeOptions) Log

func (options *UpgradeOptions) Log(line string, args ...interface{})

Log writes the line to logger or to stdout if no logger was provided.

func (*UpgradeOptions) Path

func (options *UpgradeOptions) Path() string

Path returns upgrade path in a form "FromMajor.FromMinor->ToMajor.ToMinor" (e.g. "1.20->1.21"), or empty string, if one or both versions can't be parsed.

type UpgradeProvider

type UpgradeProvider interface {
	cluster.ClientProvider
	cluster.K8sProvider
}

UpgradeProvider are the cluster interfaces required by upgrade process.

Jump to

Keyboard shortcuts

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