provisioning

package
v0.0.0-...-2bcb20d Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 68 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRKE1CustomClusterNodes

func AddRKE1CustomClusterNodes(client *rancher.Client, cluster *management.Cluster, nodes []*nodes.Node, rolesPerNode []string) error

AddRKE1CustomClusterNodes is a method that will add nodes to the custom RKE1 custom cluster.

func AddRKE2K3SCustomClusterNodes

func AddRKE2K3SCustomClusterNodes(client *rancher.Client, cluster *v1.SteveAPIObject, nodes []*nodes.Node, rolesPerNode []string) 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 CertRotationCompleteCheckFunc

func CertRotationCompleteCheckFunc(generation int64) wait.WatchCheckFunc

CertRotationCompleteCheckFunc returns a watch check function that checks if the certificate rotation is complete

func CreateProvisioningAKSHostedCluster

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

CreateProvisioningAKSHostedCluster provisions an AKS cluster, then runs verify checks

func CreateProvisioningAirgapCustomCluster

func CreateProvisioningAirgapCustomCluster(client *rancher.Client, clustersConfig *clusters.ClusterConfig, corralPackages *corral.Packages) (*v1.SteveAPIObject, error)

CreateProvisioningAirgapCustomCluster provisions a non-rke1 cluster using corral to gather its nodes, then runs verify checks

func CreateProvisioningCluster

func CreateProvisioningCluster(client *rancher.Client, provider Provider, clustersConfig *clusters.ClusterConfig, 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) (*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) (*management.Cluster, error)

CreateProvisioningEKSHostedCluster provisions an EKS cluster, then runs verify checks

func CreateProvisioningGKEHostedCluster

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

CreateProvisioningGKEHostedCluster provisions an GKE cluster, then runs verify checks

func CreateProvisioningRKE1AirgapCustomCluster

func CreateProvisioningRKE1AirgapCustomCluster(client *rancher.Client, clustersConfig *clusters.ClusterConfig, corralPackages *corral.Packages) (*management.Cluster, error)

CreateProvisioningRKE1AirgapCustomCluster provisions an rke1 cluster using corral to gather its nodes, then runs verify checks

func CreateProvisioningRKE1Cluster

func CreateProvisioningRKE1Cluster(client *rancher.Client, provider RKE1Provider, clustersConfig *clusters.ClusterConfig, nodeTemplate *nodetemplates.NodeTemplate) (*management.Cluster, error)

CreateProvisioningRKE1Cluster provisions an rke1 cluster, then runs verify checks

func CreateProvisioningRKE1CustomCluster

func CreateProvisioningRKE1CustomCluster(client *rancher.Client, externalNodeProvider *ExternalNodeProvider, clustersConfig *clusters.ClusterConfig) (*management.Cluster, []*nodes.Node, error)

CreateProvisioningRKE1CustomCluster provisions an rke1 cluster using a 3rd party client for its nodes, then runs verify checks

func DeleteRKE1CustomClusterNodes

func DeleteRKE1CustomClusterNodes(client *rancher.Client, cluster *management.Cluster, nodesToDelete []*nodes.Node) error

DeleteRKE1CustomClusterNodes is a helper method that will delete nodes from the custom RKE1 custom cluster.

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 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 *management.Cluster)

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

func VerifyCluster

func VerifyCluster(t *testing.T, client *rancher.Client, clustersConfig *clusters.ClusterConfig, cluster *steveV1.SteveAPIObject)

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

func VerifyDeleteRKE1Cluster

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

VerifyDeleteRKE1Cluster validates that a rke1 cluster and its resources are deleted.

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 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 VerifyRKE1Cluster

func VerifyRKE1Cluster(t *testing.T, client *rancher.Client, clustersConfig *clusters.ClusterConfig, cluster *management.Cluster)

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

func VerifySSHTests

func VerifySSHTests(t *testing.T, client *rancher.Client, clusterObject *steveV1.SteveAPIObject, sshTests []provisioninginput.SSHTestCase, clusterID string)

VerifySSHTests validates the ssh tests listed in the config on each node of the cluster

func VerifySnapshots

func VerifySnapshots(client *rancher.Client, localclusterID string, clusterName string, expectedSnapshotLength int, isRKE1 bool) (string, error)

VerifySnapshots waits for a cluster's snapshots to be ready and validates that the correct number of snapshots have been taken

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 CloudCredFunc

type CloudCredFunc func(rancherClient *rancher.Client) (*cloudcredentials.CloudCredential, 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 ExternalNodeProvider

type ExternalNodeProvider struct {
	Name             string
	NodeCreationFunc NodeCreationFunc
	NodeDeletionFunc NodeDeletionFunc
}

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 MachinePoolFunc

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

type NodeCreationFunc

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

type NodeDeletionFunc

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

type NodeTemplateFunc

type NodeTemplateFunc func(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error)

type Provider

type Provider struct {
	Name                               provisioninginput.ProviderName
	MachineConfigPoolResourceSteveType string
	MachinePoolFunc                    MachinePoolFunc
	CloudCredFunc                      CloudCredFunc
	Roles                              []machinepools.Roles
}

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 RKE1Provider

type RKE1Provider struct {
	Name             provisioninginput.ProviderName
	NodeTemplateFunc NodeTemplateFunc
}

func CreateRKE1Provider

func CreateRKE1Provider(name string) RKE1Provider

CreateProvider returns all node template configs in the form of a RKE1Provider struct. Accepts a string of the name of the provider.

Jump to

Keyboard shortcuts

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