distro

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTempK0sConfig

func CreateTempK0sConfig(blueprint *types.Blueprint) (string, error)

CreateTempK0sConfig creates a k0s config file from the blueprint in the tmp directory

func WriteK0sKubeConfig

func WriteK0sKubeConfig(k0sctlConfig string, kubeConfig *k8s.KubeConfig) error

Types

type Existing

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

Existing is the existing provider

func NewExistingProvider

func NewExistingProvider(blueprint *types.Blueprint, kubeConfig *k8s.KubeConfig) *Existing

NewExistingProvider returns a new existing provider

func (*Existing) Exists

func (e *Existing) Exists() (bool, error)

Exists checks if the cluster exists

func (*Existing) GetKubeConfig

func (e *Existing) GetKubeConfig() *k8s.KubeConfig

GetKubeConfig returns the kubeconfig

func (*Existing) GetKubeConfigContext

func (e *Existing) GetKubeConfigContext() string

GetKubeConfigContext returns the kubeconfig context

func (*Existing) Install

func (e *Existing) Install() error

Install is a noop for existing cluster

func (*Existing) NeedsUpgrade

func (e *Existing) NeedsUpgrade(blueprint *types.Blueprint) (bool, error)

NeedsUpgrade returns false for existing cluster

func (*Existing) Refresh

func (e *Existing) Refresh() error

Refresh is a noop for existing cluster

func (*Existing) Reset

func (e *Existing) Reset() error

Reset resets the existing cluster

func (*Existing) SetupClient

func (e *Existing) SetupClient() error

SetupClient sets up the kubernets client for the distro

func (*Existing) Type

func (e *Existing) Type() string

Type returns the type of the provider

func (*Existing) Upgrade

func (e *Existing) Upgrade() error

Update updates the existing cluster

func (*Existing) ValidateProviderUpgrade

func (e *Existing) ValidateProviderUpgrade(blueprint *types.Blueprint) error

ValidateProviderUpgrade returns nil for existing cluster

func (*Existing) WaitForNodes

func (e *Existing) WaitForNodes() error

WaitForNodes waits for nodes to be ready

func (*Existing) WaitForPods

func (e *Existing) WaitForPods() error

WaitForPods waits for pods to be ready

type K0s

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

K0s is the k0s provider

func NewK0sProvider

func NewK0sProvider(blueprint *types.Blueprint, kubeConfig *k8s.KubeConfig) *K0s

NewK0sProvider returns a new k0s provider

func (*K0s) Exists

func (k *K0s) Exists() (bool, error)

Exists checks if k0s exists using k0sctl

func (*K0s) GetKubeConfig

func (k *K0s) GetKubeConfig() *k8s.KubeConfig

GetKubeConfig returns the kubeconfig

func (*K0s) GetKubeConfigContext

func (k *K0s) GetKubeConfigContext() string

GetKubeConfigContext returns the kubeconfig context for k0s

func (*K0s) Install

func (k *K0s) Install() error

Install installs k0s using k0sctl

func (*K0s) NeedsUpgrade

func (k *K0s) NeedsUpgrade(blueprint *types.Blueprint) (bool, error)

NeedsUpgrade checks if an upgrade of the provider is required return true if the providedVersion is greater than the installed Version return false if the versions are equal throw an error if the providedVersion is lower than the installed Version (don't support downgrade)

func (*K0s) Refresh

func (k *K0s) Refresh() error

Refresh reapplies k0sctl config with the current version of blueprint

func (*K0s) Reset

func (k *K0s) Reset() error

Reset resets k0s using k0sctl

func (*K0s) SetupClient

func (k *K0s) SetupClient() error

SetupClient sets up the kubernets client for the distro

func (*K0s) Type

func (k *K0s) Type() string

Type returns the type of the provider

func (*K0s) Upgrade

func (k *K0s) Upgrade() error

Update updates k0s using k0sctl

func (*K0s) ValidateProviderUpgrade

func (k *K0s) ValidateProviderUpgrade(blueprint *types.Blueprint) error

ValidateProviderUpgrade does some validation that the controller nodes will be able to run the new version of k0s proposed in the blueprint First download new version of k0s binary and place in tmp folder Use new binary to run k0s config validate which validates config will work on new version In some k0s upgrade scenarios (such as previously existing config fields that have been removed in newer version) it requires user to update the node configs

func (*K0s) WaitForNodes

func (k *K0s) WaitForNodes() error

WaitForNodes waits for nodes to be ready

func (*K0s) WaitForPods

func (k *K0s) WaitForPods() error

WaitForPods waits for pods to be ready

type Kind

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

Kind is the kind provider

func NewKindProvider

func NewKindProvider(blueprint *types.Blueprint, kubeConfig *k8s.KubeConfig) *Kind

NewKindProvider returns a new kind provider

func (*Kind) Exists

func (k *Kind) Exists() (bool, error)

Exists checks if kind exists

func (*Kind) GetKubeConfig

func (k *Kind) GetKubeConfig() *k8s.KubeConfig

GetKubeConfig returns the kubeconfig

func (*Kind) GetKubeConfigContext

func (k *Kind) GetKubeConfigContext() string

GetKubeConfigContext returns the kubeconfig context

func (*Kind) Install

func (k *Kind) Install() error

Install creates a new kind cluster

func (*Kind) NeedsUpgrade

func (k *Kind) NeedsUpgrade(blueprint *types.Blueprint) (bool, error)

NeedsUpgrade returns false for Kind

func (*Kind) Refresh

func (k *Kind) Refresh() error

func (*Kind) Reset

func (k *Kind) Reset() error

Reset deletes the kind cluster

func (*Kind) SetupClient

func (k *Kind) SetupClient() error

SetupClient sets up the kubernets client for the distro

func (*Kind) Type

func (k *Kind) Type() string

Type returns the type of the provider

func (*Kind) Upgrade

func (k *Kind) Upgrade() error

func (*Kind) ValidateProviderUpgrade

func (k *Kind) ValidateProviderUpgrade(blueprint *types.Blueprint) error

ValidateProviderUpgrade returns nil for Kind

func (*Kind) WaitForNodes

func (k *Kind) WaitForNodes() error

WaitForNodes waits for nodes to be ready

func (*Kind) WaitForPods

func (k *Kind) WaitForPods() error

WaitForPods waits for pods to be ready

type Provider

type Provider interface {
	Install() error
	Refresh() error
	Upgrade() error
	SetupClient() error
	Exists() (bool, error)
	Reset() error
	GetKubeConfigContext() string
	Type() string
	GetKubeConfig() *k8s.KubeConfig
	WaitForNodes() error
	WaitForPods() error
	NeedsUpgrade(blueprint *types.Blueprint) (bool, error)
	ValidateProviderUpgrade(blueprint *types.Blueprint) error
}

Provider is the interface for a distro provider

func GetProvider

func GetProvider(blueprint *types.Blueprint, kubeConfig *k8s.KubeConfig) (Provider, error)

GetProvider returns a new provider

Jump to

Keyboard shortcuts

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