Documentation ¶
Index ¶
- func AnyImmutableFieldChanged(oldNmc, newNmc *v1alpha1.NutanixMachineConfig) bool
- func CAPXSecretName(spec *cluster.Spec) string
- func EKSASecretName(spec *cluster.Spec) string
- func GetCredsFromEnv() credentials.BasicAuthCredential
- func NeedsNewControlPlaneTemplate(oldSpec, newSpec *cluster.Spec, oldNmc, newNmc *v1alpha1.NutanixMachineConfig) bool
- func NeedsNewWorkloadTemplate(oldSpec, newSpec *cluster.Spec, oldNmc, newNmc *v1alpha1.NutanixMachineConfig, ...) bool
- type BaseControlPlane
- type Client
- type ClientCache
- type ControlPlane
- type ControlPlaneBuilder
- type Defaulter
- type IPValidator
- type Provider
- func (p *Provider) BootstrapClusterOpts(_ *cluster.Spec) ([]bootstrapper.BootstrapClusterOption, error)
- func (p *Provider) BootstrapSetup(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error
- func (p *Provider) ChangeDiff(currentComponents, newComponents *cluster.ManagementComponents) *types.ComponentChangeDiff
- func (p *Provider) DatacenterConfig(_ *cluster.Spec) providers.DatacenterConfig
- func (p *Provider) DatacenterResourceType() string
- func (p *Provider) DeleteResources(ctx context.Context, clusterSpec *cluster.Spec) error
- func (p *Provider) EnvMap(_ *cluster.ManagementComponents, _ *cluster.Spec) (map[string]string, error)
- func (p *Provider) GenerateCAPISpecForCreate(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) (controlPlaneSpec, workersSpec []byte, err error)
- func (p *Provider) GenerateCAPISpecForUpgrade(ctx context.Context, bootstrapCluster, workloadCluster *types.Cluster, ...) (controlPlaneSpec, workersSpec []byte, err error)
- func (p *Provider) GenerateMHC(_ *cluster.Spec) ([]byte, error)
- func (p *Provider) GenerateStorageClass() []byte
- func (p *Provider) GetDeployments() map[string][]string
- func (p *Provider) GetInfrastructureBundle(components *cluster.ManagementComponents) *types.InfrastructureBundle
- func (p *Provider) InstallCustomProviderComponents(ctx context.Context, kubeconfigFile string) error
- func (p *Provider) MachineConfigs(_ *cluster.Spec) []providers.MachineConfig
- func (p *Provider) MachineDeploymentsToDelete(workloadCluster *types.Cluster, currentSpec, newSpec *cluster.Spec) []string
- func (p *Provider) MachineResourceType() string
- func (p *Provider) Name() string
- func (p *Provider) PostBootstrapDeleteForUpgrade(ctx context.Context, cluster *types.Cluster) error
- func (p *Provider) PostBootstrapSetup(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error
- func (p *Provider) PostBootstrapSetupUpgrade(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error
- func (p *Provider) PostClusterDeleteValidate(ctx context.Context, managementCluster *types.Cluster) error
- func (p *Provider) PostMoveManagementToBootstrap(ctx context.Context, bootstrapCluster *types.Cluster) error
- func (p *Provider) PostWorkloadInit(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error
- func (p *Provider) PreCAPIInstallOnBootstrap(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error
- func (p *Provider) PreCoreComponentsUpgrade(ctx context.Context, cluster *types.Cluster, ...) error
- func (p *Provider) RunPostControlPlaneCreation(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster) error
- func (p *Provider) RunPostControlPlaneUpgrade(ctx context.Context, oldClusterSpec *cluster.Spec, clusterSpec *cluster.Spec, ...) error
- func (p *Provider) SetupAndValidateCreateCluster(ctx context.Context, clusterSpec *cluster.Spec) error
- func (p *Provider) SetupAndValidateDeleteCluster(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error
- func (p *Provider) SetupAndValidateUpgradeCluster(ctx context.Context, _ *types.Cluster, clusterSpec *cluster.Spec, ...) error
- func (p *Provider) SetupAndValidateUpgradeManagementComponents(_ context.Context, _ *cluster.Spec) error
- func (p *Provider) UpdateKubeConfig(content *[]byte, clusterName string) error
- func (p *Provider) UpdateSecrets(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error
- func (p *Provider) UpgradeNeeded(ctx context.Context, newSpec, currentSpec *cluster.Spec, ...) (bool, error)
- func (p *Provider) ValidateNewSpec(_ context.Context, _ *types.Cluster, _ *cluster.Spec) error
- func (p *Provider) Version(components *cluster.ManagementComponents) string
- type ProviderKubectlClient
- type TemplateBuilder
- func (ntb *TemplateBuilder) GenerateCAPISpecControlPlane(clusterSpec *cluster.Spec, buildOptions ...providers.BuildMapOption) (content []byte, err error)
- func (ntb *TemplateBuilder) GenerateCAPISpecSecret(clusterSpec *cluster.Spec, buildOptions ...providers.BuildMapOption) (content []byte, err error)
- func (ntb *TemplateBuilder) GenerateCAPISpecWorkers(clusterSpec *cluster.Spec, ...) (content []byte, err error)
- func (ntb *TemplateBuilder) GenerateEKSASpecSecret(clusterSpec *cluster.Spec, buildOptions ...providers.BuildMapOption) (content []byte, err error)
- type Validator
- func (v *Validator) ValidateClusterSpec(ctx context.Context, spec *cluster.Spec, creds credentials.BasicAuthCredential) error
- func (v *Validator) ValidateDatacenterConfig(ctx context.Context, client Client, config *anywherev1.NutanixDatacenterConfig) error
- func (v *Validator) ValidateMachineConfig(ctx context.Context, client Client, config *anywherev1.NutanixMachineConfig) error
- type Workers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyImmutableFieldChanged ¶
func AnyImmutableFieldChanged(oldNmc, newNmc *v1alpha1.NutanixMachineConfig) bool
func CAPXSecretName ¶ added in v0.15.0
CAPXSecretName returns the name of the secret containing the credentials for the nutanix prism central and is used by the CAPX controller.
func EKSASecretName ¶ added in v0.15.0
EKSASecretName returns the name of the secret containing the credentials for the nutanix prism central and is used by the EKS-Anywhere controller.
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 NeedsNewWorkloadTemplate ¶
func NeedsNewWorkloadTemplate(oldSpec, newSpec *cluster.Spec, oldNmc, newNmc *v1alpha1.NutanixMachineConfig, oldWorker, newWorker v1alpha1.WorkerNodeGroupConfiguration) bool
NeedsNewWorkloadTemplate determines if a new workload template is needed.
Types ¶
type BaseControlPlane ¶ added in v0.15.0
type BaseControlPlane = clusterapi.ControlPlane[*nutanixv1.NutanixCluster, *nutanixv1.NutanixMachineTemplate]
BaseControlPlane represents a CAPI Nutanix control plane.
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) GetProject(ctx context.Context, uuid string) (*v3.Project, error) ListProject(ctx context.Context, getEntitiesRequest *v3.DSMetadata) (*v3.ProjectListResponse, error) GetCurrentLoggedInUser(ctx context.Context) (*v3.UserIntentResponse, error) ListCategories(ctx context.Context, getEntitiesRequest *v3.CategoryListMetadata) (*v3.CategoryKeyListResponse, error) GetCategoryKey(ctx context.Context, name string) (*v3.CategoryKeyStatus, error) ListCategoryValues(ctx context.Context, name string, getEntitiesRequest *v3.CategoryListMetadata) (*v3.CategoryValueListResponse, error) GetCategoryValue(ctx context.Context, name string, value string) (*v3.CategoryValueStatus, error) GetCategoryQuery(ctx context.Context, query *v3.CategoryQueryInput) (*v3.CategoryQueryResponse, error) }
type ClientCache ¶ added in v0.15.0
type ClientCache struct {
// contains filtered or unexported fields
}
ClientCache is a map of NutanixDatacenterConfig name to Nutanix client.
func NewClientCache ¶ added in v0.15.0
func NewClientCache() *ClientCache
NewClientCache returns a new ClientCache.
func (*ClientCache) GetNutanixClient ¶ added in v0.15.0
func (cb *ClientCache) GetNutanixClient(datacenterConfig *anywherev1.NutanixDatacenterConfig, creds credentials.BasicAuthCredential) (Client, error)
GetNutanixClient returns a Nutanix client for the given NutanixDatacenterConfig.
type ControlPlane ¶ added in v0.15.0
type ControlPlane struct { BaseControlPlane ConfigMaps []*corev1.ConfigMap ClusterResourceSets []*addonsv1.ClusterResourceSet }
ControlPlane holds the Nutanix specific objects for a CAPI Nutanix control plane.
func ControlPlaneSpec ¶ added in v0.15.0
func ControlPlaneSpec(ctx context.Context, logger logr.Logger, client kubernetes.Client, spec *cluster.Spec) (*ControlPlane, error)
ControlPlaneSpec builds a nutanix ControlPlane definition based on an eks-a cluster spec.
func (ControlPlane) Objects ¶ added in v0.15.0
func (p ControlPlane) Objects() []kubernetes.Object
Objects returns the control plane objects associated with the Nutanix cluster.
type ControlPlaneBuilder ¶ added in v0.15.0
type ControlPlaneBuilder struct { BaseBuilder *yamlcapi.ControlPlaneBuilder[*nutanixv1.NutanixCluster, *nutanixv1.NutanixMachineTemplate] ControlPlane *ControlPlane }
ControlPlaneBuilder defines the builder for all objects in the CAPI Nutanix control plane.
func (*ControlPlaneBuilder) BuildFromParsed ¶ added in v0.15.0
func (b *ControlPlaneBuilder) BuildFromParsed(lookup yamlutil.ObjectLookup) error
BuildFromParsed implements the base yamlcapi.BuildFromParsed and processes any additional objects for the Nutanix control plane.
type Defaulter ¶ added in v0.15.0
type Defaulter struct{}
Defaulter implements the defaulting logic for NutanixDatacenterConfig and NutanixMachineConfig.
func NewDefaulter ¶ added in v0.15.0
func NewDefaulter() *Defaulter
NewDefaulter returns a new Defaulter.
func (*Defaulter) SetDefaultsForDatacenterConfig ¶ added in v0.15.0
func (d *Defaulter) SetDefaultsForDatacenterConfig(dcConf anywherev1.NutanixDatacenterConfig)
SetDefaultsForDatacenterConfig sets defaults for a NutanixDatacenterConfig.
func (*Defaulter) SetDefaultsForMachineConfig ¶ added in v0.15.0
func (d *Defaulter) SetDefaultsForMachineConfig(machineConf anywherev1.NutanixMachineConfig)
SetDefaultsForMachineConfig sets defaults for a NutanixMachineConfig.
type IPValidator ¶ added in v0.16.0
type IPValidator interface {
ValidateControlPlaneIPUniqueness(cluster *anywherev1.Cluster) error
}
IPValidator is an interface that defines methods to validate the control plane IP.
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, clientCache *ClientCache, ipValidator IPValidator, certValidator crypto.TlsValidator, httpClient *http.Client, now types.NowFunc, skipIPCheck bool, ) *Provider
NewProvider returns a new nutanix provider.
func (*Provider) BootstrapClusterOpts ¶
func (p *Provider) BootstrapClusterOpts(_ *cluster.Spec) ([]bootstrapper.BootstrapClusterOption, error)
func (*Provider) BootstrapSetup ¶
func (*Provider) ChangeDiff ¶
func (p *Provider) ChangeDiff(currentComponents, newComponents *cluster.ManagementComponents) *types.ComponentChangeDiff
ChangeDiff returns the component change diff for the provider.
func (*Provider) DatacenterConfig ¶
func (p *Provider) DatacenterConfig(_ *cluster.Spec) providers.DatacenterConfig
func (*Provider) DatacenterResourceType ¶
func (*Provider) DeleteResources ¶
func (*Provider) EnvMap ¶
func (p *Provider) EnvMap(_ *cluster.ManagementComponents, _ *cluster.Spec) (map[string]string, error)
EnvMap returns the environment variables for the provider.
func (*Provider) GenerateCAPISpecForCreate ¶
func (*Provider) GenerateCAPISpecForUpgrade ¶
func (*Provider) GenerateMHC ¶
GenerateMHC returns MachineHealthCheck for the cluster in yaml format.
func (*Provider) GenerateStorageClass ¶
func (*Provider) GetDeployments ¶
func (*Provider) GetInfrastructureBundle ¶
func (p *Provider) GetInfrastructureBundle(components *cluster.ManagementComponents) *types.InfrastructureBundle
GetInfrastructureBundle returns the infrastructure bundle for the provider.
func (*Provider) InstallCustomProviderComponents ¶
func (*Provider) MachineConfigs ¶
func (p *Provider) MachineConfigs(_ *cluster.Spec) []providers.MachineConfig
MachineConfigs returns a MachineConfig slice.
func (*Provider) MachineDeploymentsToDelete ¶
func (*Provider) MachineResourceType ¶
func (*Provider) PostBootstrapDeleteForUpgrade ¶
PostBootstrapDeleteForUpgrade runs any provider-specific operations after bootstrap cluster has been deleted.
func (*Provider) PostBootstrapSetup ¶
func (*Provider) PostBootstrapSetupUpgrade ¶
func (*Provider) PostClusterDeleteValidate ¶
func (*Provider) PostMoveManagementToBootstrap ¶
func (*Provider) PostWorkloadInit ¶
func (*Provider) PreCAPIInstallOnBootstrap ¶
func (*Provider) PreCoreComponentsUpgrade ¶ added in v0.15.0
func (p *Provider) PreCoreComponentsUpgrade( ctx context.Context, cluster *types.Cluster, managementComponents *cluster.ManagementComponents, clusterSpec *cluster.Spec, ) error
PreCoreComponentsUpgrade staisfies the Provider interface.
func (*Provider) RunPostControlPlaneCreation ¶
func (*Provider) RunPostControlPlaneUpgrade ¶
func (*Provider) SetupAndValidateCreateCluster ¶
func (*Provider) SetupAndValidateDeleteCluster ¶
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) SetupAndValidateUpgradeManagementComponents ¶ added in v0.19.0
func (p *Provider) SetupAndValidateUpgradeManagementComponents(_ context.Context, _ *cluster.Spec) error
SetupAndValidateUpgradeManagementComponents performs necessary setup for upgrade management components operation.
func (*Provider) UpdateKubeConfig ¶
func (*Provider) UpdateSecrets ¶
func (*Provider) UpgradeNeeded ¶
func (*Provider) ValidateNewSpec ¶
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) GetEtcdadmCluster(ctx context.Context, cluster *types.Cluster, clusterName string, opts ...executables.KubectlOpt) (*etcdv1beta1.EtcdadmCluster, 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 UpdateAnnotation(ctx context.Context, resourceType, objectName string, annotations map[string]string, opts ...executables.KubectlOpt) 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)
GenerateCAPISpecSecret generates the secret containing the credentials for the nutanix prism central and is used by the CAPX controller. The secret is named after the cluster name.
func (*TemplateBuilder) GenerateCAPISpecWorkers ¶
func (*TemplateBuilder) GenerateEKSASpecSecret ¶ added in v0.15.0
func (ntb *TemplateBuilder) GenerateEKSASpecSecret(clusterSpec *cluster.Spec, buildOptions ...providers.BuildMapOption) (content []byte, err error)
GenerateEKSASpecSecret generates the secret containing the credentials for the nutanix prism central and is used by the EKS-A controller. The secret is named nutanix-credentials.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator is a client to validate nutanix resources.
func NewValidator ¶
func NewValidator(clientCache *ClientCache, certValidator crypto.TlsValidator, httpClient *http.Client) *Validator
NewValidator returns a new validator client.
func (*Validator) ValidateClusterSpec ¶ added in v0.15.0
func (v *Validator) ValidateClusterSpec(ctx context.Context, spec *cluster.Spec, creds credentials.BasicAuthCredential) error
ValidateClusterSpec validates the cluster spec.
func (*Validator) ValidateDatacenterConfig ¶ added in v0.13.0
func (v *Validator) ValidateDatacenterConfig(ctx context.Context, client Client, config *anywherev1.NutanixDatacenterConfig) error
ValidateDatacenterConfig validates the datacenter config.
func (*Validator) ValidateMachineConfig ¶
func (v *Validator) ValidateMachineConfig(ctx context.Context, client Client, config *anywherev1.NutanixMachineConfig) error
ValidateMachineConfig validates the Prism Element cluster, subnet, and image for the machine.
type Workers ¶ added in v0.15.0
type Workers = clusterapi.Workers[*v1beta1.NutanixMachineTemplate]
Workers represents the nutanix specific CAPI spec for worker nodes.
func WorkersSpec ¶ added in v0.15.0
func WorkersSpec(ctx context.Context, logger logr.Logger, client kubernetes.Client, spec *cluster.Spec) (*Workers, error)
WorkersSpec generates a nutanix specific CAPI spec for an eks-a cluster worker nodes. It talks to the cluster with a client to detect changes in immutable objects and generates new names for them.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |