client

package
v0.0.0-...-b25b198 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 99 Imported by: 0

Documentation

Overview

Package client implements core functionality of the tkg client

Index

Constants

View Source
const (
	CeipOptInStatus    = "Opt-in"
	CeipOptOutStatus   = "Opt-out"
	CeipPacificCluster = "N/A"
)

CeipOptOutStatus and CeipOptInStatus are constants for the CEIP opt-in/out verbiage

View Source
const (
	// PacificProviderName tkgs provider name
	PacificProviderName = "tkg-service-vsphere"
	// VSphereProviderName vsphere provider name
	VSphereProviderName = "vsphere"
	// AWSProviderName aws provider name
	AWSProviderName = "aws"
	// AzureProviderName azure provider name
	AzureProviderName = "azure"
	// DockerProviderName docker provider name
	DockerProviderName = "docker"
	// OracleProviderName oracle infrastructure cloud provider name
	OracleProviderName = "oci"
)
View Source
const (
	// TkgLabelClusterRolePrefix cluster-role label prefix
	TkgLabelClusterRolePrefix = "cluster-role.tkg.tanzu.vmware.com/"
	// TkgLabelClusterRoleManagement cluster-role management label
	TkgLabelClusterRoleManagement = "management"
	// TkgLabelClusterRoleWorkload cluster-role workload label
	TkgLabelClusterRoleWorkload = "workload"
)
View Source
const (
	ErrorMissingRegionalClusterObject = "management cluster object is not present in given management cluster"
	ErrorNoClusterObject              = "no Cluster object present in the given management cluster"
	ErrorGettingClusterObjects        = "unable to get cluster resources, %s. Are you sure the cluster you are using is a management cluster?"
	ErrorDeleteAbort                  = `` /* 359-byte string literal not displayed */

)

Error message constants

View Source
const (
	// TKGPlanAnnotation plan annotation
	TKGPlanAnnotation     = "tkg/plan"
	LegacyClusterTKRLabel = "tanzuKubernetesRelease"
)
View Source
const (
	StepConfigPrerequisite                 = "Configure prerequisite"
	StepValidateConfiguration              = "Validate configuration"
	StepGenerateClusterConfiguration       = "Generate cluster configuration"
	StepSetupBootstrapCluster              = "Setup bootstrap cluster"
	StepInstallProvidersOnBootstrapCluster = "Install providers on bootstrap cluster"
	StepCreateManagementCluster            = "Create management cluster"
	StepInstallProvidersOnRegionalCluster  = "Install providers on management cluster"
	StepMoveClusterAPIObjects              = "Move cluster-api objects from bootstrap cluster to management cluster"
)

management cluster init step constants

View Source
const (
	NodePoolLabelsName string = "nodePoolLabels"
	NodePoolTaintsName string = "nodePoolTaints"
)
View Source
const (
	DefaulUnhealthyConditionTimeout = "5m"
	DefaultNodeStartupTimeout       = "20m"
	DefaultNodePoolSuffix           = "worker-pool"
	NodePoolKey                     = "node-pool"
)

machinehealthcheck related default and constants

View Source
const (
	// TKGClusterPhaseCreating means the cluster control plane is under creation,
	// or that infrastructure has been created and configured but not yet with
	// an initialized control plane.
	TKGClusterPhaseCreating = TKGClusterPhase("creating")

	// TKGClusterPhaseCreationStalled indicates that the cluster is in the
	// process of creating control plane and the process is possibly
	// stalled and user intervention is required.
	TKGClusterPhaseCreationStalled = TKGClusterPhase("createStalled")

	// TKGClusterPhaseRunning means that the infrastructure has been created
	// and configured, and that the control plane has been fully initialized.
	TKGClusterPhaseRunning = TKGClusterPhase("running")

	// TKGClusterPhaseDeleting means that the cluster is being deleted.
	TKGClusterPhaseDeleting = TKGClusterPhase("deleting")

	// TKGClusterPhaseFailed means that cluster control plane
	// creation failed. Possible user intervention required.
	// This Phase to be used for TKC(pacific cluster).
	TKGClusterPhaseFailed = TKGClusterPhase("failed")

	// TKGClusterPhaseUpdating indicates that the cluster is in the
	// process of rolling out an update or scaling nodes
	TKGClusterPhaseUpdating = TKGClusterPhase("updating")

	// TKGClusterPhaseUpdateFailed indicates that the cluster's
	// rolling update failed and likely requires user intervention.
	// This Phase to be used for TKC(pacific cluster).
	TKGClusterPhaseUpdateFailed = TKGClusterPhase("updateFailed")

	// TKGClusterPhaseUpdateStalled indicates that the cluster is in the
	// process of rolling out an update and the update process is possibly
	// stalled and user intervention is required.
	TKGClusterPhaseUpdateStalled = TKGClusterPhase("updateStalled")

	// TKGClusterPhaseEmpty is useful for the initial reconcile,
	// before we even state the phase as creating.
	TKGClusterPhaseEmpty = TKGClusterPhase("")
)
View Source
const (
	DefaultKappControllerHostPort = 10100
	DefaultAddonsManagerHostPort  = 9865
)
View Source
const (
	ValidationErrorCode      = 1
	PacificInVC7ErrorCode    = 2
	PacificNotInVC7ErrorCode = 3
)

error code constants

View Source
const ErrorBlockUpgradeTMCIncompatible = "" /* 178-byte string literal not displayed */

ErrorBlockUpgradeTMCIncompatible defines the error message to display during upgrade when cluster is registred to TMC and TMC does not support latest version of TKG

View Source
const (
	TKGsystemNamespace = "tkg-system"
)

TKGsystemNamespace and DefaultNamespace are constants for setting the namespaces

Variables

AWS config variables

View Source
var CNITypes = map[string]bool{"calico": true, "antrea": true, "none": true}

CNITypes supported CNI types

ConditionStatus condition status map

View Source
var (
	ErrUnableToFindKubeVipPodManifest = errors.New("unable to find the kube-vip pod manifest from kcp")
)

InitRegionSteps management cluster init step sequence

View Source
var Scheme = runtime.NewScheme()

Scheme runtime scheme

View Source
var TKGSupportedClusterOptions string

TKGSupportedClusterOptions is the comma separated list of cluster options that could be enabled by user !!!NOTE this is set during the build time. Only the cluster options mentioned in "AllowedEnableOptions" could be enabled by user through command line option("enable-cluster-options"), if TKGSupportedClusterOptions is set to ""(for development purpose) the check would be deactivated

UnhealthyConditions unhealthy condition map

VsphereResourceConfigKeys vsphere resource types

Functions

func CheckClusterNameFormat

func CheckClusterNameFormat(clusterName, infrastructureProvider string) error

CheckClusterNameFormat ensures that the cluster name is valid for the given provider

func DeleteContextFromKubeConfig

func DeleteContextFromKubeConfig(kubeconfigPath, context string) error

DeleteContextFromKubeConfig deletes the context and the cluster information from give kubeconfigPath

func DoDeleteMachineDeployment

func DoDeleteMachineDeployment(clusterClient clusterclient.Client, options *DeleteMachineDeploymentOptions) error

DoDeleteMachineDeployment deletes a machine deployment

func DoDeleteMachineDeploymentCC

func DoDeleteMachineDeploymentCC(clusterClient clusterclient.Client, cluster *capi.Cluster, options *DeleteMachineDeploymentOptions) error

func DoGetMachineDeployments

func DoGetMachineDeployments(clusterClient clusterclient.Client, options *GetMachineDeploymentOptions) ([]capi.MachineDeployment, error)

DoGetMachineDeployments retrieves machine deployments for a cluster given a regional cluster client

func DoGetMachineDeploymentsCC

func DoGetMachineDeploymentsCC(clusterClient clusterclient.Client, cluster *capi.Cluster, options *GetMachineDeploymentOptions) ([]capi.MachineDeployment, error)

func DoScaleCCCluster

func DoScaleCCCluster(clusterClient clusterclient.Client, cluster *capi.Cluster, options *ScaleClusterOptions) error

func DoSetMachineDeployment

func DoSetMachineDeployment(clusterClient clusterclient.Client, options *SetMachineDeploymentOptions) error

DoSetMachineDeployment sets a MachineDeployment on a cluster given a regional cluster client

func DoSetMachineDeploymentCC

func DoSetMachineDeploymentCC(clusterClient clusterclient.Client, cluster *capi.Cluster, options *SetMachineDeploymentOptions) error

func GeneratePackageInstallName

func GeneratePackageInstallName(clusterName, addonName string) string

GeneratePackageInstallName is the util function to generate the PackageInstall CR name in a consistent manner. clusterName is the name of cluster within which all resources associated with this PackageInstall CR is installed. It does not necessarily mean the PackageInstall CR will be installed in that cluster. I.e., the kapp-controller PackageInstall CR is installed in the management cluster but is named after "<workload-cluster-name>-kapp-controller". It indicates that this kapp-controller PackageInstall is for reconciling resources in a cluster named "<workload-cluster-name>". addonName is the short name of a Tanzu addon with which the PackageInstall CR is associated.

func GetAKOOAddonSecretValues

func GetAKOOAddonSecretValues(clusterClient clusterclient.Client, clusterName string, isClusterClassBased bool) ([]byte, bool, error)

func GetClusterBootstrap

func GetClusterBootstrap(managementClusterClient clusterclient.Client, clusterName, namespace string) (*runtanzuv1alpha3.ClusterBootstrap, error)

GetClusterBootstrap returns ClusterBootstrap object for the given clusterName in the management cluster

func GetConfigVariableListFromYamlData

func GetConfigVariableListFromYamlData(bytes []byte) ([]string, error)

func GetCorePackagesFromClusterBootstrap

func GetCorePackagesFromClusterBootstrap(regionalClusterClient clusterclient.Client, workloadClusterClient clusterclient.Client, clusterBootstrap *runtanzuv1alpha3.ClusterBootstrap, corePackagesNamespace, clusterName string) ([]kapppkgv1alpha1.Package, error)

GetCorePackagesFromClusterBootstrap returns addon's core packages details from the given ClusterBootstrap object

func GetCurrentClusterKubeConfigFromFile

func GetCurrentClusterKubeConfigFromFile(kubeConfigPath string) ([]byte, error)

GetCurrentClusterKubeConfigFromFile gets current cluster kubeconfig from kubeconfig file

func GetKappControllerConfigValuesFile

func GetKappControllerConfigValuesFile(userConfigValuesFile, kappControllerValuesDir string) (string, error)

func IsProdPlan

func IsProdPlan(plan string) bool

func MergeKubeConfigAndSwitchContext

func MergeKubeConfigAndSwitchContext(kubeConfig []byte, mergeFile string) (string, error)

MergeKubeConfigAndSwitchContext merges kubeconfig and switches the kube-context

func MergeKubeConfigWithoutSwitchContext

func MergeKubeConfigWithoutSwitchContext(kubeConfig []byte, mergeFile string) error

MergeKubeConfigWithoutSwitchContext merges kubeconfig without updating kubecontext

func ModifyKubeVipAndSerialize

func ModifyKubeVipAndSerialize(currentKubeVipPod *corev1.Pod, newLeaseDuration, newRenewDeadline, newRetryPeriod, fullImagePath, imageTag string) (string, error)

ModifyKubeVipAndSerialize modifies the time-out and lease duration parameters and serializes it to a string that can be patched

func MonitorAddonsCorePackageInstallation

func MonitorAddonsCorePackageInstallation(regionalClusterClient clusterclient.Client, workloadClusterClient clusterclient.Client, packages []kapppkgv1alpha1.Package, packageInstallTimeout time.Duration) error

MonitorAddonsCorePackageInstallation monitors addon's core packages (kapp, cni, csi and cpi) and returns error if any while monitoring packages or any packages are not installed successfully. First it monitors kapp package in management cluster then it monitors other core packages in workload cluster.

func NormalizeNodePoolName

func NormalizeNodePoolName(workers []capi.MachineDeployment, clusterName string) ([]capi.MachineDeployment, error)

NormalizeNodePoolName takes a list of machine deployments and strips the cluster name prepend from the name if present

func ParseProviderName

func ParseProviderName(provider string) (name, providerVersion string, err error)

ParseProviderName defines a utility function that parses the abbreviated syntax for name[:version]

func ProcessAKOPackageInstallFile

func ProcessAKOPackageInstallFile(akoPackageInstallTemplateDir, userConfigValuesFile string) (string, error)

func ProcessKappControllerPackage

func ProcessKappControllerPackage(kappControllerPackageImage, userConfigValuesFile, kappControllerValuesDirPath string) (string, error)

func RemoveObsoleteManagementComponents

func RemoveObsoleteManagementComponents(clusterClient clusterclient.Client) error

RemoveObsoleteManagementComponents lists and removes management cluster components that are obsoleted by new management packages, e.g. the tkr-controller-manager deployment in tkr-system namespace.

func RetrieveAKOOVariablesFromAddonSecretValues

func RetrieveAKOOVariablesFromAddonSecretValues(clusterName string, configValues map[string]interface{}, secretValues []byte) error

func SetClusterClass

func SetClusterClass(rw tkgconfigreaderwriter.TKGConfigReaderWriter)

SetClusterClass sets the value of CLUSTER_CLASS based on an array of selectors. Uses the first non empty name provided by a selector.

func TimedExecution

func TimedExecution(command func() error) (time.Duration, error)

TimedExecution returns time taken to execure a command

func WaitForPackagesInstallation

func WaitForPackagesInstallation(clusterClient clusterclient.Client, packages []kapppkgv1alpha1.Package, packageInstallTimeout time.Duration) error

Types

type ApplyProvidersUpgradeOptions

type ApplyProvidersUpgradeOptions struct {
	// Kubeconfig file to use for accessing the management cluster. If empty, default discovery rules apply.
	Kubeconfig clusterctl.Kubeconfig

	// Contract defines the API Version of Cluster API (contract e.g. v1alpha3) the management group should upgrade to.
	// When upgrading by contract, the latest versions available will be used for all the providers; if you want
	// a more granular control on upgrade, use CoreProvider, BootstrapProviders, ControlPlaneProviders, InfrastructureProviders.
	// Note: For tkg we will ignore this option as tkg management cluster is opinionated and it controls version of the providers to be upgraded
	Contract string

	// CoreProvider instance and version (e.g. capi-system/cluster-api:v0.3.0) to upgrade to. This field can be used as alternative to Contract.
	CoreProvider string

	// BootstrapProviders instance and versions (e.g. capi-kubeadm-bootstrap-system/kubeadm:v0.3.0) to upgrade to. This field can be used as alternative to Contract.
	BootstrapProviders []string

	// ControlPlaneProviders instance and versions (e.g. capi-kubeadm-control-plane-system/kubeadm:v0.3.0) to upgrade to. This field can be used as alternative to Contract.
	ControlPlaneProviders []string

	// InfrastructureProviders instance and versions (e.g. capa-system/aws:v0.5.0) to upgrade to. This field can be used as alternative to Contract.
	InfrastructureProviders []string
}

ApplyProvidersUpgradeOptions carries the options supported by upgrade apply.

type AzureUpdateClusterOptions

type AzureUpdateClusterOptions struct {
	AzureTenantID     string
	AzureClientID     string
	AzureClientSecret string
}

AzureUpdateClusterOptions azure credential options

type Client

type Client interface {
	// InitRegion creates and initializes a management cluster via a
	// self-provisioned bootstrap cluster if necessary
	InitRegion(options *InitRegionOptions) error
	// InitRegionDryRun generates the management cluster manifest that would be
	// used by InitRegion to provision a new cluster
	InitRegionDryRun(options *InitRegionOptions) ([]byte, error)
	// GetClusterConfiguration returns a cluster configuration generated with
	// parameters provided in the set of provided template options
	GetClusterConfiguration(options *CreateClusterOptions) ([]byte, error)
	// ConfigureAndValidateTkrVersion takes tkrVersion, if empty fetches default tkr & k8s version from config
	// and validates k8s version format is valid semantic version
	ConfigureAndValidateTkrVersion(tkrVersion string) (string, string, error)
	// CreateCluster creates a workload cluster based on a cluster template
	// generated from the provided options. Returns whether cluster creation was attempted
	// information along with error information
	CreateCluster(options *CreateClusterOptions, waitForCluster bool) (attempedClusterCreation bool, err error)
	// CreateAWSCloudFormationStack create aws cloud formation stack
	CreateAWSCloudFormationStack() error
	// DeleteRegion deletes management cluster via a self-provisioned kind cluster
	DeleteRegion(options DeleteRegionOptions) error
	// VerifyRegion checks if the kube context points to a management clusters,
	VerifyRegion(kubeConfigPath string) (region.RegionContext, error)
	// AddRegionContext adds a management cluster context to tkg config file
	AddRegionContext(region region.RegionContext, overwrite bool, useDirectReference bool) error
	// GetRegionContexts gets all tkg managed management cluster context context
	GetRegionContexts(clusterName string) ([]region.RegionContext, error)
	// SetRegionContext sets a management cluster context to be current context
	SetRegionContext(clusterName string, contextName string) error
	// GenerateAWSCloudFormationTemplate generates a CloudFormation YAML template
	GenerateAWSCloudFormationTemplate() (string, error)
	// GetCurrentRegionContext() gets the current management cluster context
	GetCurrentRegionContext() (region.RegionContext, error)
	// GetWorkloadClusterCredentials merges workload cluster credentials into kubeconfig path
	GetWorkloadClusterCredentials(options GetWorkloadClusterCredentialsOptions) (string, string, error)
	// ListTKGClusters lists workload clusters managed by the management cluster
	ListTKGClusters(options ListTKGClustersOptions) ([]ClusterInfo, error)
	// DeleteWorkloadCluster deletes a workload cluster managed by the management cluster
	DeleteWorkloadCluster(options DeleteWorkloadClusterOptions) error
	// ScaleCluster scales the cluster
	ScaleCluster(options ScaleClusterOptions) error
	// UpgradeCluster upgrades tkg cluster to specific kubernetes version
	UpgradeCluster(options *UpgradeClusterOptions) error
	// ConfigureAndValidateManagementClusterConfiguration validates the management cluster configuration
	// User is expected to validate the configuration before creating management cluster using init operation
	ConfigureAndValidateManagementClusterConfiguration(options *InitRegionOptions, skipValidation bool) *ValidationError
	// UpgradeManagementCluster upgrades tkg cluster to specific kubernetes version
	UpgradeManagementCluster(options *UpgradeClusterOptions) error
	// Opt-in/out to CEIP on Management Cluster
	SetCEIPParticipation(ceipOptIn bool, isProd string, labels string) error
	// Get opt-in/out status for CEIP on all Management Clusters
	GetCEIPParticipation() (ClusterCeipInfo, error)
	// DeleteMachineHealthCheck deletes MachineHealthCheck for the given cluster
	DeleteMachineHealthCheck(options MachineHealthCheckOptions) error
	// ListMachineHealthChecks lists all the machine health check
	GetMachineHealthChecks(options MachineHealthCheckOptions) ([]MachineHealthCheck, error)
	// IsPacificManagementCluster checks if the cluster pointed to by kubeconfig is Pacific management cluster(supervisor)
	IsPacificManagementCluster() (bool, error)
	// SetMachineHealthCheck create or update a machine health check object
	SetMachineHealthCheck(options *SetMachineHealthCheckOptions) error
	// GetMachineDeployments gets a list of MachineDeployments for a cluster
	GetMachineDeployments(options GetMachineDeploymentOptions) ([]capi.MachineDeployment, error)
	// GetPacificMachineDeployments gets machine deployments from a Pacific cluster
	// Note: This would be soon deprecated after TKGS and TKGm adopt the clusterclass
	GetPacificMachineDeployments(options GetMachineDeploymentOptions) ([]capiv1alpha3.MachineDeployment, error)
	// SetMachineDeployment create machine deployment in a cluster
	SetMachineDeployment(options *SetMachineDeploymentOptions) error
	// DeleteMachineDeployment deletes a machine deployment in a cluster
	DeleteMachineDeployment(options DeleteMachineDeploymentOptions) error
	// GetKubernetesVersions returns the supported k8s versions for workload cluster
	GetKubernetesVersions() (*KubernetesVersionsInfo, error)
	// ParseHiddenArgsAsFeatureFlags adds the hidden flags from InitRegionOptions as enabled feature flags
	ParseHiddenArgsAsFeatureFlags(options *InitRegionOptions)
	// SaveFeatureFlags saves the feature flags to the config file via featuresClient
	SaveFeatureFlags(featureFlags map[string]string) error
	// ValidatePrerequisites validates prerequisites for init command
	ValidatePrerequisites(validateDocker, validateKubectl bool) error
	// ValidateDockerResourcePrerequisites validates resource prerequisites for docker
	ValidateDockerResourcePrerequisites() error
	// GetVSphereEndpoint creates the vSphere client using the credentials from the management cluster if cluster client is provided,
	// otherwise, the vSphere client will be created from the credentials set in the user's environment.
	GetVSphereEndpoint(client clusterclient.Client) (vc.Client, error)
	// ConfigureTimeout updates/configures timeout already set in the tkgClient
	ConfigureTimeout(timeout time.Duration)
	// TKGConfigReaderWriter returns tkgConfigReaderWriter client
	TKGConfigReaderWriter() tkgconfigreaderwriter.TKGConfigReaderWriter
	// UpdateManagementCluster updates a management cluster
	UpdateCredentialsRegion(options *UpdateCredentialsOptions) error
	// UpdateCredentialsCluster updates a workload cluster
	UpdateCredentialsCluster(options *UpdateCredentialsOptions) error
	// GetClusterPinnipedInfo returns the cluster and pinniped info
	GetClusterPinnipedInfo(options GetClusterPinnipedInfoOptions) (*ClusterPinnipedInfo, error)
	// DescribeCluster describes all the objects in the Cluster
	DescribeCluster(options DescribeTKGClustersOptions) (*clusterctltree.ObjectTree, *capi.Cluster, *clusterctlv1.ProviderList, error)
	// DescribeProvider describes all the installed providers
	DescribeProvider() (*clusterctlv1.ProviderList, error)
	// DownloadBomFile downloads BomFile from management cluster's config map
	DownloadBomFile(tkrName string) error
	// IsManagementClusterAKindCluster determines if the creation of management cluster is successful
	IsManagementClusterAKindCluster(clusterName string) (bool, error)
	// GetTanzuKubernetesReleases returns the available TanzuKubernetesReleases
	// Deprecated: This would not be supported from TKR API version v1alpha3,
	// user can use go client to get TKR
	GetTanzuKubernetesReleases(tkrName string) ([]runv1alpha1.TanzuKubernetesRelease, error)
	// ActivateTanzuKubernetesReleases activates TanzuKubernetesRelease
	// Deprecated: This would not be supported from TKR API version v1alpha3,
	// user can use go client to set the labels to activate/deactivate the TKR
	ActivateTanzuKubernetesReleases(tkrName string) error
	// DeactivateTanzuKubernetesReleases deactivates TanzuKubernetesRelease
	// Deprecated: This would not be supported from TKR API version v1alpha3,
	// user can use go client to set the labels to activate/deactivate the TKR
	DeactivateTanzuKubernetesReleases(tkrName string) error
	// IsPacificRegionalCluster checks if the cluster pointed to by kubeconfig  is Pacific management cluster(supervisor)
	IsPacificRegionalCluster() (bool, error)
	// GetPacificClusterObject gets Pacific cluster object
	GetPacificClusterObject(clusterName, namespace string) (*tkgsv1alpha2.TanzuKubernetesCluster, error)
	// IsFeatureActivated checks if a given feature flag is active
	IsFeatureActivated(feature string) bool
}

Client is used to interact with the tkg client library

type ClusterCeipInfo

type ClusterCeipInfo struct {
	ClusterName string `json:"name" yaml:"name"`
	CeipStatus  string `json:"ceipOptIn" yaml:"ceipOptIn"`
}

ClusterCeipInfo is the cmd object for outputting the CEIP status of a clsuter

type ClusterClassSelector

type ClusterClassSelector interface {
	Select(config tkgconfigreaderwriter.TKGConfigReaderWriter) string
}

type ClusterConfigOptions

type ClusterConfigOptions clusterctl.GetClusterTemplateOptions

ClusterConfigOptions contains options required to generate a cluster configuration

type ClusterIPFamily

type ClusterIPFamily int

ClusterIPFamily defines the types of supported IP families.

const (
	InvalidIPFamily ClusterIPFamily = iota
	IPv4IPFamily
	IPv6IPFamily
	DualStackIPFamily
)

Define the ClusterIPFamily constants.

func GetIPFamily

func GetIPFamily(c *capi.Cluster) (ClusterIPFamily, error)

GetIPFamily returns a ClusterIPFamily from the configuration provided.

func (ClusterIPFamily) String

func (f ClusterIPFamily) String() string

type ClusterInfo

type ClusterInfo struct {
	Name              string            `json:"name" yaml:"name"`
	Namespace         string            `json:"namespace" yaml:"namespace"`
	Status            string            `json:"status" yaml:"status"`
	Plan              string            `json:"plan" yaml:"plan"`
	ControlPlaneCount string            `json:"controlplane" yaml:"controlplane"`
	WorkerCount       string            `json:"workers" yaml:"workers"`
	K8sVersion        string            `json:"kubernetes" yaml:"kubernetes"`
	Roles             []string          `json:"roles" yaml:"roles"`
	TKR               string            `json:"tkr" yaml:"tkr"`
	Labels            map[string]string `json:"labels" yaml:"labels"`
}

ClusterInfo defines the fields of get cluster output

type ClusterPinnipedInfo

type ClusterPinnipedInfo struct {
	ClusterName     string
	ClusterInfo     *clientcmdapi.Cluster
	ClusterAudience *string
	PinnipedInfo    *pinnipedinfo.PinnipedInfo
}

ClusterPinnipedInfo defines the fields of cluster pinniped info

type ClusterUpgradeInfo

type ClusterUpgradeInfo struct {
	UpgradeComponentInfo ComponentInfo
	ActualComponentInfo  ComponentInfo

	KCPObjectName      string
	KCPObjectNamespace string
	MDObjects          []capi.MachineDeployment
	ClusterName        string
	ClusterNamespace   string

	UpgradeState upgradeStatus
}

ClusterUpgradeInfo defines cluster upgrade metadata used during upgrade process

type ComponentInfo

type ComponentInfo struct {
	TkrVersion                         string
	KubernetesVersion                  string
	ImageRepository                    string
	CoreDNSImageRepository             string
	CoreDNSImageTag                    string
	EtcdDataDir                        string
	EtcdImageRepository                string
	EtcdImageTag                       string
	EtcdExtraArgs                      map[string]string
	KCPInfrastructureTemplateName      string
	KCPInfrastructureTemplateNamespace string
	MDInfastructureTemplates           map[string]mdInfastructureTemplateInfo
	VSphereVMTemplateName              string
	VSphereVMTemplateMOID              string
	AwsAMIID                           string
	CAPDImageName                      string
	CAPDImageRepo                      string
	AwsRegionToAMIMap                  map[string][]tkgconfigbom.AMIInfo
	AzureImage                         tkgconfigbom.AzureInfo
	OsInfo                             tkgconfigbom.OSInfo
	KubeVipFullImagePath               string
	KubeVipTag                         string
}

ComponentInfo defines cluster component related metadata used for upgrade

type Components

type Components repository.Components

Components CAPI repostory components interface

type CreateClusterOptions

type CreateClusterOptions struct {
	ClusterConfigOptions
	TKRVersion                   string
	NodeSizeOptions              NodeSizeOptions
	CniType                      string
	ClusterOptionsEnableList     []string
	VsphereControlPlaneEndpoint  string
	SkipValidation               bool
	IsWindowsWorkloadCluster     bool
	ClusterType                  TKGClusterType
	Edition                      string
	IsInputFileClusterClassBased bool
	ClusterConfigFile            string
}

CreateClusterOptions contains options required to create a cluster

type DeleteMachineDeploymentOptions

type DeleteMachineDeploymentOptions struct {
	ClusterName string
	Name        string
	Namespace   string
}

DeleteMachineDeploymentOptions a struct describing options for DeleteMachineDeployments

type DeleteRegionOptions

type DeleteRegionOptions struct {
	Kubeconfig         string
	ClusterName        string
	Force              bool
	UseExistingCluster bool
}

DeleteRegionOptions contains options supported by DeleteRegion

type DeleteWorkloadClusterOptions

type DeleteWorkloadClusterOptions struct {
	ClusterName string
	Namespace   string
}

DeleteWorkloadClusterOptions contains options supported by DeleteWorkloadCluster

type DescribeTKGClustersOptions

type DescribeTKGClustersOptions struct {
	ClusterName         string
	Namespace           string
	ShowOtherConditions string
	ShowDetails         bool
	ShowGroupMembers    bool
	IsManagementCluster bool
}

DescribeTKGClustersOptions contains options supported by DescribeCluster

type FeatureFlagClient

type FeatureFlagClient interface {
	IsConfigFeatureActivated(featurePath string) (bool, error)
}

FeatureFlagClient is used to check if a feature is active

type GetClusterPinnipedInfoOptions

type GetClusterPinnipedInfoOptions struct {
	ClusterName         string
	Namespace           string
	IsManagementCluster bool
}

GetClusterPinnipedInfoOptions contains options supported by GetClusterPinnipedInfo

type GetMachineDeploymentOptions

type GetMachineDeploymentOptions struct {
	ClusterName string
	Name        string
	Namespace   string
}

GetMachineDeploymentOptions a struct describing options for retrieving MachineDeployments

type GetWorkloadClusterCredentialsOptions

type GetWorkloadClusterCredentialsOptions struct {
	ClusterName string
	Namespace   string
	ExportFile  string
}

GetWorkloadClusterCredentialsOptions contains options supported by GetWorkloadClusterCredntials

type GivenClusterClassSelector

type GivenClusterClassSelector struct{}

func (GivenClusterClassSelector) Select

type InitRegionOptions

type InitRegionOptions struct {
	NodeSizeOptions              NodeSizeOptions
	ClusterConfigFile            string
	Kubeconfig                   string
	Plan                         string
	ClusterName                  string
	CoreProvider                 string
	BootstrapProvider            string
	InfrastructureProvider       string
	ControlPlaneProvider         string
	IPAMProvider                 string
	Namespace                    string
	CniType                      string
	VsphereControlPlaneEndpoint  string
	Edition                      string
	AdditionalTKGManifests       string
	Annotations                  map[string]string
	Labels                       map[string]string
	FeatureFlags                 map[string]string
	LaunchUI                     bool
	CeipOptIn                    bool
	UseExistingCluster           bool
	IsInputFileClusterClassBased bool
	GenerateOnly                 bool
}

InitRegionOptions contains options supported by InitRegion

type KubernetesVersionsInfo

type KubernetesVersionsInfo struct {
	Versions []string `json:"versions" yaml:"versions"`
}

KubernetesVersionsInfo kubernetes version info struct

type ListTKGClustersOptions

type ListTKGClustersOptions struct {
	Namespace                          string
	IncludeMC                          bool
	IsTKGSClusterClassFeatureActivated bool
}

ListTKGClustersOptions contains options supported by ListClusters

type MachineHealthCheck

type MachineHealthCheck struct {
	Name      string                        `json:"name"`
	Namespace string                        `json:"namespace"`
	Spec      capi.MachineHealthCheckSpec   `json:"spec"`
	Status    capi.MachineHealthCheckStatus `json:"status"`
}

MachineHealthCheck object

type MachineHealthCheckOptions

type MachineHealthCheckOptions struct {
	ClusterName            string
	MachineHealthCheckName string
	Namespace              string
	MatchLabel             string
}

MachineHealthCheckOptions machinehealthcheck options

type NodePool

type NodePool struct {
	Name                  string                    `yaml:"name"`
	Replicas              *int32                    `yaml:"replicas,omitempty"`
	AZ                    string                    `yaml:"az,omitempty"`
	NodeMachineType       string                    `yaml:"nodeMachineType,omitempty"`
	WorkerClass           string                    `yaml:"workerClass,omitempty"`
	Labels                *map[string]string        `yaml:"labels,omitempty"`
	VSphere               VSphereNodePool           `yaml:"vsphere,omitempty"`
	Taints                *[]corev1.Taint           `yaml:"taints,omitempty"`
	VMClass               string                    `yaml:"vmClass,omitempty"`
	StorageClass          string                    `yaml:"storageClass,omitempty"`
	TKRResolver           string                    `yaml:"tkrResolver,omitempty"`
	Volumes               *[]tkgsv1alpha2.Volume    `yaml:"volumes,omitempty"`
	TKR                   tkgsv1alpha2.TKRReference `yaml:"tkr,omitempty"`
	NodeDrainTimeout      *metav1.Duration          `yaml:"nodeDrainTimeout,omitempty"`
	BaseMachineDeployment string                    `yaml:"baseMachineDeployment,omitempty"`
}

NodePool a struct describing a node pool

type NodeSizeOptions

type NodeSizeOptions struct {
	Size             string
	ControlPlaneSize string
	WorkerSize       string
}

NodeSizeOptions contains node size options specified by user

type Options

type Options struct {
	ClusterCtlClient         clusterctl.Client
	ReaderWriterConfigClient tkgconfigreaderwriter.Client
	RegionManager            region.Manager
	TKGConfigDir             string
	Timeout                  time.Duration
	FeaturesClient           features.Client
	TKGConfigProvidersClient tkgconfigproviders.Client
	TKGBomClient             tkgconfigbom.Client
	TKGConfigUpdater         tkgconfigupdater.Client
	TKGPathsClient           tkgconfigpaths.Client
	ClusterKubeConfig        *types.ClusterKubeConfig
	ClusterClientFactory     clusterclient.ClusterClientFactory
	VcClientFactory          vc.VcClientFactory
	FeatureFlagClient        FeatureFlagClient
}

Options new client options

type Provider

type Provider clusterctlconfig.Provider

Provider CAPI provider interface

type ProviderBasedClusterClassSelector

type ProviderBasedClusterClassSelector struct{}

func (ProviderBasedClusterClassSelector) Select

type ScaleClusterOptions

type ScaleClusterOptions struct {
	Kubeconfig        string
	ClusterName       string
	Namespace         string
	NodePoolName      string
	WorkerCount       int32
	ControlPlaneCount int32
}

ScaleClusterOptions defines options to scale tkg cluster

type SetMachineDeploymentOptions

type SetMachineDeploymentOptions struct {
	ClusterName string
	Namespace   string
	NodePool
}

SetMachineDeploymentOptions a struct describing options for creating/updating MachineDeployments

type SetMachineHealthCheckOptions

type SetMachineHealthCheckOptions struct {
	ClusterName            string
	Namespace              string
	MachineHealthCheckName string
	MatchLables            []string
	UnhealthyConditions    []string
	NodeStartupTimeout     string
}

SetMachineHealthCheckOptions machinehealthcheck setter options

type TKGClusterPhase

type TKGClusterPhase string

TKGClusterPhase is used to type the constants describing possible cluster status.

type TKGClusterType

type TKGClusterType string

TKGClusterType specifies cluster type

const (
	ManagementCluster TKGClusterType = "Management"
	WorkloadCluster   TKGClusterType = "Workload"
)

cluster types

type TkgClient

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

TkgClient implements Client.

func CreateTKGClientOptsMutator

func CreateTKGClientOptsMutator(clusterConfigFile, configDir, defaultBomFile string, timeout time.Duration, optMutator func(options Options) Options) (*TkgClient, error)

func New

func New(options Options) (*TkgClient, error)

New returns a tkgClient.

func (*TkgClient) ActivateTanzuKubernetesReleases

func (c *TkgClient) ActivateTanzuKubernetesReleases(tkrName string) error

ActivateTanzuKubernetesReleases activates TKr

func (*TkgClient) AddRegionContext

func (c *TkgClient) AddRegionContext(r region.RegionContext, overwrite, useDirectReference bool) error

AddRegionContext adds management cluster context

func (*TkgClient) ApplyClusterBootstrapObjects

func (c *TkgClient) ApplyClusterBootstrapObjects(fromClusterClient, toClusterClient clusterclient.Client) error

ApplyClusterBootstrapObjects renders the ClusterBootstrap and its associated objects from templates and applies them to a target management cluster.

func (*TkgClient) BuildRegionalClusterConfiguration

func (c *TkgClient) BuildRegionalClusterConfiguration(options *InitRegionOptions) ([]byte, string, string, error)

BuildRegionalClusterConfiguration build management cluster configuration returns cluster-configuration bytes, clustername, configFilePath, error if present

func (*TkgClient) CleanupCorePackageRepo

func (c *TkgClient) CleanupCorePackageRepo(clusterClient clusterclient.Client) error

func (*TkgClient) ConfigureAMIID

func (c *TkgClient) ConfigureAMIID(options *UpgradeClusterOptions, regionalClusterClient clusterclient.Client) error

func (*TkgClient) ConfigureAndValidateAWSConfig

func (c *TkgClient) ConfigureAndValidateAWSConfig(tkrVersion string, nodeSizes NodeSizeOptions, skipValidation, isProdConfig bool, workerMachineCount int64, clusterClient clusterclient.Client, isManagementCluster bool) error

ConfigureAndValidateAWSConfig configures and validates aws configuration

func (*TkgClient) ConfigureAndValidateAviConfiguration

func (c *TkgClient) ConfigureAndValidateAviConfiguration(clusterName string) error

ConfigureAndValidateAviConfiguration validates the configuration inputs of Avi aka. NSX Advanced Load Balancer

func (*TkgClient) ConfigureAndValidateAwsConfig

func (c *TkgClient) ConfigureAndValidateAwsConfig(tkrVersion string, workerMachineCount int64, useExistingVPC bool) error

ConfigureAndValidateAwsConfig configures and validates aws configuration

func (*TkgClient) ConfigureAndValidateAzureConfig

func (c *TkgClient) ConfigureAndValidateAzureConfig(tkrVersion string, nodeSizes NodeSizeOptions, skipValidation bool, clusterClient clusterclient.Client) error

ConfigureAndValidateAzureConfig configures and validates azure configurationn

func (*TkgClient) ConfigureAndValidateCNIType

func (c *TkgClient) ConfigureAndValidateCNIType(cniType string) error

ConfigureAndValidateCNIType configures and validates cni

func (*TkgClient) ConfigureAndValidateDockerConfig

func (c *TkgClient) ConfigureAndValidateDockerConfig(tkrVersion string, nodeSizes NodeSizeOptions, skipValidation bool) error

ConfigureAndValidateDockerConfig configures and validates docker configuration

func (*TkgClient) ConfigureAndValidateHTTPProxyConfiguration

func (c *TkgClient) ConfigureAndValidateHTTPProxyConfiguration(infrastructureName string) error

ConfigureAndValidateHTTPProxyConfiguration configures and validates http proxy configuration

func (*TkgClient) ConfigureAndValidateManagementClusterConfiguration

func (c *TkgClient) ConfigureAndValidateManagementClusterConfiguration(options *InitRegionOptions, skipValidation bool) *ValidationError

ConfigureAndValidateManagementClusterConfiguration configure and validate management cluster configuration

func (*TkgClient) ConfigureAndValidateNameserverConfiguration

func (c *TkgClient) ConfigureAndValidateNameserverConfiguration(clusterRole string) error

ConfigureAndValidateNameserverConfiguration validates the configuration of the control plane node and workload node nameservers

func (*TkgClient) ConfigureAndValidateOracleConfig

func (c *TkgClient) ConfigureAndValidateOracleConfig(tkrVersion string, nodeSizes NodeSizeOptions, skipValidation bool) error

ConfigureAndValidateOracleConfig configures and validates oracle configurationn

func (*TkgClient) ConfigureAndValidateTkrVersion

func (c *TkgClient) ConfigureAndValidateTkrVersion(tkrVersion string) (string, string, error)

ConfigureAndValidateTkrVersion takes tkrVersion, if empty fetches default tkr & k8s version from config and validates k8s version format is valid semantic version

func (*TkgClient) ConfigureAndValidateVSphereTemplate

func (c *TkgClient) ConfigureAndValidateVSphereTemplate(vcClient vc.Client, tkrVersion, dc string) error

ConfigureAndValidateVSphereTemplate validate the k8s version provided matches with VM template's k8s version

func (*TkgClient) ConfigureAndValidateVsphereConfig

func (c *TkgClient) ConfigureAndValidateVsphereConfig(tkrVersion string, nodeSizes NodeSizeOptions, vip string, skipValidation bool, clusterClient clusterclient.Client) *ValidationError

ConfigureAndValidateVsphereConfig configures and validates vsphere configuration

func (*TkgClient) ConfigureAndValidateWorkloadClusterConfiguration

func (c *TkgClient) ConfigureAndValidateWorkloadClusterConfiguration(options *CreateClusterOptions, clusterClient clusterclient.Client, skipValidation bool) error

ConfigureAndValidateWorkloadClusterConfiguration configures and validates workload cluster configuration

func (*TkgClient) ConfigureAzureVMImage

func (c *TkgClient) ConfigureAzureVMImage(tkrVersion string) error

ConfigureAzureVMImage configures azure image from BoM or user config file

func (*TkgClient) ConfigureTimeout

func (c *TkgClient) ConfigureTimeout(timeout time.Duration)

ConfigureTimeout updates/configures timeout already set in the tkgClient

func (*TkgClient) CopyNeededTKRAndOSImages

func (c *TkgClient) CopyNeededTKRAndOSImages(fromClusterClient, toClusterClient clusterclient.Client) error

CopyNeededTKRAndOSImages moves the resolved TKR and associated OSImage CR for a Cluster resource from namespaceto a target management

func (*TkgClient) CreateAWSCloudFormationStack

func (c *TkgClient) CreateAWSCloudFormationStack() error

CreateAWSCloudFormationStack create aws cloud formation stack

func (*TkgClient) CreateCluster

func (c *TkgClient) CreateCluster(options *CreateClusterOptions, waitForCluster bool) (bool, error)

CreateCluster creates a workload cluster based on a cluster template generated from the provided options. Returns whether cluster creation was attempted information along with error information

func (*TkgClient) CreateMachineHealthCheck

func (c *TkgClient) CreateMachineHealthCheck(clusterClient clusterclient.Client, options *SetMachineHealthCheckOptions) error

CreateMachineHealthCheck creates machinehealthchecks

func (*TkgClient) CreateOrUpdateVerisionedTKGBom

func (c *TkgClient) CreateOrUpdateVerisionedTKGBom(regionalClusterClient clusterclient.Client) error

CreateOrUpdateVerisionedTKGBom will create or update the tkg-bom-<tkg-version> ConfigMap. This is required for destributing tkg-bom information to workload clusters.

func (*TkgClient) DeactivateTanzuKubernetesReleases

func (c *TkgClient) DeactivateTanzuKubernetesReleases(tkrName string) error

DeactivateTanzuKubernetesReleases deactivates TKR

func (*TkgClient) DecodeKubevipPodManifestFromKCP

func (c *TkgClient) DecodeKubevipPodManifestFromKCP(kcp *capikubeadmv1beta1.KubeadmControlPlane) (*corev1.Pod, error)

func (*TkgClient) DeleteMachineDeployment

func (c *TkgClient) DeleteMachineDeployment(options DeleteMachineDeploymentOptions) error

DeleteMachineDeployment deletes a machine deployment

func (*TkgClient) DeleteMachineHealthCheck

func (c *TkgClient) DeleteMachineHealthCheck(options MachineHealthCheckOptions) error

DeleteMachineHealthCheck delete machinehealthcheck

func (*TkgClient) DeleteMachineHealthCheckWithClusterClient

func (c *TkgClient) DeleteMachineHealthCheckWithClusterClient(clusterClient clusterclient.Client, options MachineHealthCheckOptions) error

DeleteMachineHealthCheckWithClusterClient delete machinehealthcheck with client

func (*TkgClient) DeleteNodePoolForPacificCluster

func (c *TkgClient) DeleteNodePoolForPacificCluster(clusterClient clusterclient.Client, options DeleteMachineDeploymentOptions) error

DeleteNodePoolForPacificCluster deletes a machine deployment

func (*TkgClient) DeleteRegion

func (c *TkgClient) DeleteRegion(options DeleteRegionOptions) error

DeleteRegion delete management cluster

func (*TkgClient) DeleteWorkloadCluster

func (c *TkgClient) DeleteWorkloadCluster(options DeleteWorkloadClusterOptions) error

DeleteWorkloadCluster deletes workload cluster

func (*TkgClient) DescribeCluster

DescribeCluster describes cluster details and status

func (*TkgClient) DescribeProvider

func (c *TkgClient) DescribeProvider() (*clusterctlv1.ProviderList, error)

DescribeProvider describes provider information

func (*TkgClient) DistributeMachineDeploymentWorkers

func (c *TkgClient) DistributeMachineDeploymentWorkers(workerMachineCount int64, isProdConfig, isManagementCluster bool, infraProviderName string) ([]int, error)

DistributeMachineDeploymentWorkers distributes machine deployment for worker nodes

func (*TkgClient) DoClassyClusterUpgrade

func (c *TkgClient) DoClassyClusterUpgrade(regionalClusterClient clusterclient.Client,
	currentClusterClient clusterclient.Client, options *UpgradeClusterOptions) error

func (*TkgClient) DoClusterUpgrade

func (c *TkgClient) DoClusterUpgrade(regionalClusterClient clusterclient.Client,
	currentClusterClient clusterclient.Client, options *UpgradeClusterOptions) error

DoClusterUpgrade upgrades cluster

func (*TkgClient) DoCreateCluster

func (c *TkgClient) DoCreateCluster(clusterClient clusterclient.Client, name, namespace, manifest string) error

DoCreateCluster performs steps to create cluster

func (*TkgClient) DoGetCEIPParticipation

func (c *TkgClient) DoGetCEIPParticipation(clusterClient clusterclient.Client, clusterName string) (ClusterCeipInfo, error)

DoGetCEIPParticipation get CEIP participation details

func (*TkgClient) DoGetTanzuKubernetesReleases

func (c *TkgClient) DoGetTanzuKubernetesReleases(regionalClusterClient clusterclient.Client) (*KubernetesVersionsInfo, error)

DoGetTanzuKubernetesReleases gets TKr

func (*TkgClient) DoLegacyClusterUpgrade

func (c *TkgClient) DoLegacyClusterUpgrade(regionalClusterClient, currentClusterClient clusterclient.Client, options *UpgradeClusterOptions) error

func (*TkgClient) DoPacificClusterUpgrade

func (c *TkgClient) DoPacificClusterUpgrade(regionalClusterClient clusterclient.Client, options *UpgradeClusterOptions) error

DoPacificClusterUpgrade perform TKGS cluster upgrade

func (*TkgClient) DoProvidersUpgrade

func (c *TkgClient) DoProvidersUpgrade(regionalClusterClient clusterclient.Client, ctx string,
	providersUpgradeClient providersupgradeclient.Client, options *UpgradeClusterOptions) error

DoProvidersUpgrade upgrades the providers of the management cluster

func (*TkgClient) DoScaleCluster

func (c *TkgClient) DoScaleCluster(clusterClient clusterclient.Client, options *ScaleClusterOptions) error

DoScaleCluster performs the scale operation using the given clusterclient.Client

func (*TkgClient) DoSetCEIPParticipation

func (c *TkgClient) DoSetCEIPParticipation(clusterClient clusterclient.Client, context region.RegionContext, ceipOptIn bool, isProd, labels string) error

DoSetCEIPParticipation performs steps to set CEIP participation

func (*TkgClient) DoUpgradeAddon

func (c *TkgClient) DoUpgradeAddon(regionalClusterClient clusterclient.Client,
	currentClusterClient clusterclient.Client,
	options *UpgradeAddonOptions,
	clusterConfigurationGetter func(*CreateClusterOptions) ([]byte, error)) error

DoUpgradeAddon performs steps for addons upgrade

func (*TkgClient) DownloadBomFile

func (c *TkgClient) DownloadBomFile(tkrName string) error

DownloadBomFile downloads BoM file

func (*TkgClient) EncodeAWSCredentialsAndGetClient

func (c *TkgClient) EncodeAWSCredentialsAndGetClient(clusterClient clusterclient.Client) (aws.Client, error)

EncodeAWSCredentialsAndGetClient encodes aws credentials and returns aws client

func (*TkgClient) EncodeAzureCredentialsAndGetClient

func (c *TkgClient) EncodeAzureCredentialsAndGetClient(clusterClient clusterclient.Client) (azure.Client, error)

EncodeAzureCredentialsAndGetClient encodes azure credentials and returns azure client

func (*TkgClient) GenerateAWSCloudFormationTemplate

func (c *TkgClient) GenerateAWSCloudFormationTemplate() (string, error)

GenerateAWSCloudFormationTemplate produces the CloudFormation template YAML

func (*TkgClient) GenerateProvidersUpgradeOptions

func (c *TkgClient) GenerateProvidersUpgradeOptions(pUpgradeInfo *providersUpgradeInfo) (*clusterctl.ApplyUpgradeOptions, error)

GenerateProvidersUpgradeOptions generates provider upgrade options

func (*TkgClient) GetAWSCreds

func (c *TkgClient) GetAWSCreds() (*credentials.AWSCredentials, error)

GetAWSCreds get aws credentials

func (*TkgClient) GetAddonsManagerPackageversion

func (c *TkgClient) GetAddonsManagerPackageversion(managementPackageVersion string) (string, error)

GetAddonsManagerPackageversion returns a addons manager package version

func (*TkgClient) GetCEIPParticipation

func (c *TkgClient) GetCEIPParticipation() (ClusterCeipInfo, error)

GetCEIPParticipation get CEIP participation details

func (*TkgClient) GetClusterConfiguration

func (c *TkgClient) GetClusterConfiguration(options *CreateClusterOptions) ([]byte, error)

GetClusterConfiguration gets cluster configuration

func (*TkgClient) GetClusterObjects

func (c *TkgClient) GetClusterObjects(clusterClient clusterclient.Client, listOptions *crtclient.ListOptions,
	managementClusterName string, includeMC bool) ([]ClusterInfo, error)

GetClusterObjects gets cluster objects

func (*TkgClient) GetClusterObjectsForPacific

func (c *TkgClient) GetClusterObjectsForPacific(clusterClient clusterclient.Client, apiVersion string, listOptions *crtclient.ListOptions) ([]ClusterInfo, error)

GetClusterObjectsForPacific get cluster objects for TKGS clusters

func (*TkgClient) GetClusterPinnipedInfo

func (c *TkgClient) GetClusterPinnipedInfo(options GetClusterPinnipedInfoOptions) (*ClusterPinnipedInfo, error)

GetClusterPinnipedInfo gets pinniped information from cluster

func (*TkgClient) GetCurrentRegionContext

func (c *TkgClient) GetCurrentRegionContext() (region.RegionContext, error)

GetCurrentRegionContext gets current management cluster contexts

func (*TkgClient) GetKubernetesVersions

func (c *TkgClient) GetKubernetesVersions() (*KubernetesVersionsInfo, error)

GetKubernetesVersions get kubernetes version info

func (*TkgClient) GetKubevipImageAndTag

func (c *TkgClient) GetKubevipImageAndTag(kcp *capikubeadmv1beta1.KubeadmControlPlane) (string, string, error)

func (*TkgClient) GetMCClusterPinnipedInfo

func (c *TkgClient) GetMCClusterPinnipedInfo(regionalClusterClient clusterclient.Client,
	curRegion region.RegionContext, options GetClusterPinnipedInfoOptions) (*ClusterPinnipedInfo, error)

GetMCClusterPinnipedInfo get pinniped information for management cluster

func (*TkgClient) GetMachineDeployments

func (c *TkgClient) GetMachineDeployments(options GetMachineDeploymentOptions) ([]capi.MachineDeployment, error)

GetMachineDeployments retrieves machine deployments for a cluster

func (*TkgClient) GetMachineHealthChecks

func (c *TkgClient) GetMachineHealthChecks(options MachineHealthCheckOptions) ([]MachineHealthCheck, error)

GetMachineHealthChecks gets machinehealthcheck

func (*TkgClient) GetMachineHealthChecksWithClusterClient

func (c *TkgClient) GetMachineHealthChecksWithClusterClient(clusterClient clusterclient.Client, options MachineHealthCheckOptions) ([]MachineHealthCheck, error)

GetMachineHealthChecksWithClusterClient gets machinehealthcheck with client

func (*TkgClient) GetPacificClusterObject

func (c *TkgClient) GetPacificClusterObject(clusterName, namespace string) (*tkgsv1alpha2.TanzuKubernetesCluster, error)

GetPacificClusterObject return Pacific cluster object

func (*TkgClient) GetPacificMachineDeployments

func (c *TkgClient) GetPacificMachineDeployments(options GetMachineDeploymentOptions) ([]capiv1alpha3.MachineDeployment, error)

GetPacificMachineDeployments retrieves machine deployments for a Pacific(TKGS) cluster This is defined separately for Pacific (TKGS) provider because the TKGS and TKGm CAPI versions could be different and this should be deprecated after clusterclass is adopted by both TKGm and TKGS

func (*TkgClient) GetRegionContexts

func (c *TkgClient) GetRegionContexts(clusterName string) ([]region.RegionContext, error)

GetRegionContexts returns mangement cluster contexts

func (*TkgClient) GetTanzuKubernetesReleases

func (c *TkgClient) GetTanzuKubernetesReleases(tkrName string) ([]runv1alpha1.TanzuKubernetesRelease, error)

GetTanzuKubernetesReleases returns TKr list

func (*TkgClient) GetUserConfigVariableValueMap

func (c *TkgClient) GetUserConfigVariableValueMap(configDefaultFilePath string, rw tkgconfigreaderwriter.TKGConfigReaderWriter) (map[string]interface{}, error)

GetUserConfigVariableValueMap is a specific implementation expecting to use a flat key-value file to provide a source of keys to filter for the valid user provided values. For example, this function uses config_default.yaml filepath to find relevant config variables and returns the config map of user provided variable among all applicable config variables

func (*TkgClient) GetVSphereEndpoint

func (c *TkgClient) GetVSphereEndpoint(clusterClient clusterclient.Client) (vc.Client, error)

GetVSphereEndpoint gets vsphere client based on credentials set in config variables

func (*TkgClient) GetWCClusterPinnipedInfo

func (c *TkgClient) GetWCClusterPinnipedInfo(
	regionalClusterClient clusterclient.Client,
	_ region.RegionContext,
	options GetClusterPinnipedInfoOptions,
	isPacific bool,
	isClusterClassBased bool) (*ClusterPinnipedInfo, error)

GetWCClusterPinnipedInfo gets pinniped information for workload cluster

func (*TkgClient) GetWorkloadClusterCredentials

func (c *TkgClient) GetWorkloadClusterCredentials(options GetWorkloadClusterCredentialsOptions) (string, string, error)

GetWorkloadClusterCredentials gets and saves workload cluster credentials

func (*TkgClient) HandleKappControllerUpgrade

func (c *TkgClient) HandleKappControllerUpgrade(regionalClusterClient, currentClusterClient clusterclient.Client, upgradeClusterConfig *ClusterUpgradeInfo) error

HandleKappControllerUpgrade is only meant for testing handleKappControllerUpgrade

func (*TkgClient) InitRegion

func (c *TkgClient) InitRegion(options *InitRegionOptions) error

InitRegion create management cluster

func (*TkgClient) InitRegionDryRun

func (c *TkgClient) InitRegionDryRun(options *InitRegionOptions) ([]byte, error)

InitRegionDryRun run management cluster dry-run

func (*TkgClient) InitializeProviders

func (c *TkgClient) InitializeProviders(options *InitRegionOptions, clusterClient clusterclient.Client, kubeconfigPath string) error

InitializeProviders initializes providers

func (*TkgClient) InstallAKO

func (c *TkgClient) InstallAKO(mcClient clusterclient.Client) error

InstallAKO install AKO to the cluster

func (*TkgClient) InstallOrUpgradeKappController

func (c *TkgClient) InstallOrUpgradeKappController(clusterClient clusterclient.Client, operationType constants.OperationType, upgrade bool) error

func (*TkgClient) InstallOrUpgradeManagementComponents

func (c *TkgClient) InstallOrUpgradeManagementComponents(mcClient clusterclient.Client, pkgClient packageclient.PackageClient, kubecontext string, upgrade bool) error

InstallOrUpgradeManagementComponents install management components to the cluster

func (*TkgClient) IsFeatureActivated

func (c *TkgClient) IsFeatureActivated(feature string) bool

IsFeatureActivated checkes if a feature flag is set to "true"

func (*TkgClient) IsKubevipManifestInKCP

func (c *TkgClient) IsKubevipManifestInKCP(kcp *capikubeadmv1beta1.KubeadmControlPlane) bool

func (*TkgClient) IsManagementClusterAKindCluster

func (c *TkgClient) IsManagementClusterAKindCluster(clusterName string) (bool, error)

IsManagementClusterAKindCluster Determining if the management cluster creation is successful based on the presence of Annotation 'TKGVERSION: <version>'.

Management clusters are annotated with the TKG version if they are successful.
If the annotation is not present, the cluster is determined to be failed management cluster (kind cluster) with some un-deleted infrastructure resources

func (*TkgClient) IsPacificManagementCluster

func (c *TkgClient) IsPacificManagementCluster() (bool, error)

IsPacificManagementCluster check if management cluster is TKGS cluster

func (*TkgClient) IsPacificRegionalCluster

func (c *TkgClient) IsPacificRegionalCluster() (bool, error)

IsPacificRegionalCluster checks if the cluster pointed to by kubeconfig is Pacific management cluster(supervisor)

func (*TkgClient) ListTKGClusters

func (c *TkgClient) ListTKGClusters(options ListTKGClustersOptions) ([]ClusterInfo, error)

ListTKGClusters lists tkg cluster information

func (*TkgClient) MoveObjects

func (c *TkgClient) MoveObjects(fromKubeconfigPath, toKubeconfigPath, namespace string) error

MoveObjects moves all the Cluster API objects from all the namespaces to a target management cluster.

func (*TkgClient) OverrideAWSNodeSizeWithOptions

func (c *TkgClient) OverrideAWSNodeSizeWithOptions(options NodeSizeOptions, awsClient aws.Client, skipValidation bool) error

OverrideAWSNodeSizeWithOptions overrides aws node size with options

func (*TkgClient) OverrideAzureNodeSizeWithOptions

func (c *TkgClient) OverrideAzureNodeSizeWithOptions(client azure.Client, options NodeSizeOptions, skipValidation bool) error

OverrideAzureNodeSizeWithOptions overrides azure node size with options

func (*TkgClient) OverrideVsphereNodeSizeWithOptions

func (c *TkgClient) OverrideVsphereNodeSizeWithOptions(options NodeSizeOptions) error

OverrideVsphereNodeSizeWithOptions overrides vsphere node size with options

func (*TkgClient) ParseHiddenArgsAsFeatureFlags

func (c *TkgClient) ParseHiddenArgsAsFeatureFlags(options *InitRegionOptions)

ParseHiddenArgsAsFeatureFlags adds the hidden flags from InitRegionOptions as enabled feature flags

func (*TkgClient) PatchClusterInitOperations

func (c *TkgClient) PatchClusterInitOperations(regionalClusterClient clusterclient.Client, options *InitRegionOptions, targetClusterNamespace string) error

PatchClusterInitOperations Patches cluster

func (*TkgClient) PatchKubernetesVersionToKubeadmControlPlane

func (c *TkgClient) PatchKubernetesVersionToKubeadmControlPlane(regionalClusterClient clusterclient.Client, clusterUpgradeConfig *ClusterUpgradeInfo) error

func (*TkgClient) PrepareAddonsManagerUpgrade

func (c *TkgClient) PrepareAddonsManagerUpgrade(regionalClusterClient clusterclient.Client, upgradeClusterConfig *ClusterUpgradeInfo) error

PrepareAddonsManagerUpgrade is only meant for testing prepareAddonsManagerUpgrade

func (*TkgClient) RestartCAPZControllerManagerPod

func (c *TkgClient) RestartCAPZControllerManagerPod(clusterClient clusterclient.Client) error

func (*TkgClient) RetrieveRegionalClusterConfiguration

func (c *TkgClient) RetrieveRegionalClusterConfiguration(regionalClusterClient clusterclient.Client) error

RetrieveRegionalClusterConfiguration gets TKG configurations from regional cluster and updates the in-memory config. this is required when we want to mutate the existing regional cluster.

func (*TkgClient) RetrieveWorkloadClusterConfiguration

func (c *TkgClient) RetrieveWorkloadClusterConfiguration(regionalClusterClient, workloadClusterClient clusterclient.Client, clusterName, clusterNamespace string) error

RetrieveWorkloadClusterConfiguration gets TKG configurations from regional cluster as well as workload cluster and updates the in-memory config. This is required when we want to mutate the existing workload cluster.

func (*TkgClient) SaveFeatureFlags

func (c *TkgClient) SaveFeatureFlags(featureFlags map[string]string) error

SaveFeatureFlags saves the feature flags to the config file via featuresClient

func (*TkgClient) ScaleCluster

func (c *TkgClient) ScaleCluster(options ScaleClusterOptions) error

ScaleCluster scales cluster vertically

func (*TkgClient) ScalePacificCluster

func (c *TkgClient) ScalePacificCluster(options *ScaleClusterOptions, clusterClient clusterclient.Client) error

ScalePacificCluster scale TKGS cluster

func (*TkgClient) SetAllowLegacyClusterConfiguration

func (c *TkgClient) SetAllowLegacyClusterConfiguration() string

Sets the appropriate AllowLegacyCluster configuration unless it has been explicitly overridden

func (*TkgClient) SetAndValidateDefaultAWSVPCConfiguration

func (c *TkgClient) SetAndValidateDefaultAWSVPCConfiguration(isProdConfig bool, awsClient aws.Client, skipValidation bool) (bool, error)

SetAndValidateDefaultAWSVPCConfiguration sets default value for AWS configuration variables Depending on whether AWS_VPC_ID is set/unset in the tkgconfig, values pertaining to configuring for existing/new VPC needs to be initialized to "" It returns whether creating cluster within existing vpc.

func (*TkgClient) SetBuildEdition

func (c *TkgClient) SetBuildEdition(buildEdition string)

SetBuildEdition saves the build edition

func (*TkgClient) SetCEIPParticipation

func (c *TkgClient) SetCEIPParticipation(ceipOptIn bool, isProd, labels string) error

SetCEIPParticipation sets CEIP participation

func (*TkgClient) SetDefaultProxySettings

func (c *TkgClient) SetDefaultProxySettings()

SetDefaultProxySettings is used to configure default proxy settings. The TKG proxy variables are required for cloud-api component templates rendering. Need to set them to "" if the proxy variables are not available.

func (*TkgClient) SetMachineDeployment

func (c *TkgClient) SetMachineDeployment(options *SetMachineDeploymentOptions) error

SetMachineDeployment sets a MachineDeployment on a cluster.

func (*TkgClient) SetMachineDeploymentWorkerCounts

func (c *TkgClient) SetMachineDeploymentWorkerCounts(workerCounts []int, totalWorkerMachineCount int64, isProdConfig bool)

SetMachineDeploymentWorkerCounts sets machine deployment counts

func (*TkgClient) SetMachineHealthCheck

func (c *TkgClient) SetMachineHealthCheck(options *SetMachineHealthCheckOptions) error

SetMachineHealthCheck sets machinehealthcheck

func (*TkgClient) SetNodePoolsForPacificCluster

func (c *TkgClient) SetNodePoolsForPacificCluster(clusterClient clusterclient.Client, options *SetMachineDeploymentOptions) error

SetNodePoolsForPacificCluster sets nodepool for Pacific cluster

func (*TkgClient) SetPinnipedConfigForWorkloadCluster

func (c *TkgClient) SetPinnipedConfigForWorkloadCluster(issuerURL, issuerCA string)

SetPinnipedConfigForWorkloadCluster sets the pinniped configuration(concierge) for workload cluster

func (*TkgClient) SetPlan

func (c *TkgClient) SetPlan(planName string)

SetPlan saves the plan name

func (*TkgClient) SetProviderType

func (c *TkgClient) SetProviderType(providerType string)

SetProviderType saves the provider type

func (*TkgClient) SetRegionContext

func (c *TkgClient) SetRegionContext(clusterName, contextName string) error

SetRegionContext sets management cluster contexts

func (*TkgClient) SetTKGClusterRole

func (c *TkgClient) SetTKGClusterRole(clusterType TKGClusterType)

SetTKGClusterRole sets the value of label tkg.tanzu.vmware.com/cluster-role for CAPI Cluster object.

func (*TkgClient) SetTKGVersion

func (c *TkgClient) SetTKGVersion()

SetTKGVersion saves the tkg version based on Default BoM file

func (*TkgClient) SetVsphereNodeSize

func (c *TkgClient) SetVsphereNodeSize()

SetVsphereNodeSize sets vsphere node size

func (*TkgClient) SetVsphereVersion

func (c *TkgClient) SetVsphereVersion(vsphereVersion string)

SetVsphereVersion saves the vsphere version

func (*TkgClient) ShouldDeployClusterClassBasedCluster

func (c *TkgClient) ShouldDeployClusterClassBasedCluster(isManagementCluster bool) (bool, error)

func (*TkgClient) ShouldManageCEIP

func (c *TkgClient) ShouldManageCEIP(clusterClient clusterclient.Client, ctx region.RegionContext) (bool, error)

ShouldManageCEIP determines if TKG should be managing CEIP starting in TKG v1.6.0, the telemetry cron job will be configured by the tanzu telemetry plugin, and not the CEIP command the telemetry cron job will now also actively check CEIP participation status, and must always be installed the CEIP command will still be used to fix clusters v1.6.0+ that are in a bad state and are missing the cron job

func (*TkgClient) TKGConfigReaderWriter

func (c *TkgClient) TKGConfigReaderWriter() tkgconfigreaderwriter.TKGConfigReaderWriter

TKGConfigReaderWriter returns tkgConfigReaderWriter client

func (*TkgClient) TrimVsphereSSHKey

func (c *TkgClient) TrimVsphereSSHKey()

TrimVsphereSSHKey trim the comment part of the vsphere ssh key

func (*TkgClient) UpdateAzureClusterCredentials

func (c *TkgClient) UpdateAzureClusterCredentials(clusterClient clusterclient.Client, options *UpdateCredentialsOptions) error

UpdateAzureClusterCredentials update azure cluster credentials

func (*TkgClient) UpdateAzureCredentialsForCluster

func (c *TkgClient) UpdateAzureCredentialsForCluster(clusterClient clusterclient.Client, options *UpdateCredentialsOptions, unifiedIdentity bool) error

func (*TkgClient) UpdateCredentialsCluster

func (c *TkgClient) UpdateCredentialsCluster(options *UpdateCredentialsOptions) error

UpdateCredentialsCluster update cluster credentials

func (*TkgClient) UpdateCredentialsRegion

func (c *TkgClient) UpdateCredentialsRegion(options *UpdateCredentialsOptions) error

UpdateCredentialsRegion update management cluster credentials

func (*TkgClient) UpdateKubeVipConfigInKCP

func (c *TkgClient) UpdateKubeVipConfigInKCP(currentKCP *capikubeadmv1beta1.KubeadmControlPlane, upgradeComponentInfo ComponentInfo) (*capikubeadmv1beta1.KubeadmControlPlane, error)

UpdateKubeVipConfigInKCP updates the kube-vip parameters and image tag within the contents of the file inside the KCP

func (*TkgClient) UpdateMachineHealthCheck

func (c *TkgClient) UpdateMachineHealthCheck(candidate *capi.MachineHealthCheck, clusterClient clusterclient.Client, options *SetMachineHealthCheckOptions) error

UpdateMachineHealthCheck updates machinehealthcheck

func (*TkgClient) UpdateVSphereClusterCredentials

func (c *TkgClient) UpdateVSphereClusterCredentials(clusterClient clusterclient.Client, options *UpdateCredentialsOptions) error

UpdateVSphereClusterCredentials update vsphere cluster credentials

func (*TkgClient) UpgradeAddon

func (c *TkgClient) UpgradeAddon(options *UpgradeAddonOptions) error

UpgradeAddon upgrades addons

func (*TkgClient) UpgradeCluster

func (c *TkgClient) UpgradeCluster(options *UpgradeClusterOptions) error

UpgradeCluster upgrades workload and management clusters k8s version Steps:

  1. Verify k8s version
  2. Get the Upgrade configuration by reading BOM file to get the ImageTag and ImageRepository information for CoreDNS and Etcd, Read AWS_AMI_ID map from BOM for AWS upgrade scenario. Also use command line argument options to fill the upgrade configuration
  3. Create InfrastructureMachineTemplates(VSphereMachineTemplate, AWSMachineTemplate, AzureMachineTemplate) required for upgrade
  4. Patch KCP object to upgrade control-plane nodes
  5. Wait for k8s version to be updated for the cluster
  6. Patch MachineDeployment object to upgrade worker nodes
  7. Wait for k8s version to be updated for all worker nodes

func (*TkgClient) UpgradeManagementCluster

func (c *TkgClient) UpgradeManagementCluster(options *UpgradeClusterOptions) error

UpgradeManagementCluster upgrades management clusters providers and k8s version Steps:

  1. Upgrade providers a) Get the Upgrade configuration by reading BOM file to get the providers versions b) Get the providers information from the management cluster c) Prepare the providers upgrade information d) Call the clusterctl ApplyUpgrade() to upgrade providers e) Wait for providers to be up and running
  2. call the UpgradeCluster() for upgrading the k8s version of the Management cluster

func (*TkgClient) ValidateAndConfigureClusterOptions

func (c *TkgClient) ValidateAndConfigureClusterOptions(options *CreateClusterOptions) error

ValidateAndConfigureClusterOptions validates and configures the cluster options user want to enable through command line options

func (*TkgClient) ValidateAviCloud

func (c *TkgClient) ValidateAviCloud(aviClient avi.Client) error

ValidateAviCloud validates if configured cloud exists or not

func (*TkgClient) ValidateAviControlPlaneNetwork

func (c *TkgClient) ValidateAviControlPlaneNetwork(aviClient avi.Client) error

ValidateAviControlPlaneNetwork validates if workload clusters' control plane vip network is valid or not

func (*TkgClient) ValidateAviControllerAccount

func (c *TkgClient) ValidateAviControllerAccount(aviClient avi.Client) error

ValidateAviControllerAccount validates if provide avi credentials are able to connect to avi controller or not

func (*TkgClient) ValidateAviDataPlaneNetwork

func (c *TkgClient) ValidateAviDataPlaneNetwork(aviClient avi.Client) error

ValidateAviDataPlaneNetwork validates if workload clusters' data plane vip network is valid or not

func (*TkgClient) ValidateAviManagementClusterControlPlaneNetwork

func (c *TkgClient) ValidateAviManagementClusterControlPlaneNetwork(aviClient avi.Client) error

ValidateAviManagementClusterControlPlaneNetwork checks if configured management cluster control plane vip network is valid or not

func (*TkgClient) ValidateAviManagementClusterDataPlaneNetwork

func (c *TkgClient) ValidateAviManagementClusterDataPlaneNetwork(aviClient avi.Client) error

ValidateAviManagementClusterDataPlaneNetwork checks if configured management cluster data plane vip network is valid or not

func (*TkgClient) ValidateAviManagementClusterServiceEngineGroup

func (c *TkgClient) ValidateAviManagementClusterServiceEngineGroup(aviClient avi.Client) error

ValidateAviManagementClusterServiceEngineGroup validates if configured management cluster service engine group exists or not

func (*TkgClient) ValidateAviMaxAllowedClusterNameLength

func (c *TkgClient) ValidateAviMaxAllowedClusterNameLength(clusterRole, clusterName string, regionalClusterClient clusterclient.Client, skipValidation bool) error

ValidateAviMaxAllowedClusterNameLength validates if AVI enabled cluster's name has no more than 25 characters

func (*TkgClient) ValidateAviNetwork

func (c *TkgClient) ValidateAviNetwork(networkName, networkCIDR string, aviClient avi.Client) error

ValidateAviNetwork validates if the network can be found in AVI controller or not and the subnet CIDR format is correct or not

func (*TkgClient) ValidateAviServiceEngineGroup

func (c *TkgClient) ValidateAviServiceEngineGroup(aviClient avi.Client) error

ValidateAviServiceEngineGroup validates if configured service engine group exists or not

func (*TkgClient) ValidateAzurePublicSSHKey

func (c *TkgClient) ValidateAzurePublicSSHKey() error

ValidateAzurePublicSSHKey validates AZURE_SSH_PUBLIC_KEY_B64 exists and is base64 encoded

func (*TkgClient) ValidateDockerResourcePrerequisites

func (c *TkgClient) ValidateDockerResourcePrerequisites() error

ValidateDockerResourcePrerequisites validates docker number CPU and memory resource settings

func (*TkgClient) ValidateEnvVariables

func (c *TkgClient) ValidateEnvVariables(iaas string) error

ValidateEnvVariables validates the presence of required environment variables for a given IaaS

func (*TkgClient) ValidateExtraArgs

func (c *TkgClient) ValidateExtraArgs() error

func (*TkgClient) ValidateKubeVipLBConfiguration

func (c *TkgClient) ValidateKubeVipLBConfiguration(clusterRole string) error

ValidateKubeVipLBConfiguration validates the configuration inputs of Kubevip Loadbalancer related variables

func (*TkgClient) ValidateManagementClusterUpgradeVersionCompatibility

func (c *TkgClient) ValidateManagementClusterUpgradeVersionCompatibility(options *UpgradeClusterOptions, regionalClusterClient clusterclient.Client) error

ValidateManagementClusterUpgradeVersionCompatibility validates the upgrade version compatibility for a management cluster

func (*TkgClient) ValidateManagementClusterVersionWithCLI

func (c *TkgClient) ValidateManagementClusterVersionWithCLI(regionalClusterClient clusterclient.Client) error

ValidateManagementClusterVersionWithCLI validate management cluster version with cli version

func (*TkgClient) ValidatePrerequisites

func (c *TkgClient) ValidatePrerequisites(validateDocker, validateKubectl bool) error

ValidatePrerequisites validate docker and kubectl commands

func (*TkgClient) ValidateSupportOfK8sVersionForManagmentCluster

func (c *TkgClient) ValidateSupportOfK8sVersionForManagmentCluster(regionalClusterClient clusterclient.Client, kubernetesVersion string, skipValidation bool) error

ValidateSupportOfK8sVersionForManagmentCluster validate k8s version support for management cluster

func (*TkgClient) ValidateVsphereControlPlaneEndpointIP

func (c *TkgClient) ValidateVsphereControlPlaneEndpointIP(endpointIP string) *ValidationError

ValidateVsphereControlPlaneEndpointIP validates if the control plane endpoint has been used by another cluster in the same network

func (*TkgClient) ValidateVsphereNodeSize

func (c *TkgClient) ValidateVsphereNodeSize() error

ValidateVsphereNodeSize validates vsphere node size

func (*TkgClient) ValidateVsphereResources

func (c *TkgClient) ValidateVsphereResources(vcClient vc.Client, dcPath string) error

ValidateVsphereResources validates vsphere resource path specified in tkgconfig

func (*TkgClient) ValidateVsphereVipWorkloadCluster

func (c *TkgClient) ValidateVsphereVipWorkloadCluster(clusterClient clusterclient.Client, vip string, skipValidation bool) error

ValidateVsphereVipWorkloadCluster validates that the control plane endpoint is unique

func (*TkgClient) VerifyRegion

func (c *TkgClient) VerifyRegion(kubeConfigPath string) (region.RegionContext, error)

VerifyRegion verifies management cluster

func (*TkgClient) WaitForAddons

func (c *TkgClient) WaitForAddons(options waitForAddonsOptions) error

WaitForAddons wait for addons to be installed

func (*TkgClient) WaitForAddonsCorePackagesInstallation

func (c *TkgClient) WaitForAddonsCorePackagesInstallation(options waitForAddonsOptions) error

WaitForAddonsCorePackagesInstallation gets ClusterBootstrap and collects list of addons core packages, and monitors the kapp controller package installation in management cluster and rest of core packages installation in workload cluster

func (*TkgClient) WaitForAddonsDeployments

func (c *TkgClient) WaitForAddonsDeployments(clusterClient clusterclient.Client) error

WaitForAddonsDeployments wait for addons deployments

func (*TkgClient) WaitForAutoscalerDeployment

func (c *TkgClient) WaitForAutoscalerDeployment(regionalClusterClient clusterclient.Client, clusterName, targetNamespace string, isClusterClassBased bool)

WaitForAutoscalerDeployment waits for autoscaler deployment if enabled

func (*TkgClient) WaitForClusterInitializedAndGetKubeConfig

func (c *TkgClient) WaitForClusterInitializedAndGetKubeConfig(clusterClient clusterclient.Client, name, targetNamespace string) ([]byte, error)

WaitForClusterInitializedAndGetKubeConfig wait for cluster initialization and once initialized get kubeconfig

func (*TkgClient) WaitForClusterReadyAfterCreate

func (c *TkgClient) WaitForClusterReadyAfterCreate(clusterClient clusterclient.Client, name, targetNamespace string) error

WaitForClusterReadyAfterCreate wait for cluster to be ready after creation

func (*TkgClient) WaitForClusterReadyAfterReverseMove

func (c *TkgClient) WaitForClusterReadyAfterReverseMove(clusterClient clusterclient.Client, name, targetNamespace string) error

WaitForClusterReadyAfterReverseMove Called when relocating cluster-api objects out from the management cluster to the cleanup cluster.

func (*TkgClient) WaitForClusterReadyForMove

func (c *TkgClient) WaitForClusterReadyForMove(clusterClient clusterclient.Client, name, targetNamespace string) error

WaitForClusterReadyForMove wait for cluster to be ready for move operation

func (*TkgClient) WaitForPackages

func (c *TkgClient) WaitForPackages(regionalClusterClient, currentClusterClient clusterclient.Client, clusterName, namespace string, isRegionalCluster bool) error

WaitForPackages wait for packages to be up and running

func (*TkgClient) WaitForProviders

func (c *TkgClient) WaitForProviders(clusterClient clusterclient.Client, options waitForProvidersOptions) error

WaitForProviders checks and waits for each provider components to be up and running

type UpdateCredentialsOptions

type UpdateCredentialsOptions struct {
	ClusterName                 string
	Namespace                   string
	Kubeconfig                  string
	VSphereUpdateClusterOptions *VSphereUpdateClusterOptions
	AzureUpdateClusterOptions   *AzureUpdateClusterOptions
	IsRegionalCluster           bool
	IsCascading                 bool
}

UpdateCredentialsOptions update credential options

type UpgradeAddonOptions

type UpgradeAddonOptions struct {
	AddonNames        []string
	ClusterName       string
	Namespace         string
	Kubeconfig        string
	IsRegionalCluster bool
	Edition           string
}

UpgradeAddonOptions upgrade addon options

type UpgradeClusterOptions

type UpgradeClusterOptions struct {
	ClusterName         string
	Namespace           string
	KubernetesVersion   string
	TkrVersion          string
	Kubeconfig          string
	VSphereTemplateName string
	OSName              string
	OSVersion           string
	OSArch              string
	IsRegionalCluster   bool
	SkipAddonUpgrade    bool
	SkipPrompt          bool
	IsTKGSCluster       bool
	// Tanzu edition (either tce or tkg)
	Edition string
}

UpgradeClusterOptions upgrade cluster options

type UpgradeManagementClusterOptions

type UpgradeManagementClusterOptions struct {
	ClusterName         string
	Namespace           string
	KubernetesVersion   string
	Kubeconfig          string
	IsRegionalCluster   bool
	VSphereTemplateName string
	BOMFilePath         string
}

UpgradeManagementClusterOptions upgrade management cluster options

type VSphereNodePool

type VSphereNodePool struct {
	CloneMode         string   `yaml:"cloneMode,omitempty"`
	Datacenter        string   `yaml:"datacenter,omitempty"`
	Datastore         string   `yaml:"datastore,omitempty"`
	StoragePolicyName string   `yaml:"storagePolicyName,omitempty"`
	Folder            string   `yaml:"folder,omitempty"`
	Network           string   `yaml:"network,omitempty"`
	Nameservers       []string `yaml:"nameservers,omitempty"`
	TKGIPFamily       string   `yaml:"tkgIPFamily,omitempty"`
	ResourcePool      string   `yaml:"resourcePool,omitempty"`
	VCIP              string   `yaml:"vcIP,omitempty"`
	Template          string   `yaml:"template,omitempty"`
	MemoryMiB         int64    `yaml:"memoryMiB,omitempty"`
	DiskGiB           int32    `yaml:"diskGiB,omitempty"`
	NumCPUs           int32    `yaml:"numCPUs,omitempty"`
}

VSphereNodePool a struct describing properties necessary for a node pool on vSphere

type VSphereUpdateClusterOptions

type VSphereUpdateClusterOptions struct {
	Username string
	Password string
}

VSphereUpdateClusterOptions vsphere credential options

type ValidationError

type ValidationError struct {
	Message string
	Code    int
}

ValidationError defines error during config validation

func NewValidationError

func NewValidationError(code int, text string) *ValidationError

NewValidationError creates new validation error object

func ValidateVSphereVersion

func ValidateVSphereVersion(vcClient vc.Client) *ValidationError

ValidateVSphereVersion validates vsphere version

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error returns error message from validation error

Jump to

Keyboard shortcuts

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