Documentation ¶
Index ¶
- func AddNodePool(cluster *management.Cluster, client *rancher.Client, increaseBy int, ...) (*management.Cluster, error)
- func AddNodePoolOnGCloud(clusterName, zone, project, npName string, extraArgs ...string) error
- func ClusterExistsOnGCloud(clusterName, project, zone string) (bool, error)
- func CreateGKEClusterOnGCloud(zone string, clusterName string, project string, k8sVersion string, ...) error
- func CreateGKEHostedCluster(client *rancher.Client, ...) (*management.Cluster, error)
- func DeleteGKEClusterOnGCloud(zone, project, clusterName string) error
- func DeleteGKEHostCluster(cluster *management.Cluster, client *rancher.Client) error
- func DeleteNodePool(cluster *management.Cluster, client *rancher.Client, ...) (*management.Cluster, error)
- func DeleteNodePoolOnGCloud(zone, project, clusterName, poolName string) error
- func GetK8sVersion(client *rancher.Client, projectID, cloudCredentialID, zone, region string, ...) (string, error)
- func GetK8sVersionVariantGKE(minorVersion string, client *rancher.Client, ...) (string, error)
- func ImportGKEHostedCluster(client *rancher.Client, displayName, cloudCredentialID, zone, project string) (*management.Cluster, error)
- func ListGKEAvailableVersions(client *rancher.Client, clusterID string) ([]string, error)
- func ListSingleVariantGKEAvailableVersions(client *rancher.Client, projectID, cloudCredentialID, zone, region string) (availableVersions []string, err error)
- func ScaleNodePool(cluster *management.Cluster, client *rancher.Client, nodeCount int64, ...) (*management.Cluster, error)
- func UpdateAutoScaling(cluster *management.Cluster, client *rancher.Client, ...) (*management.Cluster, error)
- func UpdateCluster(cluster *management.Cluster, client *rancher.Client, ...) (*management.Cluster, error)
- func UpdateMonitoringAndLoggingService(cluster *management.Cluster, client *rancher.Client, ...) (*management.Cluster, error)
- func UpgradeGKEClusterOnGCloud(zone, clusterName, project, k8sVersion string, upgradeNodePool bool, ...) error
- func UpgradeKubernetesVersion(cluster *management.Cluster, upgradeToVersion string, client *rancher.Client, ...) (*management.Cluster, error)
- func UpgradeNodeKubernetesVersion(cluster *management.Cluster, upgradeToVersion string, client *rancher.Client, ...) (*management.Cluster, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNodePool ¶
func AddNodePool(cluster *management.Cluster, client *rancher.Client, increaseBy int, imageType string, wait, checkClusterConfig bool) (*management.Cluster, error)
AddNodePool adds a nodepool to the list; it uses the nodepool template defined in CATTLE_TEST_CONFIG file if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update TODO(pvala): Enhance this method to accept a nodepool with different configuration
func AddNodePoolOnGCloud ¶
AddNodePoolOnGCloud adds a nodepool to the GKE cluster via gcloud CLI
func ClusterExistsOnGCloud ¶
ClusterExistsOnGCloud gets a list of cluster based on the name filter and returns true if the cluster is in RUNNING or PROVISIONING state; it returns false if the cluster does not exist or is in STOPPING state.
func CreateGKEClusterOnGCloud ¶
func CreateGKEClusterOnGCloud(zone string, clusterName string, project string, k8sVersion string, extraArgs ...string) error
Create Google GKE cluster using gcloud CLI
func CreateGKEHostedCluster ¶
func CreateGKEHostedCluster(client *rancher.Client, displayName, cloudCredentialID, k8sVersion, zone, region, project string, updateFunc func(clusterConfig *gke.ClusterConfig)) (*management.Cluster, error)
CreateGKEHostedCluster creates the GKE cluster
func DeleteGKEClusterOnGCloud ¶
Complete cleanup steps for Google GKE
func DeleteGKEHostCluster ¶
func DeleteGKEHostCluster(cluster *management.Cluster, client *rancher.Client) error
DeleteGKEHostCluster deletes the GKE cluster
func DeleteNodePool ¶
func DeleteNodePool(cluster *management.Cluster, client *rancher.Client, wait, checkClusterConfig bool) (*management.Cluster, error)
DeleteNodePool deletes a nodepool from the list if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update TODO: Modify this method to delete a custom qty of nodepool, perhaps by adding an `decreaseBy int` arg
func DeleteNodePoolOnGCloud ¶
DeleteNodePoolOnGCloud deletes a node pool to GKE using gcloud cli
func GetK8sVersion ¶
func GetK8sVersion(client *rancher.Client, projectID, cloudCredentialID, zone, region string, forUpgrade bool) (string, error)
GetK8sVersion returns the k8s version to be used by the test; this value can either be a variant of envvar DOWNSTREAM_K8S_MINOR_VERSION or the highest available version or second-highest minor version in case of upgrade scenarios
func GetK8sVersionVariantGKE ¶
func GetK8sVersionVariantGKE(minorVersion string, client *rancher.Client, projectID, cloudCrendetialID, zone, region string) (string, error)
GetK8sVersionVariantGKE returns a variant of a given minor K8s version
func ImportGKEHostedCluster ¶
func ImportGKEHostedCluster(client *rancher.Client, displayName, cloudCredentialID, zone, project string) (*management.Cluster, error)
ImportGKEHostedCluster imports the GKE cluster
func ListGKEAvailableVersions ¶
ListGKEAvailableVersions is a function to list and return only available GKE versions for a specific cluster.
func ListSingleVariantGKEAvailableVersions ¶
func ListSingleVariantGKEAvailableVersions(client *rancher.Client, projectID, cloudCredentialID, zone, region string) (availableVersions []string, err error)
ListSingleVariantGKEAvailableVersions returns a list of single variants of minor versions For e.g 1.27.5-gke.1700, 1.26.6-gke.2100, 1.25.8-gke.200
func ScaleNodePool ¶
func ScaleNodePool(cluster *management.Cluster, client *rancher.Client, nodeCount int64, wait, checkClusterConfig bool) (*management.Cluster, error)
ScaleNodePool modifies the number of initialNodeCount of all the nodepools as defined by nodeCount if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update
func UpdateAutoScaling ¶
func UpdateAutoScaling(cluster *management.Cluster, client *rancher.Client, enabled, wait, checkClusterConfig bool) (*management.Cluster, error)
UpdateAutoScaling updates the management.GKENodePoolAutoscaling for all the node pools of a GKE cluster if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update TODO: Facilitate passing minCount and maxCount values when autoscaling is enabled.
func UpdateCluster ¶
func UpdateCluster(cluster *management.Cluster, client *rancher.Client, updateFunc func(*management.Cluster)) (*management.Cluster, error)
UpdateCluster is a generic function to update a cluster
func UpdateMonitoringAndLoggingService ¶
func UpdateMonitoringAndLoggingService(cluster *management.Cluster, client *rancher.Client, monitoringService, loggingService string, wait, checkClusterConfig bool) (*management.Cluster, error)
UpdateMonitoringAndLoggingService updates the monitoring and loggingService of a GKE cluster if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update
func UpgradeGKEClusterOnGCloud ¶
func UpgradeGKEClusterOnGCloud(zone, clusterName, project, k8sVersion string, upgradeNodePool bool, nodePoolName string, exrtaArgs ...string) error
UpgradeGKEClusterOnGCloud upgrades the k8s version of a given GKE cluster; if upgradeNodePool is true, it only upgrades the nodepool version
func UpgradeKubernetesVersion ¶
func UpgradeKubernetesVersion(cluster *management.Cluster, upgradeToVersion string, client *rancher.Client, upgradeNodePool, wait, checkClusterConfig bool) (*management.Cluster, error)
UpgradeKubernetesVersion upgrades the k8s version to the value defined by upgradeToVersion; if upgradeNodePool is true, it also upgrades nodepool k8s version; if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update
func UpgradeNodeKubernetesVersion ¶
func UpgradeNodeKubernetesVersion(cluster *management.Cluster, upgradeToVersion string, client *rancher.Client, wait, checkClusterConfig bool) (*management.Cluster, error)
UpgradeNodeKubernetesVersion upgrades the k8s version of nodepool to the value defined by upgradeToVersion; if wait is set to true, it will wait until the cluster finishes upgrading; if checkClusterConfig is set to true, it will validate that nodepool has been upgraded successfully
Types ¶
This section is empty.