Documentation ¶
Index ¶
- func CreateTempK0sConfig(blueprint *types.Blueprint) (string, error)
- func WriteK0sKubeConfig(k0sctlConfig string, kubeConfig *k8s.KubeConfig) error
- type Existing
- func (e *Existing) Exists() (bool, error)
- func (e *Existing) GetKubeConfig() *k8s.KubeConfig
- func (e *Existing) GetKubeConfigContext() string
- func (e *Existing) Install() error
- func (e *Existing) NeedsUpgrade(blueprint *types.Blueprint) (bool, error)
- func (e *Existing) Refresh() error
- func (e *Existing) Reset() error
- func (e *Existing) SetupClient() error
- func (e *Existing) Type() string
- func (e *Existing) Upgrade() error
- func (e *Existing) ValidateProviderUpgrade(blueprint *types.Blueprint) error
- func (e *Existing) WaitForNodes() error
- func (e *Existing) WaitForPods() error
- type K0s
- func (k *K0s) Exists() (bool, error)
- func (k *K0s) GetKubeConfig() *k8s.KubeConfig
- func (k *K0s) GetKubeConfigContext() string
- func (k *K0s) Install() error
- func (k *K0s) NeedsUpgrade(blueprint *types.Blueprint) (bool, error)
- func (k *K0s) Refresh() error
- func (k *K0s) Reset() error
- func (k *K0s) SetupClient() error
- func (k *K0s) Type() string
- func (k *K0s) Upgrade() error
- func (k *K0s) ValidateProviderUpgrade(blueprint *types.Blueprint) error
- func (k *K0s) WaitForNodes() error
- func (k *K0s) WaitForPods() error
- type Kind
- func (k *Kind) Exists() (bool, error)
- func (k *Kind) GetKubeConfig() *k8s.KubeConfig
- func (k *Kind) GetKubeConfigContext() string
- func (k *Kind) Install() error
- func (k *Kind) NeedsUpgrade(blueprint *types.Blueprint) (bool, error)
- func (k *Kind) Refresh() error
- func (k *Kind) Reset() error
- func (k *Kind) SetupClient() error
- func (k *Kind) Type() string
- func (k *Kind) Upgrade() error
- func (k *Kind) ValidateProviderUpgrade(blueprint *types.Blueprint) error
- func (k *Kind) WaitForNodes() error
- func (k *Kind) WaitForPods() error
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTempK0sConfig ¶
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) GetKubeConfig ¶
func (e *Existing) GetKubeConfig() *k8s.KubeConfig
GetKubeConfig returns the kubeconfig
func (*Existing) GetKubeConfigContext ¶
GetKubeConfigContext returns the kubeconfig context
func (*Existing) NeedsUpgrade ¶
NeedsUpgrade returns false for existing cluster
func (*Existing) SetupClient ¶
SetupClient sets up the kubernets client for the distro
func (*Existing) ValidateProviderUpgrade ¶
ValidateProviderUpgrade returns nil for existing cluster
func (*Existing) WaitForNodes ¶
WaitForNodes waits for nodes to be ready
func (*Existing) WaitForPods ¶
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) GetKubeConfig ¶
func (k *K0s) GetKubeConfig() *k8s.KubeConfig
GetKubeConfig returns the kubeconfig
func (*K0s) GetKubeConfigContext ¶
GetKubeConfigContext returns the kubeconfig context for k0s
func (*K0s) NeedsUpgrade ¶
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) SetupClient ¶
SetupClient sets up the kubernets client for the distro
func (*K0s) ValidateProviderUpgrade ¶
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 ¶
WaitForNodes waits for nodes 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) GetKubeConfig ¶
func (k *Kind) GetKubeConfig() *k8s.KubeConfig
GetKubeConfig returns the kubeconfig
func (*Kind) GetKubeConfigContext ¶
GetKubeConfigContext returns the kubeconfig context
func (*Kind) NeedsUpgrade ¶
NeedsUpgrade returns false for Kind
func (*Kind) SetupClient ¶
SetupClient sets up the kubernets client for the distro
func (*Kind) ValidateProviderUpgrade ¶
ValidateProviderUpgrade returns nil for Kind
func (*Kind) WaitForNodes ¶
WaitForNodes waits for nodes to be ready
func (*Kind) WaitForPods ¶
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 ¶
GetProvider returns a new provider