Documentation ¶
Index ¶
- Constants
- Variables
- func AZACRCacheCreate(acrName, ruleName, imageURL, imageName, rg string) (err error)
- func AZACRLogin() (err error)
- func CheckPodExist(cs clientset.Interface, ns, name string) bool
- func CompareStrings(s0, s1 []*string) bool
- func CreateHostExecPod(cs clientset.Interface, ns, name string) (bool, error)
- func CreateKubeClientSet() (clientset.Interface, error)
- func CreateLoadBalancerServiceManifest(name string, annotation map[string]string, labels map[string]string, ...) *v1.Service
- func CreateNodeManifest(name string, labels map[string]string) *v1.Node
- func CreatePod(cs clientset.Interface, ns string, manifest *v1.Pod) error
- func CreatePodGetIPManifest() *v1.Pod
- func CreateTestResourceGroup(tc *AzureTestClient) (*resources.ResourceGroup, func(string))
- func CreateTestingNamespace(baseName string, cs clientset.Interface) (*v1.Namespace, error)
- func DeepCopyMap(m map[string]string) map[string]string
- func DeleteNamespace(cs clientset.Interface, namespace string) error
- func DeleteNodes(cs clientset.Interface, names []string) error
- func DeletePIPPrefixWithRetry(cli *AzureTestClient, name string) error
- func DeletePIPWithRetry(azureTestClient *AzureTestClient, ipName, rgName string) error
- func DeletePod(cs clientset.Interface, ns string, podName string) error
- func DeletePodsInNamespace(cs clientset.Interface, ns string) error
- func DeleteService(cs clientset.Interface, ns string, serviceName string) error
- func ExtractDNSPrefix() string
- func FindTestVMSS(tc *AzureTestClient, rgName string) (*azcompute.VirtualMachineScaleSet, error)
- func GetAgentNodes(cs clientset.Interface) ([]v1.Node, error)
- func GetAllNodes(cs clientset.Interface) ([]v1.Node, error)
- func GetGPUResource(node *v1.Node) (bool, int64)
- func GetMaster(cs clientset.Interface) (*v1.Node, error)
- func GetNICByID(nicID string, nicList []*network.Interface) (*network.Interface, error)
- func GetNameWithSuffix(name, suffix string) string
- func GetNextSubnetCIDRs(vnet *aznetwork.VirtualNetwork, ipFamily IPFamily) ([]*net.IPNet, error)
- func GetNicIDsFromVM(vm *compute.VirtualMachine) (map[string]interface{}, error)
- func GetNicIDsFromVMSSVM(vm *compute.VirtualMachineScaleSetVM) (map[string]interface{}, error)
- func GetNode(cs clientset.Interface, nodeName string) (*v1.Node, error)
- func GetNodeResourceGroup(node *v1.Node) (string, error)
- func GetNodeRunningQuantity(cs clientset.Interface, nodeName string) (resource.Quantity, error)
- func GetNodepoolNodeMap(nodes *[]v1.Node) map[string][]string
- func GetNodesInRouteTable(routeTable aznetwork.RouteTable) (map[string]interface{}, error)
- func GetPod(cs clientset.Interface, ns, name string) (pod *v1.Pod, err error)
- func GetPodList(cs clientset.Interface, ns string) (*v1.PodList, error)
- func GetPodOutboundIP(cs clientset.Interface, podTemplate *v1.Pod, nsName string) (string, error)
- func GetServiceDomainName(prefix string) (ret string)
- func GetTargetNICFromList(list []*network.Interface, targetVMNamePrefix string) (*network.Interface, error)
- func GetVMComputerName(vm *armcompute.VirtualMachine) (string, error)
- func GetVMSS(tc *AzureTestClient, vmssName string) (*azcompute.VirtualMachineScaleSet, error)
- func GetVMSSVMComputerName(vm *azcompute.VirtualMachineScaleSetVM) (string, error)
- func HoldAutoScaleNodes(cs clientset.Interface, targetNodeCount int) error
- func IfIPFamiliesEnabled(ipFamily IPFamily) (v4Enabled bool, v6Enabled bool)
- func IsAutoscalingAKSCluster() bool
- func IsControlPlaneNode(node *v1.Node) bool
- func IsInternalEndpoint(ip string) bool
- func IsNodeInVMSS(tc *AzureTestClient, nodeName, vmssName string) (bool, error)
- func IsRetryableAPIError(err error) bool
- func IsSpotVMSS(vmss *azcompute.VirtualMachineScaleSet) bool
- func IsSystemPoolNode(node *v1.Node) bool
- func KubectlCmd(namespace string, args ...string) *exec.Cmd
- func KustoIngest(passed bool, labelFilter, clusterType, junitReportPath string) error
- func LabelNode(cs clientset.Interface, node *v1.Node, label string, isDelete bool) (*v1.Node, error)
- func ListNICs(tc *AzureTestClient, rgName string) ([]*network.Interface, error)
- func ListRouteTables(tc *AzureTestClient) ([]*aznetwork.RouteTable, error)
- func ListUniformVMSSes(tc *AzureTestClient) ([]*azcompute.VirtualMachineScaleSet, error)
- func ListVMSSNICs(tc *AzureTestClient, vmssName string) ([]*network.Interface, error)
- func ListVMSSVMs(tc *AzureTestClient, vmssName string) ([]*azcompute.VirtualMachineScaleSetVM, error)
- func ListVMs(tc *AzureTestClient) ([]*armcompute.VirtualMachine, error)
- func LogPodStatus(cs clientset.Interface, ns string) error
- func Logf(format string, args ...interface{})
- func LookForStringInPodExec(ns, podName string, command []string, expectedString string, ...) (result string, err error)
- func LookForStringInPodExecToContainer(ns, podName, containerName string, command []string, expectedString string, ...) (result string, err error)
- func PrintCreateSVCSuccessfully(svc string, ns string)
- func RunKubectl(namespace string, args ...string) (string, error)
- func RunKubectlNoPrint(namespace string, args ...string) (string, error)
- func RunKubectlOrDie(namespace string, args ...string) string
- func Scale(tc *AzureTestClient, vmssName string, instanceCount int64) error
- func ScaleMachinePool(vmssName string, instanceCount int64) error
- func ScaleVMSS(tc *AzureTestClient, vmssName string, instanceCount int64) (err error)
- func SelectAvailablePrivateIPs(tc *AzureTestClient) ([]*string, error)
- func StrPtrSliceToStrSlice(s []*string) []string
- func StringInSlice(s string, list []string) bool
- func ValidateClusterNodesMatchVMSSInstances(tc *AzureTestClient, expectedCap map[string]int64, originalNodes []v1.Node) error
- func ValidateServiceConnectivity(ns, execPod, serviceIP string, port int, protocol v1.Protocol) error
- func ValidateVMSSNodeLabels(tc *AzureTestClient, vmss *azcompute.VirtualMachineScaleSet, key string) error
- func WaitAutoScaleNodes(cs clientset.Interface, targetNodeCount int, isScaleDown bool) error
- func WaitCreatePIP(azureTestClient *AzureTestClient, ipName, rgName string, ...) (*aznetwork.PublicIPAddress, error)
- func WaitCreatePIPPrefix(cli *AzureTestClient, name, rgName string, parameter aznetwork.PublicIPPrefix) (*aznetwork.PublicIPPrefix, error)
- func WaitGetAgentNodes(cs clientset.Interface) (nodes []v1.Node, err error)
- func WaitGetPIP(azureTestClient *AzureTestClient, ipName string) (pip *aznetwork.PublicIPAddress, err error)
- func WaitGetPIPByPrefix(cli *AzureTestClient, prefixName string, untilPIPCreated bool) (*aznetwork.PublicIPAddress, error)
- func WaitGetPIPPrefix(cli *AzureTestClient, name string) (*aznetwork.PublicIPPrefix, error)
- func WaitPodTo(phase v1.PodPhase, cs clientset.Interface, podTemplate *v1.Pod, nsName string) (result bool, err error)
- func WaitPodsToBeReady(cs clientset.Interface, ns string) error
- func WaitServiceExposure(cs clientset.Interface, namespace string, name string, targetIPs []*string) (*v1.Service, error)
- func WaitServiceExposureAndGetIPs(cs clientset.Interface, namespace string, name string) ([]*string, error)
- func WaitServiceExposureAndValidateConnectivity(cs clientset.Interface, ipFamily IPFamily, namespace string, name string, ...) ([]*string, error)
- func WaitVMSSVMCountToEqualNodeCount(tc *AzureTestClient) error
- type AzureTestClient
- func (tc *AzureTestClient) CreateContainerRegistry() (acr.Registry, error)
- func (tc *AzureTestClient) CreateSecurityGroupsClient() securitygroupclient.Interface
- func (azureTestClient *AzureTestClient) CreateSubnet(vnet *aznetwork.VirtualNetwork, subnetName *string, prefixes []*string, ...) (*aznetwork.Subnet, error)
- func (tc *AzureTestClient) DeleteContainerRegistry(registryName string) (err error)
- func (azureTestClient *AzureTestClient) DeleteSubnet(vnetName string, subnetName string) error
- func (azureTestClient *AzureTestClient) GetClusterSecurityGroups() (ret []*aznetwork.SecurityGroup, err error)
- func (azureTestClient *AzureTestClient) GetClusterVirtualNetwork() (virtualNetwork *aznetwork.VirtualNetwork, err error)
- func (azureTestClient *AzureTestClient) GetLoadBalancer(resourceGroupName, lbName string) (*aznetwork.LoadBalancer, error)
- func (tc *AzureTestClient) GetLocation() string
- func (azureTestClient *AzureTestClient) GetPrivateLinkService(resourceGroupName, plsName string) (*aznetwork.PrivateLinkService, error)
- func (azureTestClient *AzureTestClient) GetPublicIPFromAddress(resourceGroupName string, ipAddr *string) (pip *aznetwork.PublicIPAddress, err error)
- func (tc *AzureTestClient) GetResourceGroup() string
- func (tc *AzureTestClient) GetSubscriptionID() string
- func (azureTestClient *AzureTestClient) ListLoadBalancers(resourceGroupName string) ([]*aznetwork.LoadBalancer, error)
- func (azureTestClient *AzureTestClient) ListPrivateLinkServices(resourceGroupName string) ([]*aznetwork.PrivateLinkService, error)
- func (azureTestClient *AzureTestClient) ListPublicIPs(resourceGroupName string) ([]*aznetwork.PublicIPAddress, error)
- func (tc *AzureTestClient) PushImageToACR(registryName, image string) (string, error)
- type IPFamily
- type KubectlBuilder
Constants ¶
const ( TenantIDEnv = "AZURE_TENANT_ID" SubscriptionEnv = "AZURE_SUBSCRIPTION_ID" AADClientIDEnv = "AZURE_CLIENT_ID" ServicePrincipleSecretEnv = "AZURE_CLIENT_SECRET" // #nosec G101 ClusterLocationEnv = "AZURE_LOCATION" ClusterEnvironment = "AZURE_ENVIRONMENT" LoadBalancerSkuEnv = "AZURE_LOADBALANCER_SKU" )
Environmental variables for validating Azure resource status.
const ( TestSuiteLabelFeatureAutoscaling = "Feature:Autoscaling" TestSuiteLabelSerial = "Serial" TestSuiteLabelSlow = "Slow" TestSuiteLabelMultiNodePools = "Multi-Nodepool" TestSuiteLabelSingleNodePool = "Single-Nodepool" TestSuiteLabelVMSS = "VMSS" TestSuiteLabelVMSSScale = "VMSS-Scale" TestSuiteLabelSpotVM = "Spot-VM" TestSuiteLabelKubenet = "Kubenet" TestSuiteLabelMultiGroup = "Multi-Group" TestSuiteLabelAvailabilitySet = "AvailabilitySet" TestSuiteLabelPrivateLinkService = "PLS" TestSuiteLabelSLBOutbound = "SLBOutbound" TestSuiteLabelServiceAnnotation = "ServiceAnnotation" TestSuiteLabelCredential = "Credential" TestSuiteLabelNode = "Node" TestSuiteLabelLB = "LB" TestSuiteLabelMultiPorts = "Multi-Ports" TestSuiteLabelNSG = "NSG" TestSuiteLabelNonMultiSLB = "Non-Multi-Slb" TestSuiteLabelMultiSLB = "Multi-SLB" TestSuiteUnmanagedNode = "Unmanaged-Node" // If "TEST_CCM" is true, the test is running on a CAPZ cluster. CAPZTestCCM = "TEST_CCM" // If "E2E_ON_AKS_CLUSTER" is true, the test is running on a AKS cluster. AKSTestCCM = "E2E_ON_AKS_CLUSTER" AKSClusterType = "CLUSTER_TYPE" // If "INGEST_TEST_RESULT" is true, the test result needs ingestion to kusto IngestTestResult = "INGEST_TEST_RESULT" // LB backendpool config type, may be nodeIP LBBackendPoolConfigType = "LB_BACKEND_POOL_CONFIG_TYPE" TrueValue = "true" )
test suite labels
const ( NodeModeLabel = "kubernetes.azure.com/mode" NodeModeSystem = "system" NodeModeUser = "user" SystemPool = "systempool" // GPUResourceKey is the key of the GPU in the resource map of a node GPUResourceKey = "nvidia.com/gpu" )
const (
AgnhostImage = "registry.k8s.io/e2e-test-images/agnhost:2.36"
)
const (
ExecAgnhostPod = "exec-agnhost-pod"
)
Variables ¶
var PodIPRE = regexp.MustCompile(`\d{0,3}\.\d{0,3}\.\d{0,3}\.\d{0,3}`)
PodIPRE tests if there's a valid IP in a easy way
Functions ¶
func AZACRCacheCreate ¶ added in v1.25.20
AZACRCacheCreate enables acr cache for a image.
func AZACRLogin ¶ added in v1.25.20
func AZACRLogin() (err error)
func CheckPodExist ¶ added in v1.1.25
CheckPodExist checks if a Pod exists in a namespace with its name.
func CompareStrings ¶ added in v1.24.19
func CreateHostExecPod ¶ added in v1.1.25
CreateHostExecPod creates an Agnhost Pod to exec. It returns if the Pod is running and error.
func CreateKubeClientSet ¶
CreateKubeClientSet obtains the client set interface from Kubeconfig
func CreateLoadBalancerServiceManifest ¶ added in v0.4.0
func CreateLoadBalancerServiceManifest(name string, annotation map[string]string, labels map[string]string, namespace string, ports []v1.ServicePort) *v1.Service
CreateLoadBalancerServiceManifest return the specific service to be created
func CreateNodeManifest ¶ added in v1.28.0
func CreatePodGetIPManifest ¶ added in v1.1.26
CreatePodGetIPManifest creates a Pod manifest getting IP with ifconfig.me.
func CreateTestResourceGroup ¶ added in v0.4.0
func CreateTestResourceGroup(tc *AzureTestClient) (*resources.ResourceGroup, func(string))
CreateTestResourceGroup create a test rg
func CreateTestingNamespace ¶
CreateTestingNamespace builds namespace for each test baseName and labels determine name of the space
func DeleteNamespace ¶
DeleteNamespace deletes the provided namespace, waits for it to be completely deleted, and then checks whether there are any pods remaining in a non-terminating state.
func DeleteNodes ¶
DeleteNodes ensures a list of nodes to be deleted
func DeletePIPPrefixWithRetry ¶ added in v1.0.21
func DeletePIPPrefixWithRetry(cli *AzureTestClient, name string) error
func DeletePIPWithRetry ¶ added in v0.4.0
func DeletePIPWithRetry(azureTestClient *AzureTestClient, ipName, rgName string) error
DeletePIPWithRetry tries to delete a public ip resource
func DeletePodsInNamespace ¶
DeletePodsInNamespace deletes all pods in the namespace
func DeleteService ¶
DeleteService deletes a service if it exists, return nil if not exists.
func ExtractDNSPrefix ¶
func ExtractDNSPrefix() string
ExtractDNSPrefix obtains the cluster DNS prefix
func FindTestVMSS ¶ added in v0.4.0
func FindTestVMSS(tc *AzureTestClient, rgName string) (*azcompute.VirtualMachineScaleSet, error)
FindTestVMSS returns the first VMSS in the resource group, assume the VMSS is in the cluster
func GetAgentNodes ¶
GetAgentNodes obtains the list of agent nodes excluding system pool Nodes.
func GetAllNodes ¶ added in v0.4.0
GetAllNodes obtains the list of all nodes include master
func GetGPUResource ¶ added in v0.6.0
GetGPUResource checks whether the node can provide GPU resource. If so, returns the capacity.
func GetNICByID ¶ added in v0.4.0
GetNICByID returns the network interface with the input ID among the list
func GetNameWithSuffix ¶ added in v1.24.19
GetNameWithSuffix returns resource name with IP family suffix.
func GetNextSubnetCIDRs ¶ added in v1.24.19
GetNextSubnetCIDRs obtains a new ip address which has no overlap with existing subnets.
func GetNicIDsFromVM ¶ added in v0.4.0
func GetNicIDsFromVM(vm *compute.VirtualMachine) (map[string]interface{}, error)
GetNicIDsFromVM returns the NIC ID in the VM
func GetNicIDsFromVMSSVM ¶ added in v0.4.0
func GetNicIDsFromVMSSVM(vm *compute.VirtualMachineScaleSetVM) (map[string]interface{}, error)
GetNicIDsFromVMSSVM returns the NIC ID in the VMSS VM
func GetNodeResourceGroup ¶ added in v0.4.0
GetNodeResourceGroup returns the resource group of the given node
func GetNodeRunningQuantity ¶ added in v0.6.0
GetNodeRunningQuantity will calculate the overall quantity of cpu requested by all running pods in all namespaces on the node
func GetNodepoolNodeMap ¶ added in v0.7.0
func GetNodesInRouteTable ¶ added in v0.4.0
func GetNodesInRouteTable(routeTable aznetwork.RouteTable) (map[string]interface{}, error)
GetNodesInRouteTable returns all the nodes in the route table
func GetPodList ¶ added in v0.6.0
GetPodList is a wrapper around listing pods
func GetPodOutboundIP ¶ added in v0.4.0
GetPodOutboundIP returns the outbound IP of the given pod. It must be used with utils.CreatePodGetIPManifest()
func GetServiceDomainName ¶
GetServiceDomainName cat prefix and azure suffix
func GetTargetNICFromList ¶ added in v0.4.0
func GetTargetNICFromList(list []*network.Interface, targetVMNamePrefix string) (*network.Interface, error)
GetTargetNICFromList pick the target virtual machine's NIC from the given NIC list
func GetVMComputerName ¶ added in v0.4.0
func GetVMComputerName(vm *armcompute.VirtualMachine) (string, error)
GetVMComputerName returns the corresponding node name of the VM
func GetVMSS ¶ added in v1.0.20
func GetVMSS(tc *AzureTestClient, vmssName string) (*azcompute.VirtualMachineScaleSet, error)
GetVMSS gets VMSS object with vmssName.
func GetVMSSVMComputerName ¶ added in v0.4.0
func GetVMSSVMComputerName(vm *azcompute.VirtualMachineScaleSetVM) (string, error)
GetVMSSVMComputerName returns the corresponding node name of the VMSS VM
func HoldAutoScaleNodes ¶ added in v1.30.0
HoldAutoScaleNodes validate node count to not change for few minutes
func IfIPFamiliesEnabled ¶ added in v1.24.19
func IsAutoscalingAKSCluster ¶ added in v1.25.16
func IsAutoscalingAKSCluster() bool
IsAutoscalingAKSCluster checks if the cluster is an autoscaling AKS one.
func IsControlPlaneNode ¶ added in v0.7.11
IsControlPlaneNode returns true if the node has a control-plane role label. The control-plane role is determined by looking for: * a node-role.kubernetes.io/control-plane or node-role.kubernetes.io/master="" label
func IsInternalEndpoint ¶ added in v1.1.21
func IsNodeInVMSS ¶ added in v0.4.0
func IsNodeInVMSS(tc *AzureTestClient, nodeName, vmssName string) (bool, error)
IsNodeInVMSS defines whether the node is the instance of the VMSS
func IsRetryableAPIError ¶
IsRetryableAPIError will judge whether an error retryable or not
func IsSpotVMSS ¶ added in v0.6.0
func IsSpotVMSS(vmss *azcompute.VirtualMachineScaleSet) bool
IsSpotVMSS checks whether the vmss support azure spot vm instance
func IsSystemPoolNode ¶ added in v1.25.16
IsSystemPoolNode checks if the Node is of system pool when running tests in an AKS autoscaling cluster.
func KubectlCmd ¶ added in v1.0.0
KubectlCmd runs the kubectl executable through the wrapper script.
func KustoIngest ¶ added in v1.23.26
KustoIngest ingests test result to kusto The table is like: | Timestamp | TestScenario | ClusterType | BranchName | Passed | ErrorDetails | | 2023-01-09T01:00:00Z | Feature:Autoscaling || !Serial && !Slow | autoscaling | release-1.26 | true | <failed-tests-detail> |
func ListNICs ¶ added in v0.4.0
func ListNICs(tc *AzureTestClient, rgName string) ([]*network.Interface, error)
ListNICs returns the NIC list in the given resource group
func ListRouteTables ¶ added in v0.4.0
func ListRouteTables(tc *AzureTestClient) ([]*aznetwork.RouteTable, error)
ListRouteTables returns the list of all route tables in the resource group
func ListUniformVMSSes ¶ added in v1.26.0
func ListUniformVMSSes(tc *AzureTestClient) ([]*azcompute.VirtualMachineScaleSet, error)
ListUniformVMSSes returns the list of scale sets
func ListVMSSNICs ¶ added in v0.4.0
func ListVMSSNICs(tc *AzureTestClient, vmssName string) ([]*network.Interface, error)
ListVMSSNICs returns the NIC list in the VMSS
func ListVMSSVMs ¶ added in v0.4.0
func ListVMSSVMs(tc *AzureTestClient, vmssName string) ([]*azcompute.VirtualMachineScaleSetVM, error)
ListVMSSVMs returns the VM list of the given VMSS
func ListVMs ¶ added in v0.4.0
func ListVMs(tc *AzureTestClient) ([]*armcompute.VirtualMachine, error)
ListVMs returns all VMs in the resource group
func LogPodStatus ¶
LogPodStatus logs the rate of pending
func LookForStringInPodExec ¶ added in v1.0.0
func LookForStringInPodExec(ns, podName string, command []string, expectedString string, timeout time.Duration) (result string, err error)
LookForStringInPodExec looks for the given string in the output of a command executed in the first container of specified pod.
func LookForStringInPodExecToContainer ¶ added in v1.0.0
func LookForStringInPodExecToContainer(ns, podName, containerName string, command []string, expectedString string, timeout time.Duration) (result string, err error)
LookForStringInPodExecToContainer looks for the given string in the output of a command executed in specified pod container, or first container if not specified.
func PrintCreateSVCSuccessfully ¶ added in v1.29.0
func RunKubectl ¶ added in v1.0.0
RunKubectl is a convenience wrapper over kubectlBuilder
func RunKubectlNoPrint ¶ added in v1.1.25
RunKubectlNoPrint is a convenience wrapper over kubectlBuilder. It doesn't print output and error.
func RunKubectlOrDie ¶ added in v1.0.0
RunKubectlOrDie is a convenience wrapper over kubectlBuilder
func Scale ¶ added in v1.23.26
func Scale(tc *AzureTestClient, vmssName string, instanceCount int64) error
func ScaleMachinePool ¶ added in v1.0.20
ScaleMachinePool switches to kind-capz context and scales MachinePool replicas to scale up or down VMSS. This functions is for CAPZ clusters. Since CAPZ controller will reconcile MachinePool replicas automatically, add/delete VMSS instance through VMSS API doesn't work.
func ScaleVMSS ¶ added in v0.4.0
func ScaleVMSS(tc *AzureTestClient, vmssName string, instanceCount int64) (err error)
ScaleVMSS scales the given VMSS
func SelectAvailablePrivateIPs ¶ added in v1.24.19
func SelectAvailablePrivateIPs(tc *AzureTestClient) ([]*string, error)
SelectAvailablePrivateIPs selects private IP addresses in Azure subnet.
func StrPtrSliceToStrSlice ¶ added in v1.29.0
func StringInSlice ¶ added in v0.6.0
StringInSlice check if string in a list
func ValidateClusterNodesMatchVMSSInstances ¶ added in v0.7.21
func ValidateServiceConnectivity ¶ added in v1.1.25
func ValidateServiceConnectivity(ns, execPod, serviceIP string, port int, protocol v1.Protocol) error
ValidateServiceConnectivity validates the connectivity of the internal Service IP
func ValidateVMSSNodeLabels ¶ added in v0.4.0
func ValidateVMSSNodeLabels(tc *AzureTestClient, vmss *azcompute.VirtualMachineScaleSet, key string) error
ValidateVMSSNodeLabels gets the label of VMs in VMSS with retry
func WaitAutoScaleNodes ¶
WaitAutoScaleNodes returns nodes count after autoscaling in 60 minutes
func WaitCreatePIP ¶ added in v0.4.0
func WaitCreatePIP(azureTestClient *AzureTestClient, ipName, rgName string, ipParameter *aznetwork.PublicIPAddress) (*aznetwork.PublicIPAddress, error)
WaitCreatePIP waits to create a public ip resource in a specific resource group
func WaitCreatePIPPrefix ¶ added in v1.0.21
func WaitCreatePIPPrefix( cli *AzureTestClient, name, rgName string, parameter aznetwork.PublicIPPrefix, ) (*aznetwork.PublicIPPrefix, error)
func WaitGetAgentNodes ¶ added in v0.7.3
WaitGetAgentNodes gets the list of agent nodes and ensures the providerIDs are good
func WaitGetPIP ¶ added in v0.4.0
func WaitGetPIP(azureTestClient *AzureTestClient, ipName string) (pip *aznetwork.PublicIPAddress, err error)
WaitGetPIP waits to get a specific public ip resource
func WaitGetPIPByPrefix ¶ added in v1.0.21
func WaitGetPIPByPrefix( cli *AzureTestClient, prefixName string, untilPIPCreated bool, ) (*aznetwork.PublicIPAddress, error)
WaitGetPIPByPrefix retrieves the ONLY one PIP that created by specified prefix. If untilPIPCreated is true, it will retry until 1 PIP is associated to the prefix.
func WaitGetPIPPrefix ¶ added in v1.0.21
func WaitGetPIPPrefix( cli *AzureTestClient, name string, ) (*aznetwork.PublicIPPrefix, error)
func WaitPodTo ¶ added in v0.4.0
func WaitPodTo(phase v1.PodPhase, cs clientset.Interface, podTemplate *v1.Pod, nsName string) (result bool, err error)
WaitPodTo returns True if pod is in the specific phase during a short period of time
func WaitPodsToBeReady ¶ added in v0.6.0
func WaitServiceExposure ¶
func WaitServiceExposure(cs clientset.Interface, namespace string, name string, targetIPs []*string) (*v1.Service, error)
WaitServiceExposure waits for the exposure of the external IP of the service
func WaitServiceExposureAndGetIPs ¶ added in v1.24.19
func WaitServiceExposureAndGetIPs(cs clientset.Interface, namespace string, name string) ([]*string, error)
WaitServiceExposureAndGetIPs returns IPs of the Service.
func WaitServiceExposureAndValidateConnectivity ¶ added in v0.7.11
func WaitServiceExposureAndValidateConnectivity(cs clientset.Interface, ipFamily IPFamily, namespace string, name string, targetIPs []*string) ([]*string, error)
WaitServiceExposureAndValidateConnectivity returns IPs of the service and check the connectivity if they are public IPs. Service should have been created before calling this function.
func WaitVMSSVMCountToEqualNodeCount ¶ added in v1.27.0
func WaitVMSSVMCountToEqualNodeCount(tc *AzureTestClient) error
WaitVMSSVMCountToEqualNodeCount waits until the number of VMSS VMs equals the number of Nodes.
Types ¶
type AzureTestClient ¶
type AzureTestClient struct { IPFamily IPFamily HasWindowsNodes bool // contains filtered or unexported fields }
AzureTestClient configs Azure specific clients
func CreateAzureTestClient ¶
func CreateAzureTestClient() (*AzureTestClient, error)
CreateAzureTestClient makes a new AzureTestClient Only consider PublicCloud Environment
func (*AzureTestClient) CreateContainerRegistry ¶ added in v0.4.0
func (tc *AzureTestClient) CreateContainerRegistry() (acr.Registry, error)
CreateContainerRegistry creates a test acr
func (*AzureTestClient) CreateSecurityGroupsClient ¶
func (tc *AzureTestClient) CreateSecurityGroupsClient() securitygroupclient.Interface
CreateSecurityGroupsClient generates security group client with the same baseclient as azure test client
func (*AzureTestClient) CreateSubnet ¶
func (azureTestClient *AzureTestClient) CreateSubnet(vnet *aznetwork.VirtualNetwork, subnetName *string, prefixes []*string, waitUntilComplete bool) (*aznetwork.Subnet, error)
CreateSubnet creates a new subnet in the specified virtual network.
func (*AzureTestClient) DeleteContainerRegistry ¶ added in v0.4.0
func (tc *AzureTestClient) DeleteContainerRegistry(registryName string) (err error)
DeleteContainerRegistry deletes an existing acr
func (*AzureTestClient) DeleteSubnet ¶
func (azureTestClient *AzureTestClient) DeleteSubnet(vnetName string, subnetName string) error
DeleteSubnet deletes a subnet with retry.
func (*AzureTestClient) GetClusterSecurityGroups ¶ added in v0.7.11
func (azureTestClient *AzureTestClient) GetClusterSecurityGroups() (ret []*aznetwork.SecurityGroup, err error)
GetClusterSecurityGroups gets the security groups of the cluster.
func (*AzureTestClient) GetClusterVirtualNetwork ¶
func (azureTestClient *AzureTestClient) GetClusterVirtualNetwork() (virtualNetwork *aznetwork.VirtualNetwork, err error)
GetClusterVirtualNetwork returns the cluster's virtual network.
func (*AzureTestClient) GetLoadBalancer ¶ added in v0.4.0
func (azureTestClient *AzureTestClient) GetLoadBalancer(resourceGroupName, lbName string) (*aznetwork.LoadBalancer, error)
GetLoadBalancer gets aznetwork.LoadBalancer by loadBalancer name.
func (*AzureTestClient) GetLocation ¶ added in v0.4.0
func (tc *AzureTestClient) GetLocation() string
GetLocation get location which is same of cluster name as definite in k8s-azure
func (*AzureTestClient) GetPrivateLinkService ¶ added in v1.0.19
func (azureTestClient *AzureTestClient) GetPrivateLinkService(resourceGroupName, plsName string) (*aznetwork.PrivateLinkService, error)
GetPrivateLinkService gets aznetwork.PrivateLinkService by privateLinkService name.
func (*AzureTestClient) GetPublicIPFromAddress ¶ added in v1.1.25
func (azureTestClient *AzureTestClient) GetPublicIPFromAddress(resourceGroupName string, ipAddr *string) (pip *aznetwork.PublicIPAddress, err error)
GetPublicIPFromAddress finds public ip according to ip address
func (*AzureTestClient) GetResourceGroup ¶ added in v0.4.0
func (tc *AzureTestClient) GetResourceGroup() string
GetResourceGroup get RG name which is same of cluster name as definite in k8s-azure
func (*AzureTestClient) GetSubscriptionID ¶ added in v1.29.0
func (tc *AzureTestClient) GetSubscriptionID() string
GetAuthConfig gets the authorization configuration information
func (*AzureTestClient) ListLoadBalancers ¶ added in v1.0.19
func (azureTestClient *AzureTestClient) ListLoadBalancers(resourceGroupName string) ([]*aznetwork.LoadBalancer, error)
ListLoadBalancers lists all the load balancers active
func (*AzureTestClient) ListPrivateLinkServices ¶ added in v1.0.19
func (azureTestClient *AzureTestClient) ListPrivateLinkServices(resourceGroupName string) ([]*aznetwork.PrivateLinkService, error)
ListPrivateLinkServices lists all the private link services active
func (*AzureTestClient) ListPublicIPs ¶ added in v0.4.0
func (azureTestClient *AzureTestClient) ListPublicIPs(resourceGroupName string) ([]*aznetwork.PublicIPAddress, error)
ListPublicIPs lists all the publicIP addresses active
func (*AzureTestClient) PushImageToACR ¶ added in v1.27.19
func (tc *AzureTestClient) PushImageToACR(registryName, image string) (string, error)
PushImageToACR pull an image from MCR and push it to the given azure container registry
type IPFamily ¶ added in v1.1.25
type IPFamily string
func GetClusterServiceIPFamily ¶ added in v1.1.25
GetClusterServiceIPFamily gets cluster's Service IPFamily according to Service CIDRs.
type KubectlBuilder ¶ added in v1.0.0
type KubectlBuilder struct {
// contains filtered or unexported fields
}
KubectlBuilder is used to build, customize and execute a kubectl Command. Add more functions to customize the builder as needed.
func NewKubectlCommand ¶ added in v1.0.0
func NewKubectlCommand(namespace string, args ...string) *KubectlBuilder
NewKubectlCommand returns a KubectlBuilder for running kubectl.
func (KubectlBuilder) Exec ¶ added in v1.0.0
func (b KubectlBuilder) Exec(print bool) (string, error)
Exec runs the kubectl executable.
func (KubectlBuilder) ExecOrDie ¶ added in v1.0.0
func (b KubectlBuilder) ExecOrDie(namespace string) string
ExecOrDie runs the kubectl executable or dies if error occurs.
func (KubectlBuilder) ExecWithFullOutput ¶ added in v1.0.0
func (b KubectlBuilder) ExecWithFullOutput(print bool) (string, string, error)
ExecWithFullOutput runs the kubectl executable, and returns the stdout and stderr.