Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListProviders ¶ added in v0.4.0
ListProviders returns current supported providers.
func RegisterProvider ¶
RegisterProvider registers a provider.Factory by name.
Types ¶
type Provider ¶
type Provider interface { GetProviderName() string // Get command usage example. GetUsageExample(action string) string // create flags. GetCreateFlags() []types.Flag // Create flags of provider options. GetOptionFlags() []types.Flag // Join command flags. GetJoinFlags() []types.Flag // Delete command flags. GetDeleteFlags() []types.Flag // SSH command flags. GetSSHFlags() []types.Flag // Credential flags. GetCredentialFlags() []types.Flag // Generate cluster name. GenerateClusterName() string // create/join extra master args for different provider. GenerateMasterExtraArgs(cluster *types.Cluster, master types.Node) string // create/join extra worker args for different provider. GenerateWorkerExtraArgs(cluster *types.Cluster, worker types.Node) string // K3s create cluster interface. CreateK3sCluster() error // K3s join node interface. JoinK3sNode() error // K3s delete cluster interface. DeleteK3sCluster(f bool) error // K3s ssh node interface. SSHK3sNode(node string) error // K3s check cluster exist. IsClusterExist() (bool, []string, error) // merge exist cluster options MergeClusterOptions() error // describe detailed cluster information. DescribeCluster(kubecfg string) *types.ClusterInfo // get cluster simple information. GetCluster(kubecfg string) *types.ClusterInfo // get default ssh config for provider. GetSSHConfig() *types.SSH // set cluster configuration of provider. SetConfig(config []byte) error // validate create flags. CreateCheck() error // merge metadata configs for provider. SetMetadata(config *types.Metadata) // merge provider options. SetOptions(opt []byte) error // validate join flags. JoinCheck() error // get cluster config options. GetClusterOptions() []types.Flag // get create command options. GetCreateOptions() []types.Flag // convert options to specified provider option interface. GetProviderOptions(opt []byte) (interface{}, error) // persistent credential from flags to db. BindCredential() error // callback functions used for execute logic after create/join RegisterCallbacks(name, event string, fn func(interface{})) // UpgradeK3sCluster helps upgrade K3s cluster to specified version UpgradeK3sCluster(clusterName, installScript, channel, version, packageName, packagePath string) error }
Provider is an abstract, pluggable interface for k3s provider.
func GetProvider ¶
GetProvider creates an instance of the named provider, or nil if the name is unknown. The error return is only used if the named provider was known but failed to initialize.
Click to show internal directories.
Click to hide internal directories.