Documentation ¶
Overview ¶
Package capi manages CAPI installation, provides default client for CAPI CRDs.
Package capi manages CAPI installation, provides default client for CAPI CRDs.
Index ¶
- func GetMetalClient(config *rest.Config) (runtimeclient.Client, error)
- type Cluster
- func (cluster *Cluster) ControlPlanes(ctx context.Context) (*unstructured.Unstructured, error)
- func (cluster *Cluster) Health(ctx context.Context) error
- func (cluster *Cluster) Name() string
- func (cluster *Cluster) Namespace() string
- func (cluster *Cluster) Scale(ctx context.Context, replicas int, nodes NodeGroup, setters ...ScaleOption) error
- func (cluster *Cluster) Sync(ctx context.Context) error
- func (cluster *Cluster) TalosClient(ctx context.Context) (*talosclient.Client, error)
- func (cluster *Cluster) TalosConfig(ctx context.Context) (*clientconfig.Config, error)
- func (cluster *Cluster) Workers(ctx context.Context) (*unstructured.UnstructuredList, error)
- type Config
- type DeployOption
- func WithClusterNamespace(val string) DeployOption
- func WithControlPlaneNodes(count int64) DeployOption
- func WithDeployOptions(val *DeployOptions) DeployOption
- func WithKubernetesVersion(version string) DeployOption
- func WithProvider(name string) DeployOption
- func WithProviderOptions(val interface{}) DeployOption
- func WithProviderVersion(version string) DeployOption
- func WithTalosVersion(version string) DeployOption
- func WithTemplate(data []byte) DeployOption
- func WithTemplateFile(path string) DeployOption
- func WithWorkerNodes(count int64) DeployOption
- type DeployOptions
- type Manager
- func (clusterAPI *Manager) CheckClusterReady(ctx context.Context, cluster *Cluster) error
- func (clusterAPI *Manager) DeployCluster(ctx context.Context, clusterName string, setters ...DeployOption) (*Cluster, error)
- func (clusterAPI *Manager) DestroyCluster(ctx context.Context, name, namespace string) error
- func (clusterAPI *Manager) FetchState(ctx context.Context) error
- func (clusterAPI *Manager) GetClient(context.Context) (client runtimeclient.Client, err error)
- func (clusterAPI *Manager) GetClientSet() *kubernetes.Clientset
- func (clusterAPI *Manager) GetKubeconfig(context.Context) (client.Kubeconfig, error)
- func (clusterAPI *Manager) GetManagerClient() client.Client
- func (clusterAPI *Manager) Install(ctx context.Context) error
- func (clusterAPI *Manager) InstallCore(ctx context.Context, kubeconfig client.Kubeconfig) error
- func (clusterAPI *Manager) InstallProvider(ctx context.Context, kubeconfig client.Kubeconfig, ...) error
- func (clusterAPI *Manager) NewCluster(ctx context.Context, name, namespace string) (*Cluster, error)
- func (clusterAPI *Manager) Version() string
- type NodeGroup
- type Options
- type ScaleOption
- type ScaleOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMetalClient ¶
func GetMetalClient(config *rest.Config) (runtimeclient.Client, error)
GetMetalClient builds k8s client with schemes required to access all the CAPI/Sidero/Talos components.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster attaches to the provisioned CAPI cluster and provides talos.Cluster.
func (*Cluster) ControlPlanes ¶
func (cluster *Cluster) ControlPlanes(ctx context.Context) (*unstructured.Unstructured, error)
ControlPlanes gets controlplane object from the management cluster.
func (*Cluster) Scale ¶
func (cluster *Cluster) Scale(ctx context.Context, replicas int, nodes NodeGroup, setters ...ScaleOption) error
Scale cluster nodes.
func (*Cluster) TalosClient ¶
TalosClient returns new talos client for the CAPI cluster.
func (*Cluster) TalosConfig ¶
TalosConfig returns talosconfig for the cluster.
func (*Cluster) Workers ¶
func (cluster *Cluster) Workers(ctx context.Context) (*unstructured.UnstructuredList, error)
Workers gets MachineDeployment list from the management cluster.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config custom implementation of config reader for clusterctl.
func (*Config) UnmarshalKey ¶
UnmarshalKey implements config.Reader.
type DeployOption ¶
type DeployOption func(opts *DeployOptions) error
DeployOption defines a single CAPI cluster creation option.
func WithClusterNamespace ¶
func WithClusterNamespace(val string) DeployOption
WithClusterNamespace sets cluster namespace.
func WithControlPlaneNodes ¶
func WithControlPlaneNodes(count int64) DeployOption
WithControlPlaneNodes creates a cluster with N control plane nodes.
func WithDeployOptions ¶
func WithDeployOptions(val *DeployOptions) DeployOption
WithDeployOptions sets deploy options as a struct.
func WithKubernetesVersion ¶
func WithKubernetesVersion(version string) DeployOption
WithKubernetesVersion sets Kubernetes version.
func WithProviderOptions ¶
func WithProviderOptions(val interface{}) DeployOption
WithProviderOptions sets provider specific deploy options.
func WithProviderVersion ¶
func WithProviderVersion(version string) DeployOption
WithProviderVersion picks provider with a specific version.
func WithTalosVersion ¶
func WithTalosVersion(version string) DeployOption
WithTalosVersion sets Talos version.
func WithTemplate ¶
func WithTemplate(data []byte) DeployOption
WithTemplate loads cluster template from memory.
func WithTemplateFile ¶
func WithTemplateFile(path string) DeployOption
WithTemplateFile load cluster template from the file.
func WithWorkerNodes ¶
func WithWorkerNodes(count int64) DeployOption
WithWorkerNodes creates a cluster with N worker nodes.
type DeployOptions ¶
type DeployOptions struct { Provider string ProviderVersion string ClusterName string ClusterNamespace string TalosVersion string KubernetesVersion string TemplateFile string Template []byte ControlPlaneNodes int64 WorkerNodes int64 // contains filtered or unexported fields }
DeployOptions cluster deployment options.
func DefaultDeployOptions ¶
func DefaultDeployOptions() *DeployOptions
DefaultDeployOptions default deployment settings.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager installs and controls cluster API installation.
func NewManager ¶
NewManager creates new Manager object.
func (*Manager) CheckClusterReady ¶
CheckClusterReady verifies that cluster ready from the CAPI point of view.
func (*Manager) DeployCluster ¶
func (clusterAPI *Manager) DeployCluster(ctx context.Context, clusterName string, setters ...DeployOption) (*Cluster, error)
DeployCluster creates a new cluster.
func (*Manager) DestroyCluster ¶
DestroyCluster deletes cluster.
func (*Manager) FetchState ¶
FetchState fetches infra providers and installed CAPI version if any.
func (*Manager) GetClientSet ¶
func (clusterAPI *Manager) GetClientSet() *kubernetes.Clientset
GetClientSet returns a kubernetes clientset to use.
func (*Manager) GetKubeconfig ¶
GetKubeconfig returns kubeconfig in clusterctl expected format.
func (*Manager) GetManagerClient ¶
GetManagerClient client returns instance of cluster API client.
func (*Manager) InstallCore ¶
InstallCore installs only core, global watched components (capi, cabpt, cacppt).
func (*Manager) InstallProvider ¶
func (clusterAPI *Manager) InstallProvider(ctx context.Context, kubeconfig client.Kubeconfig, provider infrastructure.Provider) error
InstallProvider installs a specific infrastructure provider and allows namespacing of the provider itself and its "watches".
type Options ¶
type Options struct { Proxy cluster.Proxy Kubeconfig client.Kubeconfig ClusterctlConfigPath string CoreProvider string ContextName string InfrastructureProviders []infrastructure.Provider BootstrapProviders []string ControlPlaneProviders []string WaitProviderTimeout time.Duration }
Options for the CAPI installer.
type ScaleOption ¶
type ScaleOption func(*ScaleOptions)
ScaleOption optional scale parameter setter.
func MachineDeploymentName ¶
func MachineDeploymentName(name string) ScaleOption
MachineDeploymentName allows setting machine deployment name for scaling clusters that have more than one machine group.
type ScaleOptions ¶
type ScaleOptions struct {
MachineDeploymentName string
}
ScaleOptions defines additional optional parameters for scale method.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package infrastructure contains infrastructure providers setup hooks and ready conditions.
|
Package infrastructure contains infrastructure providers setup hooks and ready conditions. |