provisioning

package
v0.0.0-...-abb0ee4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 73 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AWSProvider          = "aws"
	AzureProvider        = "azure"
	DOProvider           = "do"
	HarvesterProvider    = "harvester"
	LinodeProvider       = "linode"
	GoogleProvider       = "google"
	VsphereProvider      = "vsphere"
	VsphereCloudProvider = "rancher-vsphere"
)
View Source
const (
	DefaultRancherDataDir = "/var/lib/rancher"
)

Variables

This section is empty.

Functions

func AddRKE2K3SCustomClusterNodes

func AddRKE2K3SCustomClusterNodes(client *rancher.Client, cluster *v1.SteveAPIObject, nodes []*nodes.Node, rolesPerNode []string,
	clustersConfig *clusters.ClusterConfig) error

AddRKE2K3SCustomClusterNodes is a helper method that will add nodes to the custom RKE2/K3S custom cluster.

func CallSSHTestByName

func CallSSHTestByName(testCase provisioninginput.SSHTestCase, node *nodes.Node, client *rancher.Client, clusterID string, machineName string) error

CallSSHTestByName tests the ssh tests specified in the provisioninginput config clusterSSHTests field. For example CheckCPU checks the cpu usage of the cluster agent. If the usage is too high the func will return a warning.

func CreateProvisioningAKSHostedCluster

func CreateProvisioningAKSHostedCluster(client *rancher.Client, aksClusterConfig aks.ClusterConfig) (*management.Cluster, error)

CreateProvisioningAKSHostedCluster provisions an AKS cluster, then runs verify checks

func CreateProvisioningAirgapCustomCluster

func CreateProvisioningAirgapCustomCluster(client *rancher.Client, clustersConfig *clusters.ClusterConfig, externalNodeProvider *ExternalNodeProvider, ec2Configs *ec2.AWSEC2Configs, airgapBastion string) (*v1.SteveAPIObject, error)

CreateProvisioningAirgapCustomCluster provisions a rke2/k3s cluster, then runs verify checks

func CreateProvisioningCluster

func CreateProvisioningCluster(client *rancher.Client, provider Provider, credentialSpec cloudcredentials.CloudCredential, clustersConfig *clusters.ClusterConfig, machineConfigSpec machinepools.MachineConfigs, hostnameTruncation []machinepools.HostnameTruncation) (*v1.SteveAPIObject, error)

CreateProvisioningCluster provisions a non-rke1 cluster, then runs verify checks

func CreateProvisioningCustomCluster

func CreateProvisioningCustomCluster(client *rancher.Client, externalNodeProvider *ExternalNodeProvider, clustersConfig *clusters.ClusterConfig, ec2Configs *ec2.AWSEC2Configs) (*v1.SteveAPIObject, error)

CreateProvisioningCustomCluster provisions a non-rke1 cluster using a 3rd party client for its nodes, then runs verify checks

func CreateProvisioningEKSHostedCluster

func CreateProvisioningEKSHostedCluster(client *rancher.Client, eksClusterConfig eks.ClusterConfig) (*management.Cluster, error)

CreateProvisioningEKSHostedCluster provisions an EKS cluster, then runs verify checks

func CreateProvisioningGKEHostedCluster

func CreateProvisioningGKEHostedCluster(client *rancher.Client, gkeClusterConfig gke.ClusterConfig) (*management.Cluster, error)

CreateProvisioningGKEHostedCluster provisions an GKE cluster, then runs verify checks

func DeleteRKE2K3SCustomClusterNodes

func DeleteRKE2K3SCustomClusterNodes(client *rancher.Client, clusterID string, cluster *v1.SteveAPIObject, nodesToDelete []*nodes.Node) error

DeleteRKE2K3SCustomClusterNodes is a method that will delete nodes from the custom RKE2/K3S custom cluster.

func GetAWSOSNames

func GetAWSOSNames(client *rancher.Client, customConfig rancherEc2.AWSEC2Configs) ([]string, error)

GetAWSOSNames connects to aws and converts each ami in the machineConfigs into the associated aws name

func GetCustomSchemaParams

func GetCustomSchemaParams(client *rancher.Client, cattleConfig map[string]any) []upstream.TestCaseParameterCreate

GetCustomSchemaParams gets a set of params from the cattle config and returns a qase params object

func GetProvisioningSchemaParams

func GetProvisioningSchemaParams(client *rancher.Client, cattleConfig map[string]any) []upstream.TestCaseParameterCreate

GetProvisioningSchemaParams gets a set of params from the cattle config and returns a qase params object

func GetWindowsPools

func GetWindowsPools(client *rancher.Client, customConfig rancherEc2.AWSEC2Configs) []rancherEc2.AWSEC2Config

GetWindowsPools gets a list of the windows machine configs

func UpgradeClusterK8sVersion

func UpgradeClusterK8sVersion(client *rancher.Client, clusterName *string, upgradeVersion *string) (*bundledclusters.BundledCluster, error)

UpgradeClusterK8sVersion upgrades the cluster to the specified version

func VerifyACE

func VerifyACE(t *testing.T, client *rancher.Client, cluster *steveV1.SteveAPIObject)

VerifyACE validates that the ACE resources are healthy in a given cluster

func VerifyACEAirgap

func VerifyACEAirgap(t *testing.T, client *rancher.Client, cluster *steveV1.SteveAPIObject)

VerifyACEAirgap validates that the ACE resources are healthy in a given airgap cluster

func VerifyACELocalUnavailable

func VerifyACELocalUnavailable(t *testing.T, rancherClient *rancher.Client, cluster *steveV1.SteveAPIObject, clusterStatus *provv1.ClusterStatus, pemFilePath string, sshUser string)

VerifyACELocalUnavailable validates that the ACE resources are healthy in a given cluster when the local cluster is unavailable.

func VerifyAllNodesDeleted

func VerifyAllNodesDeleted(client *rancher.Client, clusterID string) error

VerifyAllNodesDeleted validates that a non-rke1 cluster's nodes have been successfully deleted.

func VerifyClusterReady

func VerifyClusterReady(client *rancher.Client, cluster *steveV1.SteveAPIObject) error

VerifyClusterReady validates that a non-rke1 cluster and its resources are in a good state, matching a given config.

func VerifyClusterReadyV3

func VerifyClusterReadyV3(client *rancher.Client, clusterID string) error

VerifyClusterReadyV3 validates that a non-rke1 cluster and its resources are in a good state, matching a given config, using Norman.

func VerifyDataDirectories

func VerifyDataDirectories(t *testing.T, client *rancher.Client, cluster *steveV1.SteveAPIObject)

VerifyDataDirectories validates that data is being distributed properly across data directories.

func VerifyDeleteRKE2K3SCluster

func VerifyDeleteRKE2K3SCluster(t *testing.T, client *rancher.Client, clusterID string)

VerifyDeleteRKE2K3SCluster validates that a non-rke1 cluster and its resources are deleted.

func VerifyDynamicCluster

func VerifyDynamicCluster(t *testing.T, client *rancher.Client, cluster *steveV1.SteveAPIObject)

VerifyCluster validates that a non-rke1 cluster and its resources are in a good state, matching a given config.

func VerifyHostedCluster

func VerifyHostedCluster(t *testing.T, client *rancher.Client, cluster *management.Cluster)

VerifyHostedCluster validates that the hosted cluster and its resources are in a good state, matching a given config.

func VerifyHostnameLength

func VerifyHostnameLength(t *testing.T, client *rancher.Client, clusterObject *steveV1.SteveAPIObject)

VerifyHostnameLength validates that the hostnames of the nodes in a cluster are of the correct length

func VerifyPSACT

func VerifyPSACT(t *testing.T, client *rancher.Client, cluster *steveV1.SteveAPIObject)

func VerifyUpgrade

func VerifyUpgrade(t *testing.T, updatedCluster *bundledclusters.BundledCluster, upgradedVersion string)

VerifyUpgrade validates that a cluster has been upgraded to a given version

Types

type AirgapNodeCreationFunc

type AirgapNodeCreationFunc func(client *rancher.Client, rolesPerPool []string, quantityPerPool []int32, ec2Configs *rancherEc2.AWSEC2Configs) (nodes []*nodes.Node, err error)

type CloudCredFunc

type CloudCredFunc func(rancherClient *rancher.Client, credentials cloudcredentials.CloudCredential) (*v1.SteveAPIObject, error)

type CustomClusterConfig

type CustomClusterConfig struct {
	ExternalNodeProvider ExternalNodeProvider `json:"externalNodeProvider" yaml:"externalNodeProvider"`
	NodeLabels           map[string]string    `json:"nodeLabels" yaml:"nodeLabels"`
	NodeTaints           []corev1.Taint       `json:"nodeTaints" yaml:"nodeTaints"`
	SpecifyPrivateIP     bool                 `json:"specifyPrivateIP" yaml:"specifyPrivateIP"`
	SpecifyPublicIP      bool                 `json:"specifyPublicIP" yaml:"specifyPublicIP"`
	NodeNamePrefix       string               `json:"nodeNamePrefix" yaml:"nodeNamePrefix"`
}

type CustomOSNamesFunc

type CustomOSNamesFunc func(client *rancher.Client, customConfig rancherEc2.AWSEC2Configs) ([]string, error)

type ExternalNodeProvider

type ExternalNodeProvider struct {
	Name                   string
	AirgapNodeCreationFunc AirgapNodeCreationFunc
	NodeCreationFunc       NodeCreationFunc
	NodeDeletionFunc       NodeDeletionFunc
	GetOSNamesFunc         CustomOSNamesFunc
	GetWindowsPoolsFunc    GetCustomWindowsPools
}

func ExternalNodeProviderSetup

func ExternalNodeProviderSetup(providerType string) ExternalNodeProvider

ExternalNodeProviderSetup is a helper function that setups an ExternalNodeProvider object is a wrapper for the specific outside node provider node creator function

type GetCustomWindowsPools

type GetCustomWindowsPools func(client *rancher.Client, customConfig rancherEc2.AWSEC2Configs) []rancherEc2.AWSEC2Config

type LoadMachineConfigFunc

type LoadMachineConfigFunc func(cattleConfig map[string]any) machinepools.MachineConfigs

type MachinePoolFunc

type MachinePoolFunc func(machineConfig machinepools.MachineConfigs, generatedPoolName, namespace string) []unstructured.Unstructured

type MachineRolesFunc

type MachineRolesFunc func(machineConfig machinepools.MachineConfigs) []machinepools.Roles

type NodeCreationFunc

type NodeCreationFunc func(client *rancher.Client, rolesPerPool []string, quantityPerPool []int32, ec2Configs *rancherEc2.AWSEC2Configs, ipv6Cluster bool) (nodes []*nodes.Node, err error)

type NodeDeletionFunc

type NodeDeletionFunc func(client *rancher.Client, nodes []*nodes.Node) error

type OSNamesFunc

type OSNamesFunc func(client *rancher.Client, cloudCredential cloudcredentials.CloudCredential, machineConfigs machinepools.MachineConfigs) ([]string, error)

type Provider

type Provider struct {
	Name                               provisioninginput.ProviderName
	CloudProviderName                  string
	MachineConfigPoolResourceSteveType string
	LoadMachineConfigFunc              LoadMachineConfigFunc
	MachinePoolFunc                    MachinePoolFunc
	CloudCredFunc                      CloudCredFunc
	VerifyCloudProviderFunc            VerifyCloudProviderFunc
	GetMachineRolesFunc                MachineRolesFunc
	GetOSNamesFunc                     OSNamesFunc
}

func CreateProvider

func CreateProvider(name string) Provider

CreateProvider returns all machine and cloud credential configs in the form of a Provider struct. Accepts a string of the name of the provider.

type ProviderName

type ProviderName string

type VerifyCloudProviderFunc

type VerifyCloudProviderFunc func(t *testing.T, client *rancher.Client, clusterObject *steveV1.SteveAPIObject)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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