nutanix

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyImmutableFieldChanged

func AnyImmutableFieldChanged(oldNmc, newNmc *v1alpha1.NutanixMachineConfig) bool

func GetCredsFromEnv added in v0.13.0

func GetCredsFromEnv() credentials.BasicAuthCredential

GetCredsFromEnv returns nutanix credentials based on the environment.

func NeedsNewControlPlaneTemplate

func NeedsNewControlPlaneTemplate(oldSpec, newSpec *cluster.Spec, oldNmc, newNmc *v1alpha1.NutanixMachineConfig) bool

func NeedsNewKubeadmConfigTemplate

func NeedsNewKubeadmConfigTemplate(newWorkerNodeGroup *v1alpha1.WorkerNodeGroupConfiguration, oldWorkerNodeGroup *v1alpha1.WorkerNodeGroupConfiguration, oldWorkerNodeNmc *v1alpha1.NutanixMachineConfig, newWorkerNodeNmc *v1alpha1.NutanixMachineConfig) bool

func NeedsNewWorkloadTemplate

func NeedsNewWorkloadTemplate(oldSpec, newSpec *cluster.Spec, oldNmc, newNmc *v1alpha1.NutanixMachineConfig) bool

Types

type Client

type Client interface {
	GetSubnet(ctx context.Context, uuid string) (*v3.SubnetIntentResponse, error)
	ListSubnet(ctx context.Context, getEntitiesRequest *v3.DSMetadata) (*v3.SubnetListIntentResponse, error)

	GetImage(ctx context.Context, uuid string) (*v3.ImageIntentResponse, error)
	ListImage(ctx context.Context, getEntitiesRequest *v3.DSMetadata) (*v3.ImageListIntentResponse, error)

	GetCluster(ctx context.Context, uuid string) (*v3.ClusterIntentResponse, error)
	ListCluster(ctx context.Context, getEntitiesRequest *v3.DSMetadata) (*v3.ClusterListIntentResponse, error)

	GetCurrentLoggedInUser(ctx context.Context) (*v3.UserIntentResponse, error)
}

type Provider

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

Provider implements the Nutanix Provider.

func NewProvider

func NewProvider(
	datacenterConfig *v1alpha1.NutanixDatacenterConfig,
	machineConfigs map[string]*v1alpha1.NutanixMachineConfig,
	clusterConfig *v1alpha1.Cluster,
	providerKubectlClient ProviderKubectlClient,
	writer filewriter.FileWriter,
	nutanixClient Client,
	certValidator crypto.TlsValidator,
	httpClient *http.Client,
	now types.NowFunc,
) *Provider

NewProvider returns a new nutanix provider.

func (*Provider) BootstrapClusterOpts

func (p *Provider) BootstrapClusterOpts(_ *cluster.Spec) ([]bootstrapper.BootstrapClusterOption, error)

func (*Provider) BootstrapSetup

func (p *Provider) BootstrapSetup(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error

func (*Provider) ChangeDiff

func (p *Provider) ChangeDiff(currentSpec, newSpec *cluster.Spec) *types.ComponentChangeDiff

func (*Provider) DatacenterConfig

func (p *Provider) DatacenterConfig(_ *cluster.Spec) providers.DatacenterConfig

func (*Provider) DatacenterResourceType

func (p *Provider) DatacenterResourceType() string

func (*Provider) DeleteResources

func (p *Provider) DeleteResources(ctx context.Context, clusterSpec *cluster.Spec) error

func (*Provider) EnvMap

func (p *Provider) EnvMap(_ *cluster.Spec) (map[string]string, error)

func (*Provider) GenerateCAPISpecForCreate

func (p *Provider) GenerateCAPISpecForCreate(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) (controlPlaneSpec, workersSpec []byte, err error)

func (*Provider) GenerateCAPISpecForUpgrade

func (p *Provider) GenerateCAPISpecForUpgrade(ctx context.Context, bootstrapCluster, workloadCluster *types.Cluster, currentSpec, newClusterSpec *cluster.Spec) (controlPlaneSpec, workersSpec []byte, err error)

func (*Provider) GenerateMHC

func (p *Provider) GenerateMHC(_ *cluster.Spec) ([]byte, error)

func (*Provider) GenerateStorageClass

func (p *Provider) GenerateStorageClass() []byte

func (*Provider) GetDeployments

func (p *Provider) GetDeployments() map[string][]string

func (*Provider) GetInfrastructureBundle

func (p *Provider) GetInfrastructureBundle(clusterSpec *cluster.Spec) *types.InfrastructureBundle

func (*Provider) InstallCustomProviderComponents

func (p *Provider) InstallCustomProviderComponents(ctx context.Context, kubeconfigFile string) error

func (*Provider) MachineConfigs

func (p *Provider) MachineConfigs(_ *cluster.Spec) []providers.MachineConfig

func (*Provider) MachineDeploymentsToDelete

func (p *Provider) MachineDeploymentsToDelete(workloadCluster *types.Cluster, currentSpec, newSpec *cluster.Spec) []string

func (*Provider) MachineResourceType

func (p *Provider) MachineResourceType() string

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) PostBootstrapDeleteForUpgrade

func (p *Provider) PostBootstrapDeleteForUpgrade(ctx context.Context) error

func (*Provider) PostBootstrapSetup

func (p *Provider) PostBootstrapSetup(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error

func (*Provider) PostBootstrapSetupUpgrade

func (p *Provider) PostBootstrapSetupUpgrade(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error

func (*Provider) PostClusterDeleteValidate

func (p *Provider) PostClusterDeleteValidate(ctx context.Context, managementCluster *types.Cluster) error

func (*Provider) PostMoveManagementToBootstrap

func (p *Provider) PostMoveManagementToBootstrap(ctx context.Context, bootstrapCluster *types.Cluster) error

func (*Provider) PostWorkloadInit

func (p *Provider) PostWorkloadInit(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*Provider) PreCAPIInstallOnBootstrap

func (p *Provider) PreCAPIInstallOnBootstrap(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*Provider) RunPostControlPlaneCreation

func (p *Provider) RunPostControlPlaneCreation(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster) error

func (*Provider) RunPostControlPlaneUpgrade

func (p *Provider) RunPostControlPlaneUpgrade(ctx context.Context, oldClusterSpec *cluster.Spec, clusterSpec *cluster.Spec, workloadCluster *types.Cluster, managementCluster *types.Cluster) error

func (*Provider) SetupAndValidateCreateCluster

func (p *Provider) SetupAndValidateCreateCluster(ctx context.Context, clusterSpec *cluster.Spec) error

func (*Provider) SetupAndValidateDeleteCluster

func (p *Provider) SetupAndValidateDeleteCluster(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*Provider) SetupAndValidateUpgradeCluster

func (p *Provider) SetupAndValidateUpgradeCluster(ctx context.Context, _ *types.Cluster, clusterSpec *cluster.Spec, _ *cluster.Spec) error

SetupAndValidateUpgradeCluster - Performs necessary setup and validations for upgrade cluster operation.

func (*Provider) UpdateKubeConfig

func (p *Provider) UpdateKubeConfig(content *[]byte, clusterName string) error

func (*Provider) UpdateSecrets

func (p *Provider) UpdateSecrets(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*Provider) UpgradeNeeded

func (p *Provider) UpgradeNeeded(ctx context.Context, newSpec, currentSpec *cluster.Spec, cluster *types.Cluster) (bool, error)

func (*Provider) ValidateNewSpec

func (p *Provider) ValidateNewSpec(_ context.Context, _ *types.Cluster, _ *cluster.Spec) error

func (*Provider) Version

func (p *Provider) Version(clusterSpec *cluster.Spec) string

type ProviderKubectlClient

type ProviderKubectlClient interface {
	ApplyKubeSpecFromBytes(ctx context.Context, cluster *types.Cluster, data []byte) error
	SetEksaControllerEnvVar(ctx context.Context, envVar, envVarVal, kubeconfig string) error
	GetEksaCluster(ctx context.Context, cluster *types.Cluster, clusterName string) (*v1alpha1.Cluster, error)
	GetEksaNutanixDatacenterConfig(ctx context.Context, nutanixDatacenterConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.NutanixDatacenterConfig, error)
	GetEksaNutanixMachineConfig(ctx context.Context, nutanixMachineConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.NutanixMachineConfig, error)
	GetKubeadmControlPlane(ctx context.Context, cluster *types.Cluster, clusterName string, opts ...executables.KubectlOpt) (*kubeadmv1beta1.KubeadmControlPlane, error)
	GetMachineDeployment(ctx context.Context, workerNodeGroupName string, opts ...executables.KubectlOpt) (*clusterv1.MachineDeployment, error)
	SearchNutanixMachineConfig(ctx context.Context, name string, kubeconfigFile string, namespace string) ([]*v1alpha1.NutanixMachineConfig, error)
	SearchNutanixDatacenterConfig(ctx context.Context, name string, kubeconfigFile string, namespace string) ([]*v1alpha1.NutanixDatacenterConfig, error)
	DeleteEksaNutanixDatacenterConfig(ctx context.Context, nutanixDatacenterConfigName string, kubeconfigFile string, namespace string) error
	DeleteEksaNutanixMachineConfig(ctx context.Context, nutanixMachineConfigName string, kubeconfigFile string, namespace string) error
}

type TemplateBuilder

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

TemplateBuilder builds templates for nutanix.

func NewNutanixTemplateBuilder

func NewNutanixTemplateBuilder(
	datacenterSpec *v1alpha1.NutanixDatacenterConfigSpec,
	controlPlaneMachineSpec,
	etcdMachineSpec *v1alpha1.NutanixMachineConfigSpec,
	workerNodeGroupMachineSpecs map[string]v1alpha1.NutanixMachineConfigSpec,
	creds credentials.BasicAuthCredential,
	now types.NowFunc,
) *TemplateBuilder

func (*TemplateBuilder) GenerateCAPISpecControlPlane

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

func (*TemplateBuilder) GenerateCAPISpecSecret

func (ntb *TemplateBuilder) GenerateCAPISpecSecret(clusterSpec *cluster.Spec, buildOptions ...providers.BuildMapOption) (content []byte, err error)

func (*TemplateBuilder) GenerateCAPISpecWorkers

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

type Validator

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

Validator is a client to validate nutanix resources.

func NewValidator

func NewValidator(client Client, certValidator crypto.TlsValidator, httpClient *http.Client) *Validator

NewValidator returns a new validator client.

func (*Validator) ValidateDatacenterConfig added in v0.13.0

func (v *Validator) ValidateDatacenterConfig(ctx context.Context, config *anywherev1.NutanixDatacenterConfig) error

ValidateDatacenterConfig validates the datacenter config.

func (*Validator) ValidateMachineConfig

func (v *Validator) ValidateMachineConfig(ctx context.Context, config *anywherev1.NutanixMachineConfig) error

ValidateMachineConfig validates the Prism Element cluster, subnet, and image for the machine.

Directories

Path Synopsis
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