tinkerbell

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(
	datacenterConfig *v1alpha1.TinkerbellDatacenterConfig,
	machineConfigs map[string]*v1alpha1.TinkerbellMachineConfig,
	clusterConfig *v1alpha1.Cluster,
	writer filewriter.FileWriter,
	providerKubectlClient ProviderKubectlClient,
	providerTinkbellClient TinkerbellClients,
	now types.NowFunc,
	skipIpCheck bool,
	hardwareConfigFile string,
	skipPowerActions bool,
) *tinkerbellProvider

func NewProviderCustomDep added in v0.8.0

func NewProviderCustomDep(
	datacenterConfig *v1alpha1.TinkerbellDatacenterConfig,
	machineConfigs map[string]*v1alpha1.TinkerbellMachineConfig,
	clusterConfig *v1alpha1.Cluster,
	writer filewriter.FileWriter,
	providerKubectlClient ProviderKubectlClient,
	providerTinkClient ProviderTinkClient,
	pbnjClient ProviderPbnjClient,
	netClient networkutils.NetClient,
	now types.NowFunc,
	skipIpCheck bool,
	hardwareConfigFile string,
	skipPowerActions bool,
) *tinkerbellProvider

func NewTinkerbellTemplateBuilder

func NewTinkerbellTemplateBuilder(datacenterSpec *v1alpha1.TinkerbellDatacenterConfigSpec, controlPlaneMachineSpec, etcdMachineSpec *v1alpha1.TinkerbellMachineConfigSpec, workerNodeGroupMachineSpecs map[string]v1alpha1.TinkerbellMachineConfigSpec, now types.NowFunc) providers.TemplateBuilder

Types

type ProviderKubectlClient

type ProviderKubectlClient interface {
	ApplyHardware(ctx context.Context, hardwareYaml string, kubeConfFile string) error
	DeleteEksaDatacenterConfig(ctx context.Context, eksaTinkerbellDatacenterResourceType string, tinkerbellDatacenterConfigName string, kubeconfigFile string, namespace string) error
	DeleteEksaMachineConfig(ctx context.Context, eksaTinkerbellMachineResourceType string, tinkerbellMachineConfigName string, kubeconfigFile string, namespace string) error
	GetMachineDeployment(ctx context.Context, machineDeploymentName string, opts ...executables.KubectlOpt) (*clusterv1.MachineDeployment, error)
}

TODO: Add necessary kubectl functions here

type ProviderPbnjClient added in v0.8.0

type ProviderPbnjClient interface {
	GetPowerState(ctx context.Context, bmc pbnj.BmcSecretConfig) (pbnj.PowerState, error)
}

type ProviderTinkClient added in v0.8.0

type ProviderTinkClient interface {
	GetHardware(ctx context.Context) ([]*tinkhardware.Hardware, error)
	GetWorkflow(ctx context.Context) ([]*tinkworkflow.Workflow, error)
}

type SSHAuthKeyGenerator added in v0.8.0

type SSHAuthKeyGenerator interface {
	GenerateSSHAuthKey(filewriter.FileWriter) (string, error)
}

KeyGenerator generates ssh keys and writes them to a FileWriter.

type TinkerbellClients added in v0.8.0

type TinkerbellClients struct {
	ProviderTinkClient ProviderTinkClient
	ProviderPbnjClient ProviderPbnjClient
}

type TinkerbellTemplateBuilder

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

func (*TinkerbellTemplateBuilder) CPMachineTemplateName

func (vs *TinkerbellTemplateBuilder) CPMachineTemplateName(clusterName string) string

func (*TinkerbellTemplateBuilder) EtcdMachineTemplateName

func (vs *TinkerbellTemplateBuilder) EtcdMachineTemplateName(clusterName string) string

func (*TinkerbellTemplateBuilder) GenerateCAPISpecControlPlane

func (vs *TinkerbellTemplateBuilder) GenerateCAPISpecControlPlane(clusterSpec *cluster.Spec, buildOptions ...providers.BuildMapOption) (content []byte, err error)

func (*TinkerbellTemplateBuilder) GenerateCAPISpecWorkers

func (vs *TinkerbellTemplateBuilder) GenerateCAPISpecWorkers(clusterSpec *cluster.Spec, workloadTemplateNames, kubeadmconfigTemplateNames map[string]string) (content []byte, err error)

func (*TinkerbellTemplateBuilder) KubeadmConfigTemplateName added in v0.7.1

func (vs *TinkerbellTemplateBuilder) KubeadmConfigTemplateName(clusterName, workerNodeGroupName string) string

func (*TinkerbellTemplateBuilder) WorkerMachineTemplateName

func (vs *TinkerbellTemplateBuilder) WorkerMachineTemplateName(clusterName, workerNodeGroupName string) string

type Validator added in v0.8.0

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

func NewValidator added in v0.8.0

func NewValidator(tink ProviderTinkClient, netClient networkutils.NetClient, hardwareConfig hardware.HardwareConfig, pbnjClient ProviderPbnjClient) *Validator

func (*Validator) ValidateBMCSecretCreds added in v0.8.0

func (v *Validator) ValidateBMCSecretCreds(ctx context.Context, hc hardware.HardwareConfig) error

func (*Validator) ValidateClusterMachineConfigs added in v0.8.0

func (v *Validator) ValidateClusterMachineConfigs(ctx context.Context, tinkerbellClusterSpec *spec) error

TODO: dry out machine configs validations

func (*Validator) ValidateHardwareConfig added in v0.8.0

func (v *Validator) ValidateHardwareConfig(ctx context.Context, hardwareConfigFile string, skipPowerActions bool) error

func (*Validator) ValidateMinimumRequiredTinkerbellHardwareAvailable added in v0.8.0

func (v *Validator) ValidateMinimumRequiredTinkerbellHardwareAvailable(spec v1alpha1.ClusterSpec) error

ValidateMinimumRequiredTinkerbellHardwareAvailable ensures there is sufficient hardware registered relative to the sum of requested control plane, etcd and worker node counts. The system requires hardware >= to requested provisioning. ValidateMinimumRequiredTinkerbellHardwareAvailable requires v.ValidateHardwareConfig() to be called first.

func (*Validator) ValidateTinkerbellConfig added in v0.8.0

func (v *Validator) ValidateTinkerbellConfig(ctx context.Context, datacenterConfig *v1alpha1.TinkerbellDatacenterConfig) error

func (*Validator) ValidateTinkerbellTemplate added in v0.8.0

func (v *Validator) ValidateTinkerbellTemplate(ctx context.Context, tinkerbellIp string, templateConfig *v1alpha1.TinkerbellTemplateConfig) error

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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