Documentation ¶
Index ¶
- Constants
- Variables
- func AddOrUpdateLabelOnNode(c clientset.Interface, nodeName string, labelKey, labelValue string)
- func AddOrUpdateTaintOnNode(c clientset.Interface, nodeName string, taint v1.Taint)
- func AllNodesReady(c clientset.Interface, timeout time.Duration) error
- func ApiCallToPerfData(apicalls APIResponsiveness) *perftype.PerfData
- func AssertCleanup(ns string, selectors ...string)
- func BindClusterRole(c v1beta1rbac.ClusterRoleBindingsGetter, clusterRole, ns string, ...)
- func BindClusterRoleInNamespace(c v1beta1rbac.RoleBindingsGetter, clusterRole, ns string, ...)
- func BlockNetwork(from string, to string)
- func CPUUsageToPerfData(usagePerNode NodesCPUSummary) *perftype.PerfData
- func CPUUsageToPerfDataWithLabels(usagePerNode NodesCPUSummary, labels map[string]string) *perftype.PerfData
- func CheckConnectivityToHost(f *Framework, nodeName, podName, host string, timeout int) error
- func CheckInvariants(events []watch.Event, fns ...InvariantFunc) error
- func CheckNewRSAnnotations(c clientset.Interface, ns, deploymentName string, ...) error
- func CheckNodesReady(c clientset.Interface, nt time.Duration, expect int) ([]string, error)
- func CheckPodHashLabel(pods *v1.PodList) error
- func CheckPodsCondition(c clientset.Interface, ns string, podNames []string, timeout time.Duration, ...) bool
- func CheckPodsRunningReady(c clientset.Interface, ns string, podNames []string, timeout time.Duration) bool
- func CheckPodsRunningReadyOrSucceeded(c clientset.Interface, ns string, podNames []string, timeout time.Duration) bool
- func CheckRSHashLabel(rs *extensions.ReplicaSet) error
- func CheckReachabilityFromPod(expectToBeReachable bool, namespace, pod, target string)
- func CheckTestingNSDeletedExcept(c clientset.Interface, skip string) error
- func Cleanup(filePath, ns string, selectors ...string)
- func CleanupGCEResources(loadBalancerName string) (retErr error)
- func CleanupServiceGCEResources(loadBalancerName string)
- func CollectAddresses(nodes *v1.NodeList, addressType v1.NodeAddressType) []string
- func ConstructFirewallForLBService(svc *v1.Service, nodesTags []string) *compute.Firewall
- func ContainerInitInvariant(older, newer runtime.Object) error
- func CoreDump(dir string)
- func CreateExecPodOrFail(client clientset.Interface, ns, generateName string, tweak func(*v1.Pod)) string
- func CreateGCEStaticIP(name string) (string, error)
- func CreatePodOrFail(c clientset.Interface, ns, name string, labels map[string]string, ...)
- func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error)
- func DeleteGCEStaticIP(name string) error
- func DeleteNamespaces(c clientset.Interface, deleteFilter, skipFilter []string) ([]string, error)
- func DeletePodOrFail(c clientset.Interface, ns, name string)
- func DeleteRCAndPods(clientset clientset.Interface, internalClientset internalclientset.Interface, ...) error
- func DeleteRCAndWaitForGC(c clientset.Interface, ns, name string) error
- func DeleteReplicaSet(clientset clientset.Interface, internalClientset internalclientset.Interface, ...) error
- func DeleteResourceAndPods(clientset clientset.Interface, internalClientset internalclientset.Interface, ...) error
- func DeleteResourceAndWaitForGC(c clientset.Interface, kind schema.GroupKind, ns, name string) error
- func DescribeIng(ns string)
- func DescribeSvc(ns string)
- func DumpAllNamespaceInfo(c clientset.Interface, namespace string)
- func DumpEventsInNamespace(eventsLister EventsLister, namespace string)
- func DumpNodeDebugInfo(c clientset.Interface, nodeNames []string, ...)
- func EnsureLoadBalancerResourcesDeleted(ip, portRange string) error
- func ExpectNoError(err error, explain ...interface{})
- func ExpectNoErrorWithRetries(fn func() error, maxRetries int, explain ...interface{})
- func ExpectNodeHasLabel(c clientset.Interface, nodeName string, labelKey string, labelValue string)
- func ExpectNodeHasTaint(c clientset.Interface, nodeName string, taint v1.Taint)
- func Failf(format string, args ...interface{})
- func FilterNodes(nodeList *v1.NodeList, fn func(node v1.Node) bool)
- func FormatRuntimeOperationErrorRate(nodesResult map[string]NodeRuntimeOperationErrorRate) string
- func GenerateMasterRegexp(prefix string) string
- func GetClusterIpRange() string
- func GetClusterName(instancePrefix string) string
- func GetE2eFirewalls(masterName, masterTag, nodeTag, network string) []*compute.Firewall
- func GetHostExternalAddress(client clientset.Interface, p *v1.Pod) (externalAddress string, err error)
- func GetIngressPoint(ing *v1.LoadBalancerIngress) string
- func GetInstancePrefix(masterName string) (string, error)
- func GetInstanceTags(cloudConfig CloudConfig, instanceName string) *compute.Tags
- func GetKubeletHeapStats(c clientset.Interface, nodeName string) (string, error)
- func GetKubeletPods(c clientset.Interface, node string) (*v1.PodList, error)
- func GetKubeletRunningPods(c clientset.Interface, node string) (*v1.PodList, error)
- func GetKubemarkMasterComponentsResourceUsage() map[string]*KubemarkResourceUsage
- func GetMasterAddress(c clientset.Interface) string
- func GetMasterAndWorkerNodesOrDie(c clientset.Interface) (sets.String, *v1.NodeList)
- func GetMasterHost() string
- func GetNodeAddresses(node *v1.Node, addressType v1.NodeAddressType) (ips []string)
- func GetNodeExternalIP(node *v1.Node) string
- func GetNodePortURL(client clientset.Interface, ns, name string, svcPort int) (string, error)
- func GetNodePublicIps(c clientset.Interface) ([]string, error)
- func GetNodeTags(c clientset.Interface, cloudConfig CloudConfig) *compute.Tags
- func GetPauseImageName(c clientset.Interface) string
- func GetPauseImageNameForHostArch() string
- func GetPodLogs(c clientset.Interface, namespace, podName, containerName string) (string, error)
- func GetPodsInNamespace(c clientset.Interface, ns string, ignoreLabels map[string]string) ([]*v1.Pod, error)
- func GetPodsScheduled(masterNodes sets.String, pods *v1.PodList) (scheduledPods, notScheduledPods []v1.Pod)
- func GetReadySchedulableNodesOrDie(c clientset.Interface) (nodes *v1.NodeList)
- func GetServerArchitecture(c clientset.Interface) string
- func GetServicesProxyRequest(c clientset.Interface, request *restclient.Request) (*restclient.Request, error)
- func GetSigner(provider string) (ssh.Signer, error)
- func GetValidDNSSubdomainName(name string) (string, error)
- func HighLatencyRequests(c clientset.Interface) (int, error)
- func IsGoogleAPIHTTPErrorCode(err error, code int) bool
- func IsNodeConditionSetAsExpected(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool
- func IsNodeConditionSetAsExpectedSilent(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool
- func IsNodeConditionUnset(node *v1.Node, conditionType v1.NodeConditionType) bool
- func IssueSSHCommand(cmd, provider string, node *v1.Node) error
- func KubeDescribe(text string, body func()) bool
- func KubectlCmd(args ...string) *exec.Cmd
- func KubectlVersion() (*utilversion.Version, error)
- func KubectlVersionGTE(v *utilversion.Version) (bool, error)
- func LaunchHostExecPod(client clientset.Interface, ns, name string) *v1.Pod
- func LaunchWebserverPod(f *Framework, podName, nodeName string) (ip string)
- func ListNamespaceEvents(c clientset.Interface, ns string) error
- func LoadClientset() (*clientset.Clientset, error)
- func LoadConfig() (*restclient.Config, error)
- func LoadInternalClientset() (*internalclientset.Clientset, error)
- func LogContainersInPodsWithLabels(c clientset.Interface, ns string, match map[string]string, ...)
- func LogFailedContainers(c clientset.Interface, ns string, ...)
- func LogPodsWithLabels(c clientset.Interface, ns string, match map[string]string, ...)
- func LogSSHResult(result SSHResult)
- func LogSuspiciousLatency(latencyData []PodLatencyData, latencyDataLag []PodLatencyData, nodeCount int, ...)
- func Logf(format string, args ...interface{})
- func LookForString(expectedString string, timeout time.Duration, fn func() string) (result string, err error)
- func LookForStringInFile(ns, podName, container, file, expectedString string, timeout time.Duration) (result string, err error)
- func LookForStringInLog(ns, podName, container, expectedString string, timeout time.Duration) (result string, err error)
- func LookForStringInPodExec(ns, podName string, command []string, expectedString string, ...) (result string, err error)
- func MakeFirewallNameForLBService(name string) string
- func MasterUpgrade(v string) error
- func MigTemplate() (string, error)
- func NewDeployment(deploymentName string, replicas int32, podLabels map[string]string, ...) *extensions.Deployment
- func NewE2ETestNodePreparer(client clientset.Interface, countToStrategy []testutils.CountToStrategy) testutils.TestNodePreparer
- func NewHostExecPodSpec(ns, name string) *v1.Pod
- func NewKubectlCommand(args ...string) *kubectlBuilder
- func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOptions) (*containerResourceGatherer, error)
- func NodeAddresses(nodelist *v1.NodeList, addrType v1.NodeAddressType) []string
- func NodeOSDistroIs(supportedNodeOsDistros ...string) bool
- func NodeProxyRequest(c clientset.Interface, node, endpoint string) (restclient.Result, error)
- func NodeSSHHosts(c clientset.Interface) ([]string, error)
- func NodeUpgrade(f *Framework, v string, img string) error
- func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []string) (*websocket.Conn, error)
- func PackProtocolsPortsFromFirewall(alloweds []*compute.FirewallAllowed) []string
- func ParseKVLines(output, key string) string
- func PickNodeIP(c clientset.Interface) string
- func PodProxyResponseChecker(c clientset.Interface, ns string, label labels.Selector, controllerName string, ...) podProxyResponseChecker
- func PodsCreated(c clientset.Interface, ns, name string, replicas int32) (*v1.PodList, error)
- func PodsCreatedByLabel(c clientset.Interface, ns, name string, replicas int32, label labels.Selector) (*v1.PodList, error)
- func PodsResponding(c clientset.Interface, ns, name string, wantName bool, pods *v1.PodList) error
- func PollURL(route, host string, timeout time.Duration, interval time.Duration, ...) error
- func PrettyPrintJSON(metrics interface{}) string
- func PrintAllKubeletPods(c clientset.Interface, nodeName string)
- func PrintLatencies(latencies []PodLatencyData, header string)
- func PrintPerfData(p *perftype.PerfData)
- func ProviderIs(providers ...string) bool
- func RcByNameContainer(name string, replicas int32, image string, labels map[string]string, ...) *v1.ReplicationController
- func RcByNamePort(name string, replicas int32, image string, port int, protocol v1.Protocol, ...) *v1.ReplicationController
- func RegisterClusterFlags()
- func RegisterCommonFlags()
- func RegisterNodeFlags()
- func RemoveCleanupAction(p CleanupActionHandle)
- func RemoveLabelOffNode(c clientset.Interface, nodeName string, labelKey string)
- func RemoveTaintOffNode(c clientset.Interface, nodeName string, taint v1.Taint)
- func ResetMetrics(c clientset.Interface) error
- func ResourceUsageToPerfData(usagePerNode ResourceUsagePerNode) *perftype.PerfData
- func ResourceUsageToPerfDataWithLabels(usagePerNode ResourceUsagePerNode, labels map[string]string) *perftype.PerfData
- func RestartApiserver(c discovery.ServerVersionInterface) error
- func RestartKubeProxy(host string) error
- func RestclientConfig(kubeContext string) (*clientcmdapi.Config, error)
- func RunCleanupActions()
- func RunCmd(command string, args ...string) (string, string, error)
- func RunCmdEnv(env []string, command string, args ...string) (string, string, error)
- func RunDeployment(config testutils.DeploymentConfig) error
- func RunHostCmd(ns, name, cmd string) (string, error)
- func RunHostCmdOrDie(ns, name, cmd string) string
- func RunKubectl(args ...string) (string, error)
- func RunKubectlOrDie(args ...string) string
- func RunKubectlOrDieInput(data string, args ...string) string
- func RunRC(config testutils.RCConfig) error
- func RunReplicaSet(config testutils.ReplicaSetConfig) error
- func SameStringArray(result, expected []string, include bool) error
- func ScaleDeployment(clientset clientset.Interface, internalClientset internalclientset.Interface, ...) error
- func ScaleRC(clientset clientset.Interface, internalClientset internalclientset.Interface, ...) error
- func ScaleRCByLabels(clientset clientset.Interface, internalClientset internalclientset.Interface, ...) error
- func ScaleResource(clientset clientset.Interface, internalClientset internalclientset.Interface, ...) error
- func ServerVersionGTE(v *utilversion.Version, c discovery.ServerVersionInterface) (bool, error)
- func ServiceResponding(c clientset.Interface, ns, name string) error
- func SetInstanceTags(cloudConfig CloudConfig, instanceName string, tags []string) []string
- func SimpleGET(c *http.Client, url, host string) (string, error)
- func SkipIfContainerRuntimeIs(runtimes ...string)
- func SkipIfMissingResource(clientPool dynamic.ClientPool, gvr schema.GroupVersionResource, ...)
- func SkipIfProviderIs(unsupportedProviders ...string)
- func SkipUnlessAtLeast(value int, minValue int, message string)
- func SkipUnlessKubectlVersionGTE(v *utilversion.Version)
- func SkipUnlessNodeCountIsAtLeast(minNodeCount int)
- func SkipUnlessNodeCountIsAtMost(maxNodeCount int)
- func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string)
- func SkipUnlessProviderIs(supportedProviders ...string)
- func SkipUnlessServerVersionGTE(v *utilversion.Version, c discovery.ServerVersionInterface)
- func Skipf(format string, args ...interface{})
- func StartCmdAndStreamOutput(cmd *exec.Cmd) (stdout, stderr io.ReadCloser, err error)
- func StartServeHostnameService(c clientset.Interface, internalClient internalclientset.Interface, ...) ([]string, string, error)
- func StopServeHostnameService(clientset clientset.Interface, internalClientset internalclientset.Interface, ...) error
- func TargetContainers() []string
- func TestHitNodesFromOutside(externalIP string, httpPort int32, timeout time.Duration, ...) error
- func TestHitNodesFromOutsideWithCount(externalIP string, httpPort int32, timeout time.Duration, ...) error
- func TestNotReachableHTTP(ip string, port int) (bool, error)
- func TestNotReachableHTTPTimeout(ip string, port int, timeout time.Duration) (bool, error)
- func TestNotReachableUDP(ip string, port int, request string) (bool, error)
- func TestReachableHTTP(ip string, port int, request string, expect string) (bool, error)
- func TestReachableHTTPWithContent(ip string, port int, request string, expect string, content *bytes.Buffer) (bool, error)
- func TestReachableHTTPWithContentTimeout(ip string, port int, request string, expect string, content *bytes.Buffer, ...) (bool, error)
- func TestReachableUDP(ip string, port int, request string, expect string) (bool, error)
- func TryKill(cmd *exec.Cmd)
- func UnblockNetwork(from string, to string)
- func UpdateDeploymentWithRetries(c clientset.Interface, namespace, name string, ...) (deployment *extensions.Deployment, err error)
- func UpdateJobWithRetries(c clientset.Interface, namespace, name string, applyUpdate updateJobFunc) (job *batch.Job, err error)
- func UpdatePodWithRetries(client clientset.Interface, ns, name string, update func(*v1.Pod)) (*v1.Pod, error)
- func UpdateReplicaSetWithRetries(c clientset.Interface, namespace, name string, applyUpdate updateRsFunc) (*extensions.ReplicaSet, error)
- func UpdateReplicationControllerWithRetries(c clientset.Interface, namespace, name string, applyUpdate updateRcFunc) (*v1.ReplicationController, error)
- func UpdateService(c clientset.Interface, namespace, serviceName string, update func(*v1.Service)) (*v1.Service, error)
- func UpdateStatefulSetWithRetries(c clientset.Interface, namespace, name string, ...) (statefulSet *apps.StatefulSet, err error)
- func ValidateController(c clientset.Interface, containerImage string, replicas int, ...)
- func ValidateEndpointsOrFail(c clientset.Interface, namespace, serviceName string, ...)
- func VerifyFirewallRule(res, exp *compute.Firewall, network string, portsSubset bool) error
- func VerifyPodStartupLatency(latency PodStartupLatency) error
- func VerifyPods(c clientset.Interface, ns, name string, wantName bool, replicas int32) error
- func VerifyPodsRunning(c clientset.Interface, ns, name string, wantName bool, replicas int32) error
- func VerifySchedulerLatency(c clientset.Interface) error
- func VerifyServeHostnameServiceDown(c clientset.Interface, host string, serviceIP string, servicePort int) error
- func VerifyServeHostnameServiceUp(c clientset.Interface, ns, host string, expectedPods []string, ...) error
- func ViperizeFlags()
- func WaitForAllNodesHealthy(c clientset.Interface, timeout time.Duration) error
- func WaitForAllNodesSchedulable(c clientset.Interface, timeout time.Duration) error
- func WaitForApiserverUp(c clientset.Interface) error
- func WaitForAuthorizationUpdate(c v1beta1authorization.SubjectAccessReviewsGetter, ...) error
- func WaitForClusterSize(c clientset.Interface, size int, timeout time.Duration) error
- func WaitForControlledPodsRunning(c clientset.Interface, ns, name string, kind schema.GroupKind) error
- func WaitForDefaultServiceAccountInNamespace(c clientset.Interface, namespace string) error
- func WaitForDeploymentOldRSsNum(c clientset.Interface, ns, deploymentName string, desiredRSNum int) error
- func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName string, revision, image string) error
- func WaitForDeploymentRollbackCleared(c clientset.Interface, ns, deploymentName string) error
- func WaitForDeploymentStatus(c clientset.Interface, d *extensions.Deployment) error
- func WaitForDeploymentStatusValid(c clientset.Interface, d *extensions.Deployment) error
- func WaitForDeploymentUpdatedReplicasLTE(c clientset.Interface, ns, deploymentName string, minUpdatedReplicas int, ...) error
- func WaitForDeploymentWithCondition(c clientset.Interface, ns, deploymentName, reason string, ...) error
- func WaitForEndpoint(c clientset.Interface, ns, name string) error
- func WaitForEvents(c clientset.Interface, ns string, objOrRef runtime.Object, ...) error
- func WaitForIngressAddress(c clientset.Interface, ns, ingName string, timeout time.Duration) (string, error)
- func WaitForMasters(masterPrefix string, c clientset.Interface, size int, timeout time.Duration) error
- func WaitForMatchPodsCondition(c clientset.Interface, opts metav1.ListOptions, desc string, ...) error
- func WaitForNamespacesDeleted(c clientset.Interface, namespaces []string, timeout time.Duration) error
- func WaitForNodeToBe(c clientset.Interface, name string, conditionType v1.NodeConditionType, ...) bool
- func WaitForNodeToBeNotReady(c clientset.Interface, name string, timeout time.Duration) bool
- func WaitForNodeToBeReady(c clientset.Interface, name string, timeout time.Duration) bool
- func WaitForObservedDeployment(c clientset.Interface, ns, deploymentName string, desiredGeneration int64) error
- func WaitForOverlappingAnnotationMatch(c clientset.Interface, ns, deploymentName, expected string) error
- func WaitForPartialEvents(c clientset.Interface, ns string, objOrRef runtime.Object, ...) error
- func WaitForPersistentVolumeClaimPhase(phase v1.PersistentVolumeClaimPhase, c clientset.Interface, ns string, ...) error
- func WaitForPersistentVolumeDeleted(c clientset.Interface, pvName string, Poll, timeout time.Duration) error
- func WaitForPersistentVolumePhase(phase v1.PersistentVolumePhase, c clientset.Interface, pvName string, ...) error
- func WaitForPodCondition(c clientset.Interface, ns, podName, desc string, timeout time.Duration, ...) error
- func WaitForPodNameRunningInNamespace(c clientset.Interface, podName, namespace string) error
- func WaitForPodNoLongerRunningInNamespace(c clientset.Interface, podName, namespace string) error
- func WaitForPodNotPending(c clientset.Interface, ns, podName string) error
- func WaitForPodRunningInNamespace(c clientset.Interface, pod *v1.Pod) error
- func WaitForPodSuccessInNamespace(c clientset.Interface, podName string, namespace string) error
- func WaitForPodSuccessInNamespaceSlow(c clientset.Interface, podName string, namespace string) error
- func WaitForPodToDisappear(c clientset.Interface, ns, podName string, label labels.Selector, ...) error
- func WaitForPodsReady(c clientset.Interface, ns, name string, minReadySeconds int) error
- func WaitForPodsRunningReady(c clientset.Interface, ns string, minPods int32, timeout time.Duration, ...) error
- func WaitForPodsSuccess(c clientset.Interface, ns string, successPodLabels map[string]string, ...) error
- func WaitForPodsWithLabel(c clientset.Interface, ns string, label labels.Selector) (pods *v1.PodList, err error)
- func WaitForPodsWithLabelRunningReady(c clientset.Interface, ns string, label labels.Selector, num int, ...) (pods *v1.PodList, err error)
- func WaitForPodsWithLabelScheduled(c clientset.Interface, ns string, label labels.Selector) (pods *v1.PodList, err error)
- func WaitForRCPodToDisappear(c clientset.Interface, ns, rcName, podName string) error
- func WaitForRCToStabilize(c clientset.Interface, ns, name string, timeout time.Duration) error
- func WaitForReadyReplicaSet(c clientset.Interface, ns, name string) error
- func WaitForReplicationController(c clientset.Interface, namespace, name string, exist bool, ...) error
- func WaitForService(c clientset.Interface, namespace, name string, exist bool, ...) error
- func WaitForServiceEndpointsNum(c clientset.Interface, namespace, serviceName string, expectNum int, ...) error
- func WaitForStableCluster(c clientset.Interface, masterNodes sets.String) int
- func WaitTimeoutForPodNoLongerRunningInNamespace(c clientset.Interface, podName, namespace string, timeout time.Duration) error
- func WatchRecreateDeployment(c clientset.Interface, d *extensions.Deployment) error
- type APICall
- type APIResponsiveness
- type Address
- type CleanupActionHandle
- type ClientConfigGetter
- type CloudConfig
- type ClusterVerification
- type ContainerFailures
- type ContainerResourceUsage
- type ContainersCPUSummary
- type CreateTestingNSFn
- type E2ETestNodePreparer
- type EventsLister
- type ExecOptions
- type Framework
- func (f *Framework) AfterEach()
- func (f *Framework) BeforeEach()
- func (f *Framework) CheckFileSizeViaContainer(podName, containerName, path string) (string, error)
- func (f *Framework) CreateNamespace(baseName string, labels map[string]string) (*v1.Namespace, error)
- func (f *Framework) CreatePodsPerNodeForSimpleApp(appName string, podSpec func(n v1.Node) v1.PodSpec, maxCount int) map[string]string
- func (f *Framework) CreateServiceForSimpleApp(contPort, svcPort int, appName string) *v1.Service
- func (f *Framework) CreateServiceForSimpleAppWithPods(contPort int, svcPort int, appName string, podSpec func(n v1.Node) v1.PodSpec, ...) (error, *v1.Service)
- func (f *Framework) ExecCommandInContainer(podName, containerName string, cmd ...string) string
- func (f *Framework) ExecCommandInContainerWithFullOutput(podName, containerName string, cmd ...string) (string, string, error)
- func (f *Framework) ExecCommandInPod(podName string, cmd ...string) string
- func (f *Framework) ExecCommandInPodWithFullOutput(podName string, cmd ...string) (string, string, error)
- func (f *Framework) ExecShellInContainer(podName, containerName string, cmd string) string
- func (f *Framework) ExecShellInPod(podName string, cmd string) string
- func (f *Framework) ExecShellInPodWithFullOutput(podName string, cmd string) (string, string, error)
- func (f *Framework) ExecWithOptions(options ExecOptions) (string, string, error)
- func (f *Framework) MatchContainerOutput(pod *v1.Pod, containerName string, expectedOutput []string, ...) error
- func (f *Framework) NewClusterVerification(namespace *v1.Namespace, filter PodStateVerification) *ClusterVerification
- func (f *Framework) PodClient() *PodClient
- func (f *Framework) PodClientNS(namespace string) *PodClient
- func (f *Framework) ReadFileViaContainer(podName, containerName string, path string) (string, error)
- func (f *Framework) TestContainerOutput(scenarioName string, pod *v1.Pod, containerIndex int, expectedOutput []string)
- func (f *Framework) TestContainerOutputRegexp(scenarioName string, pod *v1.Pod, containerIndex int, expectedOutput []string)
- func (f *Framework) WaitForAnEndpoint(serviceName string) error
- func (f *Framework) WaitForPodNoLongerRunning(podName string) error
- func (f *Framework) WaitForPodReady(podName string) error
- func (f *Framework) WaitForPodRunning(podName string) error
- func (f *Framework) WaitForPodRunningSlow(podName string) error
- func (f *Framework) WaitForPodTerminated(podName, reason string) error
- func (f *Framework) WriteFileViaContainer(podName, containerName string, path string, contents string) error
- type FrameworkOptions
- type InvariantFunc
- type KubeCluster
- type KubeConfig
- type KubeUser
- type KubeletLatencyMetric
- type KubeletLatencyMetrics
- type KubemarkResourceUsage
- type LatencyMetric
- type LatencySlice
- type LogSizeDataTimeseries
- type LogSizeGatherer
- type LogsSizeData
- type LogsSizeDataSummary
- type LogsSizeVerifier
- type MetricsForE2E
- type NetworkingTestConfig
- func (config *NetworkingTestConfig) DeleteNetProxyPod()
- func (config *NetworkingTestConfig) DeleteNodePortService()
- func (config *NetworkingTestConfig) DialFromContainer(protocol, containerIP, targetIP string, ...)
- func (config *NetworkingTestConfig) DialFromEndpointContainer(protocol, targetIP string, targetPort, maxTries, minTries int, ...)
- func (config *NetworkingTestConfig) DialFromNode(protocol, targetIP string, targetPort, maxTries, minTries int, ...)
- func (config *NetworkingTestConfig) DialFromTestContainer(protocol, targetIP string, targetPort, maxTries, minTries int, ...)
- func (config *NetworkingTestConfig) EndpointHostnames() sets.String
- func (config *NetworkingTestConfig) GetSelfURL(path string, expected string)
- type NodeRuntimeOperationErrorRate
- type NodeTestContextType
- type NodesCPUSummary
- type PodClient
- func (c *PodClient) Create(pod *v1.Pod) *v1.Pod
- func (c *PodClient) CreateBatch(pods []*v1.Pod) []*v1.Pod
- func (c *PodClient) CreateSync(pod *v1.Pod) *v1.Pod
- func (c *PodClient) DeleteSync(name string, options *metav1.DeleteOptions, timeout time.Duration)
- func (c *PodClient) MatchContainerOutput(name string, containerName string, expectedRegexp string) error
- func (c *PodClient) Update(name string, updateFn func(pod *v1.Pod))
- func (c *PodClient) WaitForSuccess(name string, timeout time.Duration)
- type PodLatencyData
- type PodStartupLatency
- type PodStateVerification
- type PortsByPodName
- type PortsByPodUID
- type ResourceConstraint
- type ResourceGathererOptions
- type ResourceMonitor
- func (r *ResourceMonitor) FormatCPUSummary(summary NodesCPUSummary) string
- func (r *ResourceMonitor) FormatResourceUsage(s ResourceUsagePerNode) string
- func (r *ResourceMonitor) GetCPUSummary() NodesCPUSummary
- func (r *ResourceMonitor) GetLatest() (ResourceUsagePerNode, error)
- func (r *ResourceMonitor) GetMasterNodeCPUSummary(summaryPerNode NodesCPUSummary) NodesCPUSummary
- func (r *ResourceMonitor) GetMasterNodeLatest(usagePerNode ResourceUsagePerNode) ResourceUsagePerNode
- func (r *ResourceMonitor) LogCPUSummary()
- func (r *ResourceMonitor) LogLatest()
- func (r *ResourceMonitor) Reset()
- func (r *ResourceMonitor) Start()
- func (r *ResourceMonitor) Stop()
- type ResourceUsagePerContainer
- type ResourceUsagePerNode
- type ResourceUsageSummary
- type RuntimeOperationErrorRate
- type RuntimeOperationMonitor
- type SSHResult
- type SaturationTime
- type SchedulingLatency
- type ServiceTestFixture
- func (t *ServiceTestFixture) BuildServiceSpec() *v1.Service
- func (t *ServiceTestFixture) Cleanup() []error
- func (t *ServiceTestFixture) CreateRC(rc *v1.ReplicationController) (*v1.ReplicationController, error)
- func (t *ServiceTestFixture) CreateService(service *v1.Service) (*v1.Service, error)
- func (t *ServiceTestFixture) CreateWebserverRC(replicas int32) *v1.ReplicationController
- func (t *ServiceTestFixture) DeleteService(serviceName string) error
- type ServiceTestJig
- func (j *ServiceTestJig) ChangeServiceNodePortOrFail(namespace, name string, initial int) *v1.Service
- func (j *ServiceTestJig) ChangeServiceType(namespace, name string, newType v1.ServiceType, timeout time.Duration)
- func (j *ServiceTestJig) CreateOnlyLocalLoadBalancerService(namespace, serviceName string, timeout time.Duration, createPod bool, ...) *v1.Service
- func (j *ServiceTestJig) CreateOnlyLocalNodePortService(namespace, serviceName string, createPod bool) *v1.Service
- func (j *ServiceTestJig) CreateTCPServiceOrFail(namespace string, tweak func(svc *v1.Service)) *v1.Service
- func (j *ServiceTestJig) CreateTCPServiceWithPort(namespace string, tweak func(svc *v1.Service), port int32) *v1.Service
- func (j *ServiceTestJig) CreateUDPServiceOrFail(namespace string, tweak func(svc *v1.Service)) *v1.Service
- func (j *ServiceTestJig) GetEndpointNodes(svc *v1.Service) map[string][]string
- func (j *ServiceTestJig) GetHTTPContent(host string, port int, timeout time.Duration, url string) bytes.Buffer
- func (j *ServiceTestJig) GetNodes(maxNodesForTest int) (nodes *v1.NodeList)
- func (j *ServiceTestJig) GetNodesNames(maxNodesForTest int) []string
- func (j *ServiceTestJig) LaunchEchoserverPodOnNode(f *Framework, nodeName, podName string)
- func (j *ServiceTestJig) LaunchNetexecPodOnNode(f *Framework, nodeName, podName string, httpPort, udpPort int32, ...)
- func (j *ServiceTestJig) RunOrFail(namespace string, tweak func(rc *v1.ReplicationController)) *v1.ReplicationController
- func (j *ServiceTestJig) SanityCheckService(svc *v1.Service, svcType v1.ServiceType)
- func (j *ServiceTestJig) TestHTTPHealthCheckNodePort(host string, port int, request string, tries int) (pass, fail int, statusMsg string)
- func (j *ServiceTestJig) TestNotReachableHTTP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestNotReachableUDP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestReachableHTTP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) UpdateService(namespace, name string, update func(*v1.Service)) (*v1.Service, error)
- func (j *ServiceTestJig) UpdateServiceOrFail(namespace, name string, update func(*v1.Service)) *v1.Service
- func (j *ServiceTestJig) WaitForEndpointOnNode(namespace, serviceName, nodeName string)
- func (j *ServiceTestJig) WaitForLoadBalancerDestroyOrFail(namespace, name string, ip string, port int, timeout time.Duration) *v1.Service
- func (j *ServiceTestJig) WaitForLoadBalancerOrFail(namespace, name string, timeout time.Duration) *v1.Service
- type SingleContainerSummary
- type SingleLogSummary
- type TestContextType
- type TestDataSummary
- type TimestampedSize
- type WorkItem
Constants ¶
const ( FirewallTimeoutDefault = 3 * time.Minute FirewallTestTcpTimeout = time.Duration(1 * time.Second) // Set ports outside of 30000-32767, 80 and 8080 to avoid being whitelisted by the e2e cluster FirewallTestHttpPort = int32(29999) FirewallTestUdpPort = int32(29998) )
const ( EndpointHttpPort = 8080 EndpointUdpPort = 8081 TestContainerHttpPort = 8080 ClusterHttpPort = 80 ClusterUdpPort = 90 NetexecImageName = "gcr.io/google_containers/netexec:1.7" HostexecImageName = "gcr.io/google_containers/hostexec:1.2" )
const ( // KubeProxyLagTimeout is the maximum time a kube-proxy daemon on a node is allowed // to not notice a Service update, such as type=NodePort. // TODO: This timeout should be O(10s), observed values are O(1m), 5m is very // liberal. Fix tracked in #20567. KubeProxyLagTimeout = 5 * time.Minute // LoadBalancerLagTimeoutDefault is the maximum time a load balancer is allowed to // not respond after creation. LoadBalancerLagTimeoutDefault = 2 * time.Minute // LoadBalancerLagTimeoutAWS is the delay between ELB creation and serving traffic // on AWS. A few minutes is typical, so use 10m. LoadBalancerLagTimeoutAWS = 10 * time.Minute // How long to wait for a load balancer to be created/modified. //TODO: once support ticket 21807001 is resolved, reduce this timeout back to something reasonable LoadBalancerCreateTimeoutDefault = 20 * time.Minute LoadBalancerCreateTimeoutLarge = 2 * time.Hour // Time required by the loadbalancer to cleanup, proportional to numApps/Ing. // Bring the cleanup timeout back down to 5m once b/33588344 is resolved. LoadBalancerCleanupTimeout = 15 * time.Minute // On average it takes ~6 minutes for a single backend to come online in GCE. LoadBalancerPollTimeout = 15 * time.Minute LoadBalancerPollInterval = 30 * time.Second LargeClusterMinNodesNumber = 100 // Don't test with more than 3 nodes. // Many tests create an endpoint per node, in large clusters, this is // resource and time intensive. MaxNodesForEndpointsTests = 3 // ServiceTestTimeout is used for most polling/waiting activities ServiceTestTimeout = 60 * time.Second )
const ( // How long to wait for the pod to be listable PodListTimeout = time.Minute // Initial pod start can be delayed O(minutes) by slow docker pulls // TODO: Make this 30 seconds once #4566 is resolved. PodStartTimeout = 5 * time.Minute // If there are any orphaned namespaces to clean up, this test is running // on a long lived cluster. A long wait here is preferably to spurious test // failures caused by leaked resources from a previous test run. NamespaceCleanupTimeout = 15 * time.Minute // How long to wait for a service endpoint to be resolvable. ServiceStartTimeout = 1 * time.Minute // How often to Poll pods, nodes and claims. Poll = 2 * time.Second // service accounts are provisioned after namespace creation // a service account is required to support pod creation in a namespace as part of admission control ServiceAccountProvisionTimeout = 2 * time.Minute // How long to try single API calls (like 'get' or 'list'). Used to prevent // transient failures from failing tests. // TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed. SingleCallTimeout = 5 * time.Minute // How long nodes have to be "ready" when a test begins. They should already // be "ready" before the test starts, so this is small. NodeReadyInitialTimeout = 20 * time.Second // How long pods have to be "ready" when a test begins. PodReadyBeforeTimeout = 5 * time.Minute ServiceRespondingTimeout = 2 * time.Minute EndpointRegisterTimeout = time.Minute // How long claims have to become dynamically provisioned ClaimProvisionTimeout = 5 * time.Minute // How long each node is given during a process that restarts all nodes // before the test is considered failed. (Note that the total time to // restart all nodes will be this number times the number of nodes.) RestartPerNodeTimeout = 5 * time.Minute // How often to Poll the statues of a restart. RestartPoll = 20 * time.Second // How long a node is allowed to become "Ready" after it is restarted before // the test is considered failed. RestartNodeReadyAgainTimeout = 5 * time.Minute // How long a pod is allowed to become "running" and "ready" after a node // restart before test is considered failed. RestartPodReadyAgainTimeout = 5 * time.Minute // Number of times we want to retry Updates in case of conflict UpdateRetries = 5 )
const ( // NodeStartupThreshold is a rough estimate of the time allocated for a pod to start on a node. NodeStartupThreshold = 4 * time.Second )
Variables ¶
var ( // Label allocated to the image puller static pod that runs on each node // before e2es. ImagePullerLabels = map[string]string{"name": "e2e-image-puller"} )
var ImageWhiteList sets.String
ImageWhiteList is the images used in the current test suite. It should be initialized in test suite and the images in the white list should be pre-pulled in the test suite. Currently, this is only used by node e2e test.
var InterestingApiServerMetrics = []string{
"apiserver_request_count",
"apiserver_request_latencies_summary",
"etcd_helper_cache_entry_count",
"etcd_helper_cache_hit_count",
"etcd_helper_cache_miss_count",
"etcd_request_cache_add_latencies_summary",
"etcd_request_cache_get_latencies_summary",
"etcd_request_latencies_summary",
}
var InterestingControllerManagerMetrics = []string{
"garbage_collector_event_processing_latency_microseconds",
"garbage_collector_dirty_processing_latency_microseconds",
"garbage_collector_orphan_processing_latency_microseconds",
}
var InterestingKubeletMetrics = []string{
"kubelet_container_manager_latency_microseconds",
"kubelet_docker_errors",
"kubelet_docker_operations_latency_microseconds",
"kubelet_generate_pod_status_latency_microseconds",
"kubelet_pod_start_latency_microseconds",
"kubelet_pod_worker_latency_microseconds",
"kubelet_pod_worker_start_latency_microseconds",
"kubelet_sync_pods_latency_microseconds",
}
var ProvidersWithSSH = []string{"gce", "gke", "aws", "local"}
ProvidersWithSSH are those providers where each node is accessible with SSH
var RunId = uuid.NewUUID()
unique identifier of the e2e run
var ServiceNodePortRange = utilnet.PortRange{Base: 30000, Size: 2768}
This should match whatever the default/configured range is
var SubResourcePodProxyVersion = utilversion.MustParseSemantic("v1.1.0")
SubResource proxy should have been functional in v1.0.0, but SubResource proxy via tunneling is known to be broken in v1.0. See https://github.com/kubernetes/kubernetes/pull/15224#issuecomment-146769463
TODO(ihmccreery): remove once we don't care about v1.0 anymore, (tentatively in v1.3).
Functions ¶
func AddOrUpdateLabelOnNode ¶ added in v1.4.0
func AddOrUpdateTaintOnNode ¶ added in v1.4.0
func AllNodesReady ¶
Checks whether all registered nodes are ready. TODO: we should change the AllNodesReady call in AfterEach to WaitForAllNodesHealthy, and figure out how to do it in a configurable way, as we can't expect all setups to run default test add-ons.
func ApiCallToPerfData ¶
func ApiCallToPerfData(apicalls APIResponsiveness) *perftype.PerfData
ApiCallToPerfData transforms APIResponsiveness to PerfData.
func AssertCleanup ¶
Asserts that cleanup of a namespace wrt selectors occurred.
func BindClusterRole ¶ added in v1.6.0
func BindClusterRole(c v1beta1rbac.ClusterRoleBindingsGetter, clusterRole, ns string, subjects ...rbacv1beta1.Subject)
BindClusterRole binds the cluster role at the cluster scope
func BindClusterRoleInNamespace ¶ added in v1.6.0
func BindClusterRoleInNamespace(c v1beta1rbac.RoleBindingsGetter, clusterRole, ns string, subjects ...rbacv1beta1.Subject)
BindClusterRoleInNamespace binds the cluster role at the namespace scope
func BlockNetwork ¶
The following helper functions can block/unblock network from source host to destination host by manipulating iptable rules. This function assumes it can ssh to the source host.
Caution: Recommend to input IP instead of hostnames. Using hostnames will cause iptables to do a DNS lookup to resolve the name to an IP address, which will slow down the test and cause it to fail if DNS is absent or broken.
Suggested usage pattern:
func foo() { ... defer UnblockNetwork(from, to) BlockNetwork(from, to) ... }
func CPUUsageToPerfData ¶
func CPUUsageToPerfData(usagePerNode NodesCPUSummary) *perftype.PerfData
CPUUsageToPerfData transforms NodesCPUSummary to PerfData.
func CPUUsageToPerfDataWithLabels ¶ added in v1.4.0
func CPUUsageToPerfDataWithLabels(usagePerNode NodesCPUSummary, labels map[string]string) *perftype.PerfData
CPUUsageToPerfDataWithLabels transforms NodesCPUSummary to PerfData with additional labels.
func CheckConnectivityToHost ¶
CheckConnectivityToHost launches a pod running wget on the specified node to test connectivity to the specified host. An error will be returned if the host is not reachable from the pod.
func CheckInvariants ¶
func CheckInvariants(events []watch.Event, fns ...InvariantFunc) error
func CheckNewRSAnnotations ¶
func CheckNewRSAnnotations(c clientset.Interface, ns, deploymentName string, expectedAnnotations map[string]string) error
CheckNewRSAnnotations check if the new RS's annotation is as expected
func CheckNodesReady ¶
CheckNodesReady waits up to nt for expect nodes accessed by c to be ready, returning an error if this doesn't happen in time. It returns the names of nodes it finds.
func CheckPodHashLabel ¶
func CheckPodsCondition ¶
func CheckPodsCondition(c clientset.Interface, ns string, podNames []string, timeout time.Duration, condition podCondition, desc string) bool
CheckPodsCondition returns whether all pods whose names are listed in podNames in namespace ns are in the condition, using c and waiting at most timeout.
func CheckPodsRunningReady ¶
func CheckPodsRunningReady(c clientset.Interface, ns string, podNames []string, timeout time.Duration) bool
CheckPodsRunningReady returns whether all pods whose names are listed in podNames in namespace ns are running and ready, using c and waiting at most timeout.
func CheckPodsRunningReadyOrSucceeded ¶
func CheckPodsRunningReadyOrSucceeded(c clientset.Interface, ns string, podNames []string, timeout time.Duration) bool
CheckPodsRunningReadyOrSucceeded returns whether all pods whose names are listed in podNames in namespace ns are running and ready, or succeeded; use c and waiting at most timeout.
func CheckRSHashLabel ¶
func CheckRSHashLabel(rs *extensions.ReplicaSet) error
func CheckReachabilityFromPod ¶ added in v1.6.0
func CheckTestingNSDeletedExcept ¶
CheckTestingNSDeletedExcept checks whether all e2e based existing namespaces are in the Terminating state and waits until they are finally deleted. It ignores namespace skip.
func Cleanup ¶
Stops everything from filePath from namespace ns and checks if everything matching selectors from the given namespace is correctly stopped.
func CleanupGCEResources ¶ added in v1.5.0
CleanupGCEResources cleans up GCE Service Type=LoadBalancer resources with the given name. The name is usually the UUID of the Service prefixed with an alpha-numeric character ('a') to work around cloudprovider rules.
func CleanupServiceGCEResources ¶ added in v1.6.0
func CleanupServiceGCEResources(loadBalancerName string)
func CollectAddresses ¶ added in v1.6.0
func CollectAddresses(nodes *v1.NodeList, addressType v1.NodeAddressType) []string
func ConstructFirewallForLBService ¶ added in v1.6.0
ConstructFirewallForLBService returns the expected GCE firewall rule for a loadbalancer type service
func ContainerInitInvariant ¶
func CoreDump ¶
func CoreDump(dir string)
CoreDump SSHs to the master and all nodes and dumps their logs into dir. It shells out to cluster/log-dump.sh to accomplish this.
func CreateExecPodOrFail ¶ added in v1.6.0
func CreateExecPodOrFail(client clientset.Interface, ns, generateName string, tweak func(*v1.Pod)) string
CreateExecPodOrFail creates a simple busybox pod in a sleep loop used as a vessel for kubectl exec commands. Returns the name of the created pod.
func CreateGCEStaticIP ¶ added in v1.6.0
func CreatePodOrFail ¶ added in v1.6.0
func CreateTestingNS ¶
func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error)
CreateTestingNS should be used by every test, note that we append a common prefix to the provided test name. Please see NewFramework instead of using this directly.
func DeleteGCEStaticIP ¶ added in v1.6.0
func DeleteNamespaces ¶
DeleteNamespaces deletes all namespaces that match the given delete and skip filters. Filter is by simple strings.Contains; first skip filter, then delete filter. Returns the list of deleted namespaces or an error.
func DeletePodOrFail ¶ added in v1.6.0
func DeleteRCAndPods ¶ added in v1.4.0
func DeleteRCAndWaitForGC ¶ added in v1.4.0
DeleteRCAndWaitForGC deletes only the Replication Controller and waits for GC to delete the pods.
func DeleteReplicaSet ¶
func DeleteReplicaSet(clientset clientset.Interface, internalClientset internalclientset.Interface, ns, name string) error
Delete a ReplicaSet and all pods it spawned
func DeleteResourceAndPods ¶ added in v1.6.0
func DeleteResourceAndPods(clientset clientset.Interface, internalClientset internalclientset.Interface, kind schema.GroupKind, ns, name string) error
DeleteResourceAndPods deletes a given resource and all pods it spawned
func DeleteResourceAndWaitForGC ¶ added in v1.6.0
func DeleteResourceAndWaitForGC(c clientset.Interface, kind schema.GroupKind, ns, name string) error
DeleteResourceAndWaitForGC deletes only given resource and waits for GC to delete the pods.
func DescribeIng ¶ added in v1.6.0
func DescribeIng(ns string)
func DescribeSvc ¶ added in v1.6.0
func DescribeSvc(ns string)
func DumpAllNamespaceInfo ¶
func DumpEventsInNamespace ¶ added in v1.5.0
func DumpEventsInNamespace(eventsLister EventsLister, namespace string)
func DumpNodeDebugInfo ¶
func EnsureLoadBalancerResourcesDeleted ¶
EnsureLoadBalancerResourcesDeleted ensures that cloud load balancer resources that were created are actually cleaned up. Currently only implemented for GCE/GKE.
func ExpectNoError ¶
func ExpectNoError(err error, explain ...interface{})
func ExpectNoErrorWithRetries ¶ added in v1.4.0
func ExpectNodeHasLabel ¶ added in v1.4.0
func ExpectNodeHasTaint ¶ added in v1.4.0
func FilterNodes ¶
Filters nodes in NodeList in place, removing nodes that do not satisfy the given condition TODO: consider merging with pkg/client/cache.NodeLister
func FormatRuntimeOperationErrorRate ¶
func FormatRuntimeOperationErrorRate(nodesResult map[string]NodeRuntimeOperationErrorRate) string
FormatRuntimeOperationErrorRate formats the runtime operation error rate to string.
func GenerateMasterRegexp ¶ added in v1.5.0
func GetClusterIpRange ¶ added in v1.6.0
func GetClusterIpRange() string
GetClusterIpRange returns the CLUSTER_IP_RANGE env we set for e2e cluster. From cluster/gce/config-test.sh, cluster ip range is set up using below command: CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.180.0.0/14}" Warning: this need to be consistent with the CLUSTER_IP_RANGE in startup scripts, which is hardcoded currently.
func GetClusterName ¶ added in v1.6.0
GetClusterName returns the CLUSTER_NAME env we set for e2e cluster. From cluster/gce/config-test.sh, cluster name is set up using below format: CLUSTER_NAME="${CLUSTER_NAME:-${INSTANCE_PREFIX}}"
func GetE2eFirewalls ¶ added in v1.6.0
GetE2eFirewalls returns all firewall rules we create for an e2e cluster. From cluster/gce/util.sh, all firewall rules should be consistent with the ones created by startup scripts.
func GetHostExternalAddress ¶
func GetHostExternalAddress(client clientset.Interface, p *v1.Pod) (externalAddress string, err error)
GetHostExternalAddress gets the node for a pod and returns the first External address. Returns an error if the node the pod is on doesn't have an External address.
func GetIngressPoint ¶ added in v1.6.0
func GetIngressPoint(ing *v1.LoadBalancerIngress) string
func GetInstancePrefix ¶ added in v1.6.0
GetInstancePrefix returns the INSTANCE_PREFIX env we set for e2e cluster. From cluster/gce/config-test.sh, master name is set up using below format: MASTER_NAME="${INSTANCE_PREFIX}-master"
func GetInstanceTags ¶ added in v1.6.0
func GetInstanceTags(cloudConfig CloudConfig, instanceName string) *compute.Tags
GetInstanceTags gets tags from GCE instance with given name.
func GetKubeletHeapStats ¶
func GetKubeletPods ¶
GetKubeletPods retrieves the list of pods on the kubelet
func GetKubeletRunningPods ¶
GetKubeletRunningPods retrieves the list of running pods on the kubelet. The pods includes necessary information (e.g., UID, name, namespace for pods/containers), but do not contain the full spec.
func GetKubemarkMasterComponentsResourceUsage ¶ added in v1.6.0
func GetKubemarkMasterComponentsResourceUsage() map[string]*KubemarkResourceUsage
TODO: figure out how to move this to kubemark directory (need to factor test SSH out of e2e framework)
func GetMasterAddress ¶ added in v1.5.0
GetMasterAddress returns the hostname/external IP/internal IP as appropriate for e2e tests on a particular provider which is the address of the interface used for communication with the kubelet.
func GetMasterAndWorkerNodesOrDie ¶ added in v1.4.0
GetMasterAndWorkerNodesOrDie will return a list masters and schedulable worker nodes
func GetMasterHost ¶
func GetMasterHost() string
func GetNodeAddresses ¶ added in v1.6.0
func GetNodeAddresses(node *v1.Node, addressType v1.NodeAddressType) (ips []string)
func GetNodeExternalIP ¶ added in v1.5.0
GetNodeExternalIP returns node external IP concatenated with port 22 for ssh e.g. 1.2.3.4:22
func GetNodePortURL ¶
GetNodePortURL returns the url to a nodeport Service.
func GetNodePublicIps ¶ added in v1.6.0
func GetNodeTags ¶ added in v1.6.0
func GetNodeTags(c clientset.Interface, cloudConfig CloudConfig) *compute.Tags
GetNodeTags gets tags from one of the Kubernetes nodes
func GetPauseImageName ¶
GetPauseImageName fetches the pause image name for the same architecture as the apiserver.
func GetPauseImageNameForHostArch ¶
func GetPauseImageNameForHostArch() string
GetPauseImageNameForHostArch fetches the pause image name for the same architecture the test is running on. TODO: move this function to the test/utils
func GetPodLogs ¶
TODO(random-liu): Change this to be a member function of the framework.
func GetPodsInNamespace ¶
func GetPodsScheduled ¶ added in v1.4.0
func GetPodsScheduled(masterNodes sets.String, pods *v1.PodList) (scheduledPods, notScheduledPods []v1.Pod)
GetPodsScheduled returns a number of currently scheduled and not scheduled Pods.
func GetReadySchedulableNodesOrDie ¶
GetReadySchedulableNodesOrDie addresses the common use case of getting nodes you can do work on. 1) Needs to be schedulable. 2) Needs to be ready. If EITHER 1 or 2 is not true, most tests will want to ignore the node entirely.
func GetServerArchitecture ¶
GetServerArchitecture fetches the architecture of the cluster's apiserver.
func GetServicesProxyRequest ¶
func GetServicesProxyRequest(c clientset.Interface, request *restclient.Request) (*restclient.Request, error)
func GetSigner ¶
GetSigner returns an ssh.Signer for the provider ("gce", etc.) that can be used to SSH to their nodes.
func GetValidDNSSubdomainName ¶
GetValidDNSSubdomainName massages the given name to be a valid dns subdomain name. Most resources (such as secrets, clusters) require the names to be valid dns subdomain. This is a generic function (not specific to federation). Should be moved to a more generic location if others want to use it.
func HighLatencyRequests ¶
Prints top five summary metrics for request types with latency and returns number of such request types above threshold.
func IsGoogleAPIHTTPErrorCode ¶ added in v1.6.0
IsHTTPErrorCode returns true if the error is a google api error matching the corresponding HTTP error code.
func IsNodeConditionUnset ¶
func IsNodeConditionUnset(node *v1.Node, conditionType v1.NodeConditionType) bool
func KubeDescribe ¶
Wrapper function for ginkgo describe. Adds namespacing. TODO: Support type safe tagging as well https://github.com/kubernetes/kubernetes/pull/22401.
func KubectlCmd ¶
KubectlCmd runs the kubectl executable through the wrapper script.
func KubectlVersion ¶
func KubectlVersion() (*utilversion.Version, error)
KubectlVersion gets the version of kubectl that's currently being used (see --kubectl-path in e2e.go to use an alternate kubectl).
func KubectlVersionGTE ¶
func KubectlVersionGTE(v *utilversion.Version) (bool, error)
KubectlVersionGTE returns true if the kubectl version is greater than or equal to v.
func LaunchHostExecPod ¶
LaunchHostExecPod launches a hostexec pod in the given namespace and waits until it's Running
func LaunchWebserverPod ¶
LaunchWebserverPod launches a pod serving http on port 8080 to act as the target for networking connectivity checks. The ip address of the created pod will be returned if the pod is launched successfully.
func ListNamespaceEvents ¶ added in v1.4.0
func LoadClientset ¶ added in v1.5.0
func LoadConfig ¶
func LoadConfig() (*restclient.Config, error)
func LoadInternalClientset ¶ added in v1.5.0
func LoadInternalClientset() (*internalclientset.Clientset, error)
func LogFailedContainers ¶
func LogPodsWithLabels ¶
func LogSSHResult ¶
func LogSSHResult(result SSHResult)
func LogSuspiciousLatency ¶
func LogSuspiciousLatency(latencyData []PodLatencyData, latencyDataLag []PodLatencyData, nodeCount int, c clientset.Interface)
LogSuspiciousLatency logs metrics/docker errors from all nodes that had slow startup times If latencyDataLag is nil then it will be populated from latencyData
func LookForString ¶
func LookForString(expectedString string, timeout time.Duration, fn func() string) (result string, err error)
Looks for the given string in the output of fn, repeatedly calling fn until the timeout is reached or the string is found. Returns last log and possibly error if the string was not found.
func LookForStringInFile ¶
func LookForStringInFile(ns, podName, container, file, expectedString string, timeout time.Duration) (result string, err error)
Looks for the given string in a file in a specific pod container
func LookForStringInLog ¶
func LookForStringInLog(ns, podName, container, expectedString string, timeout time.Duration) (result string, err error)
Looks for the given string in the log of a specific pod container
func LookForStringInPodExec ¶
func LookForStringInPodExec(ns, podName string, command []string, expectedString string, timeout time.Duration) (result string, err error)
Looks for the given string in the output of a command executed in a specific pod container
func MakeFirewallNameForLBService ¶ added in v1.6.0
MakeFirewallNameForLBService return the expected firewall name for a LB service. This should match the formatting of makeFirewallName() in pkg/cloudprovider/providers/gce/gce.go
func MasterUpgrade ¶
func MigTemplate ¶
MigTemplate (GCE-only) returns the name of the MIG template that the nodes of the cluster use.
func NewDeployment ¶ added in v1.6.0
func NewDeployment(deploymentName string, replicas int32, podLabels map[string]string, imageName, image string, strategyType extensions.DeploymentStrategyType) *extensions.Deployment
func NewE2ETestNodePreparer ¶ added in v1.5.0
func NewE2ETestNodePreparer(client clientset.Interface, countToStrategy []testutils.CountToStrategy) testutils.TestNodePreparer
func NewHostExecPodSpec ¶
NewHostExecPodSpec returns the pod spec of hostexec pod
func NewKubectlCommand ¶
func NewKubectlCommand(args ...string) *kubectlBuilder
func NewResourceUsageGatherer ¶
func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOptions) (*containerResourceGatherer, error)
func NodeAddresses ¶
func NodeAddresses(nodelist *v1.NodeList, addrType v1.NodeAddressType) []string
NodeAddresses returns the first address of the given type of each node.
func NodeOSDistroIs ¶ added in v1.6.0
func NodeProxyRequest ¶
NodeProxyRequest performs a get on a node proxy endpoint given the nodename and rest client.
func NodeSSHHosts ¶
NodeSSHHosts returns SSH-able host names for all schedulable nodes - this excludes master node. It returns an error if it can't find an external IP for every node, though it still returns all hosts that it found in that case.
func OpenWebSocketForURL ¶
func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []string) (*websocket.Conn, error)
OpenWebSocketForURL constructs a websocket connection to the provided URL, using the client config, with the specified protocols.
func PackProtocolsPortsFromFirewall ¶ added in v1.6.0
func PackProtocolsPortsFromFirewall(alloweds []*compute.FirewallAllowed) []string
PackProtocolsPortsFromFirewall packs protocols and ports in an unified way for verification.
func ParseKVLines ¶
ParseKVLines parses output that looks like lines containing "<key>: <val>" and returns <val> if <key> is found. Otherwise, it returns the empty string.
func PickNodeIP ¶ added in v1.6.0
func PodProxyResponseChecker ¶
func PodsCreated ¶
func PodsCreatedByLabel ¶ added in v1.5.0
func PodsResponding ¶
func PollURL ¶ added in v1.6.0
func PollURL(route, host string, timeout time.Duration, interval time.Duration, httpClient *http.Client, expectUnreachable bool) error
PollURL polls till the url responds with a healthy http code. If expectUnreachable is true, it breaks on first non-healthy http code instead.
func PrettyPrintJSON ¶
func PrettyPrintJSON(metrics interface{}) string
func PrintAllKubeletPods ¶
func PrintLatencies ¶
func PrintLatencies(latencies []PodLatencyData, header string)
func PrintPerfData ¶
PrintPerfData prints the perfdata in json format with PerfResultTag prefix. If an error occurs, nothing will be printed.
func ProviderIs ¶
func RcByNameContainer ¶ added in v1.6.0
func RcByNameContainer(name string, replicas int32, image string, labels map[string]string, c v1.Container, gracePeriod *int64) *v1.ReplicationController
RcByNameContainer returns a ReplicationControoler with specified name and container
func RcByNamePort ¶ added in v1.6.0
func RcByNamePort(name string, replicas int32, image string, port int, protocol v1.Protocol, labels map[string]string, gracePeriod *int64) *v1.ReplicationController
RcByNamePort returns a ReplicationController with specified name and port
func RegisterClusterFlags ¶ added in v1.4.0
func RegisterClusterFlags()
Register flags specific to the cluster e2e test suite.
func RegisterCommonFlags ¶ added in v1.4.0
func RegisterCommonFlags()
Register flags common to all e2e test suites.
func RegisterNodeFlags ¶ added in v1.4.0
func RegisterNodeFlags()
Register flags specific to the node e2e test suite.
func RemoveCleanupAction ¶
func RemoveCleanupAction(p CleanupActionHandle)
RemoveCleanupAction removes a function that was installed by AddCleanupAction.
func RemoveLabelOffNode ¶ added in v1.4.0
RemoveLabelOffNode is for cleaning up labels temporarily added to node, won't fail if target label doesn't exist or has been removed.
func RemoveTaintOffNode ¶ added in v1.4.0
RemoveTaintOffNode is for cleaning up taints temporarily added to node, won't fail if target taint doesn't exist or has been removed.
func ResetMetrics ¶
Resets latency metrics in apiserver.
func ResourceUsageToPerfData ¶
func ResourceUsageToPerfData(usagePerNode ResourceUsagePerNode) *perftype.PerfData
ResourceUsageToPerfData transforms ResourceUsagePerNode to PerfData. Notice that this function only cares about memory usage, because cpu usage information will be extracted from NodesCPUSummary.
func ResourceUsageToPerfDataWithLabels ¶ added in v1.4.0
func ResourceUsageToPerfDataWithLabels(usagePerNode ResourceUsagePerNode, labels map[string]string) *perftype.PerfData
ResourceUsageToPerfDataWithLabels transforms ResourceUsagePerNode to PerfData with additional labels. Notice that this function only cares about memory usage, because cpu usage information will be extracted from NodesCPUSummary.
func RestartApiserver ¶
func RestartApiserver(c discovery.ServerVersionInterface) error
func RestartKubeProxy ¶
func RestclientConfig ¶ added in v1.6.0
func RestclientConfig(kubeContext string) (*clientcmdapi.Config, error)
func RunCleanupActions ¶
func RunCleanupActions()
RunCleanupActions runs all functions installed by AddCleanupAction. It does not remove them (see RemoveCleanupAction) but it does run unlocked, so they may remove themselves.
func RunCmd ¶
RunCmd runs cmd using args and returns its stdout and stderr. It also outputs cmd's stdout and stderr to their respective OS streams.
func RunCmdEnv ¶ added in v1.5.4
RunCmdEnv runs cmd with the provided environment and args and returns its stdout and stderr. It also outputs cmd's stdout and stderr to their respective OS streams.
func RunDeployment ¶
func RunDeployment(config testutils.DeploymentConfig) error
func RunHostCmd ¶
RunHostCmd runs the given cmd in the context of the given pod using `kubectl exec` inside of a shell.
func RunHostCmdOrDie ¶
RunHostCmdOrDie calls RunHostCmd and dies on error.
func RunKubectl ¶
RunKubectl is a convenience wrapper over kubectlBuilder
func RunKubectlOrDie ¶
RunKubectlOrDie is a convenience wrapper over kubectlBuilder
func RunKubectlOrDieInput ¶
RunKubectlOrDieInput is a convenience wrapper over kubectlBuilder that takes input to stdin
func RunReplicaSet ¶
func RunReplicaSet(config testutils.ReplicaSetConfig) error
func SameStringArray ¶ added in v1.6.0
SameStringArray verifies whether two string arrays have the same strings, return error if not. Order does not matter. When `include` is set to true, verifies whether result includes all elements from expected.
func ScaleDeployment ¶ added in v1.5.0
func ScaleRCByLabels ¶
func ScaleRCByLabels(clientset clientset.Interface, internalClientset internalclientset.Interface, ns string, l map[string]string, replicas uint) error
ScaleRCByLabels scales an RC via ns/label lookup. If replicas == 0 it waits till none are running, otherwise it does what a synchronous scale operation would do.
func ScaleResource ¶ added in v1.6.0
func ServerVersionGTE ¶
func ServerVersionGTE(v *utilversion.Version, c discovery.ServerVersionInterface) (bool, error)
ServerVersionGTE returns true if v is greater than or equal to the server version.
TODO(18726): This should be incorporated into client.VersionInterface.
func SetInstanceTags ¶ added in v1.6.0
func SetInstanceTags(cloudConfig CloudConfig, instanceName string, tags []string) []string
SetInstanceTags sets tags on GCE instance with given name.
func SimpleGET ¶ added in v1.6.0
SimpleGET executes a get on the given url, returns error if non-200 returned.
func SkipIfContainerRuntimeIs ¶ added in v1.4.0
func SkipIfContainerRuntimeIs(runtimes ...string)
func SkipIfMissingResource ¶ added in v1.4.1
func SkipIfMissingResource(clientPool dynamic.ClientPool, gvr schema.GroupVersionResource, namespace string)
func SkipIfProviderIs ¶
func SkipIfProviderIs(unsupportedProviders ...string)
func SkipUnlessAtLeast ¶
func SkipUnlessKubectlVersionGTE ¶ added in v1.3.8
func SkipUnlessKubectlVersionGTE(v *utilversion.Version)
func SkipUnlessNodeCountIsAtLeast ¶
func SkipUnlessNodeCountIsAtLeast(minNodeCount int)
func SkipUnlessNodeCountIsAtMost ¶ added in v1.6.0
func SkipUnlessNodeCountIsAtMost(maxNodeCount int)
func SkipUnlessNodeOSDistroIs ¶ added in v1.6.0
func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string)
func SkipUnlessProviderIs ¶
func SkipUnlessProviderIs(supportedProviders ...string)
func SkipUnlessServerVersionGTE ¶
func SkipUnlessServerVersionGTE(v *utilversion.Version, c discovery.ServerVersionInterface)
func StartCmdAndStreamOutput ¶
func StartCmdAndStreamOutput(cmd *exec.Cmd) (stdout, stderr io.ReadCloser, err error)
func StartServeHostnameService ¶ added in v1.6.0
func StartServeHostnameService(c clientset.Interface, internalClient internalclientset.Interface, ns, name string, port, replicas int) ([]string, string, error)
StartServeHostnameService creates a replication controller that serves its hostname and a service on top of it.
func StopServeHostnameService ¶ added in v1.6.0
func TargetContainers ¶
func TargetContainers() []string
A list of containers for which we want to collect resource usage.
func TestHitNodesFromOutside ¶ added in v1.6.0
func TestHitNodesFromOutsideWithCount ¶ added in v1.6.0
func TestNotReachableHTTP ¶ added in v1.6.0
func TestNotReachableHTTPTimeout ¶ added in v1.6.0
func TestNotReachableUDP ¶ added in v1.6.0
func TestReachableHTTP ¶ added in v1.6.0
func TestReachableHTTPWithContent ¶ added in v1.6.0
func TestReachableHTTPWithContentTimeout ¶ added in v1.6.0
func TestReachableUDP ¶ added in v1.6.0
func UnblockNetwork ¶
func UpdateDeploymentWithRetries ¶
func UpdateDeploymentWithRetries(c clientset.Interface, namespace, name string, applyUpdate updateDeploymentFunc) (deployment *extensions.Deployment, err error)
func UpdateJobWithRetries ¶ added in v1.5.0
func UpdatePodWithRetries ¶
func UpdateReplicaSetWithRetries ¶ added in v1.5.0
func UpdateReplicaSetWithRetries(c clientset.Interface, namespace, name string, applyUpdate updateRsFunc) (*extensions.ReplicaSet, error)
func UpdateReplicationControllerWithRetries ¶ added in v1.5.0
func UpdateService ¶ added in v1.6.0
func UpdateService(c clientset.Interface, namespace, serviceName string, update func(*v1.Service)) (*v1.Service, error)
UpdateService fetches a service, calls the update function on it, and then attempts to send the updated service. It retries up to 2 times in the face of timeouts and conflicts.
func UpdateStatefulSetWithRetries ¶ added in v1.5.0
func ValidateController ¶
func ValidateController(c clientset.Interface, containerImage string, replicas int, containername string, testname string, validator validatorFn, ns string)
ValidateController is a generic mechanism for testing RC's that are running. It takes a container name, a test name, and a validator function which is plugged in by a specific test. "containername": this is grepped for. "containerImage" : this is the name of the image we expect to be launched. Not to confuse w/ images (kitten.jpg) which are validated. "testname": which gets bubbled up to the logging/failure messages if errors happen. "validator" function: This function is given a podID and a client, and it can do some specific validations that way.
func ValidateEndpointsOrFail ¶ added in v1.6.0
func ValidateEndpointsOrFail(c clientset.Interface, namespace, serviceName string, expectedEndpoints PortsByPodName)
func VerifyFirewallRule ¶ added in v1.6.0
VerifyFirewallRule verifies whether the result firewall is consistent with the expected firewall. When `portsSubset` is false, match given ports exactly. Otherwise, only check ports are included.
func VerifyPodStartupLatency ¶
func VerifyPodStartupLatency(latency PodStartupLatency) error
Verifies whether 50, 90 and 99th percentiles of PodStartupLatency are within the threshold.
func VerifyPods ¶
func VerifyPodsRunning ¶ added in v1.6.0
func VerifySchedulerLatency ¶
Verifies (currently just by logging them) the scheduling latencies.
func VerifyServeHostnameServiceDown ¶ added in v1.6.0
func VerifyServeHostnameServiceUp ¶ added in v1.6.0
func VerifyServeHostnameServiceUp(c clientset.Interface, ns, host string, expectedPods []string, serviceIP string, servicePort int) error
VerifyServeHostnameServiceUp wgets the given serviceIP:servicePort from the given host and from within a pod. The host is expected to be an SSH-able node in the cluster. Each pod in the service is expected to echo its name. These names are compared with the given expectedPods list after a sort | uniq.
func ViperizeFlags ¶ added in v1.5.0
func ViperizeFlags()
ViperizeFlags sets up all flag and config processing. Future configuration info should be added to viper, not to flags.
func WaitForAllNodesHealthy ¶ added in v1.4.0
checks whether all registered nodes are ready and all required Pods are running on them.
func WaitForApiserverUp ¶
func WaitForAuthorizationUpdate ¶ added in v1.6.0
func WaitForAuthorizationUpdate(c v1beta1authorization.SubjectAccessReviewsGetter, user, namespace, verb string, resource schema.GroupResource, allowed bool) error
WaitForAuthorizationUpdate checks if the given user can perform the named verb and action. If policyCachePollTimeout is reached without the expected condition matching, an error is returned
func WaitForClusterSize ¶
WaitForClusterSize waits until the cluster has desired size and there is no not-ready nodes in it. By cluster size we mean number of Nodes excluding Master Node.
func WaitForControlledPodsRunning ¶ added in v1.6.0
func WaitForControlledPodsRunning(c clientset.Interface, ns, name string, kind schema.GroupKind) error
Wait up to 10 minutes for pods to become Running.
func WaitForDefaultServiceAccountInNamespace ¶
WaitForDefaultServiceAccountInNamespace waits for the default service account to be provisioned the default service account is what is associated with pods when they do not specify a service account as a result, pods are not able to be provisioned in a namespace until the service account is provisioned
func WaitForDeploymentOldRSsNum ¶
func WaitForDeploymentOldRSsNum(c clientset.Interface, ns, deploymentName string, desiredRSNum int) error
Waits for the deployment to clean up old rcs.
func WaitForDeploymentRevisionAndImage ¶
func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName string, revision, image string) error
WaitForDeploymentRevisionAndImage waits for the deployment's and its new RS's revision and container image to match the given revision and image. Note that deployment revision and its new RS revision should be updated shortly, so we only wait for 1 minute here to fail early.
func WaitForDeploymentRollbackCleared ¶
WaitForDeploymentRollbackCleared waits for given deployment either started rolling back or doesn't need to rollback. Note that rollback should be cleared shortly, so we only wait for 1 minute here to fail early.
func WaitForDeploymentStatus ¶
func WaitForDeploymentStatus(c clientset.Interface, d *extensions.Deployment) error
Waits for the deployment to reach desired state. Returns an error if the deployment's rolling update strategy (max unavailable or max surge) is broken at any times.
func WaitForDeploymentStatusValid ¶ added in v1.4.0
func WaitForDeploymentStatusValid(c clientset.Interface, d *extensions.Deployment) error
Waits for the deployment status to become valid (i.e. max unavailable and max surge aren't violated anymore). Note that the status should stay valid at all times unless shortly after a scaling event or the deployment is just created. To verify that the deployment status is valid and wait for the rollout to finish, use WaitForDeploymentStatus instead.
func WaitForDeploymentUpdatedReplicasLTE ¶
func WaitForDeploymentUpdatedReplicasLTE(c clientset.Interface, ns, deploymentName string, minUpdatedReplicas int, desiredGeneration int64) error
WaitForDeploymentUpdatedReplicasLTE waits for given deployment to be observed by the controller and has at least a number of updatedReplicas
func WaitForDeploymentWithCondition ¶ added in v1.5.0
func WaitForDeploymentWithCondition(c clientset.Interface, ns, deploymentName, reason string, condType extensions.DeploymentConditionType) error
func WaitForEvents ¶
func WaitForEvents(c clientset.Interface, ns string, objOrRef runtime.Object, desiredEventsCount int) error
Waits for the number of events on the given object to reach a desired count.
func WaitForIngressAddress ¶
func WaitForIngressAddress(c clientset.Interface, ns, ingName string, timeout time.Duration) (string, error)
WaitForIngressAddress waits for the Ingress to acquire an address.
func WaitForMasters ¶ added in v1.5.0
func WaitForMasters(masterPrefix string, c clientset.Interface, size int, timeout time.Duration) error
waitForMasters waits until the cluster has the desired number of ready masters in it.
func WaitForMatchPodsCondition ¶
func WaitForMatchPodsCondition(c clientset.Interface, opts metav1.ListOptions, desc string, timeout time.Duration, condition podCondition) error
WaitForMatchPodsCondition finds match pods based on the input ListOptions. waits and checks if all match pods are in the given podCondition
func WaitForNodeToBe ¶
func WaitForNodeToBe(c clientset.Interface, name string, conditionType v1.NodeConditionType, wantTrue bool, timeout time.Duration) bool
WaitForNodeToBe returns whether node "name's" condition state matches wantTrue within timeout. If wantTrue is true, it will ensure the node condition status is ConditionTrue; if it's false, it ensures the node condition is in any state other than ConditionTrue (e.g. not true or unknown).
func WaitForNodeToBeNotReady ¶
WaitForNodeToBeNotReady returns whether node name is not ready (i.e. the readiness condition is anything but ready, e.g false or unknown) within timeout.
func WaitForNodeToBeReady ¶
WaitForNodeToBeReady returns whether node name is ready within timeout.
func WaitForOverlappingAnnotationMatch ¶ added in v1.4.0
func WaitForPartialEvents ¶
func WaitForPartialEvents(c clientset.Interface, ns string, objOrRef runtime.Object, atLeastEventsCount int) error
Waits for the number of events on the given object to be at least a desired count.
func WaitForPersistentVolumeClaimPhase ¶
func WaitForPersistentVolumeClaimPhase(phase v1.PersistentVolumeClaimPhase, c clientset.Interface, ns string, pvcName string, Poll, timeout time.Duration) error
WaitForPersistentVolumeClaimPhase waits for a PersistentVolumeClaim to be in a specific phase or until timeout occurs, whichever comes first.
func WaitForPersistentVolumeDeleted ¶
func WaitForPersistentVolumeDeleted(c clientset.Interface, pvName string, Poll, timeout time.Duration) error
WaitForPersistentVolumeDeleted waits for a PersistentVolume to get deleted or until timeout occurs, whichever comes first.
func WaitForPersistentVolumePhase ¶
func WaitForPersistentVolumePhase(phase v1.PersistentVolumePhase, c clientset.Interface, pvName string, Poll, timeout time.Duration) error
WaitForPersistentVolumePhase waits for a PersistentVolume to be in a specific phase or until timeout occurs, whichever comes first.
func WaitForPodCondition ¶ added in v1.6.0
func WaitForPodNameRunningInNamespace ¶ added in v1.4.0
Waits default amount of time (PodStartTimeout) for the specified pod to become running. Returns an error if timeout occurs first, or pod goes in to failed state.
func WaitForPodNoLongerRunningInNamespace ¶
Waits default amount of time (podNoLongerRunningTimeout) for the specified pod to stop running. Returns an error if timeout occurs first.
func WaitForPodNotPending ¶
WaitForPodNotPending returns an error if it took too long for the pod to go out of pending state. The resourceVersion is used when Watching object changes, it tells since when we care about changes to the pod.
func WaitForPodRunningInNamespace ¶
Waits default amount of time (PodStartTimeout) for the specified pod to become running. Returns an error if timeout occurs first, or pod goes in to failed state.
func WaitForPodSuccessInNamespace ¶
WaitForPodSuccessInNamespace returns nil if the pod reached state success, or an error if it reached failure or until podStartupTimeout.
func WaitForPodSuccessInNamespaceSlow ¶
func WaitForPodSuccessInNamespaceSlow(c clientset.Interface, podName string, namespace string) error
WaitForPodSuccessInNamespaceSlow returns nil if the pod reached state success, or an error if it reached failure or until slowPodStartupTimeout.
func WaitForPodToDisappear ¶
func WaitForPodsReady ¶
func WaitForPodsRunningReady ¶
func WaitForPodsRunningReady(c clientset.Interface, ns string, minPods int32, timeout time.Duration, ignoreLabels map[string]string, skipSucceeded bool) error
WaitForPodsRunningReady waits up to timeout to ensure that all pods in namespace ns are either running and ready, or failed but controlled by a controller. Also, it ensures that at least minPods are running and ready. It has separate behavior from other 'wait for' pods functions in that it requests the list of pods on every iteration. This is useful, for example, in cluster startup, because the number of pods increases while waiting. If ignoreLabels is not empty, pods matching this selector are ignored and this function waits for minPods to enter Running/Ready and for all pods matching ignoreLabels to enter Success phase. Otherwise an error is returned even if there are minPods pods, some of which are in Running/Ready and some in Success. This is to allow the client to decide if "Success" means "Ready" or not. If skipSucceeded is true, any pods that are Succeeded are not counted.
func WaitForPodsSuccess ¶
func WaitForPodsSuccess(c clientset.Interface, ns string, successPodLabels map[string]string, timeout time.Duration) error
WaitForPodsSuccess waits till all labels matching the given selector enter the Success state. The caller is expected to only invoke this method once the pods have been created.
func WaitForPodsWithLabel ¶
func WaitForPodsWithLabel(c clientset.Interface, ns string, label labels.Selector) (pods *v1.PodList, err error)
Wait up to PodListTimeout for getting pods with certain label
func WaitForPodsWithLabelRunningReady ¶ added in v1.6.0
func WaitForPodsWithLabelRunningReady(c clientset.Interface, ns string, label labels.Selector, num int, timeout time.Duration) (pods *v1.PodList, err error)
Wait for exact amount of matching pods to become running and ready. Return the list of matching pods.
func WaitForPodsWithLabelScheduled ¶
func WaitForPodsWithLabelScheduled(c clientset.Interface, ns string, label labels.Selector) (pods *v1.PodList, err error)
Wait for all matching pods to become scheduled and at least one matching pod exists. Return the list of matching pods.
func WaitForRCPodToDisappear ¶
WaitForRCPodToDisappear returns nil if the pod from the given replication controller (described by rcName) no longer exists. In case of failure or too long waiting time, an error is returned.
func WaitForRCToStabilize ¶
WaitForRCToStabilize waits till the RC has a matching generation/replica count between spec and status.
func WaitForReadyReplicaSet ¶ added in v1.6.0
WaitForReadyReplicaSet waits until the replica set has all of its replicas ready.
func WaitForReplicationController ¶
func WaitForReplicationController(c clientset.Interface, namespace, name string, exist bool, interval, timeout time.Duration) error
WaitForReplicationController waits until the RC appears (exist == true), or disappears (exist == false)
func WaitForService ¶
func WaitForService(c clientset.Interface, namespace, name string, exist bool, interval, timeout time.Duration) error
WaitForService waits until the service appears (exist == true), or disappears (exist == false)
func WaitForServiceEndpointsNum ¶
func WaitForServiceEndpointsNum(c clientset.Interface, namespace, serviceName string, expectNum int, interval, timeout time.Duration) error
WaitForServiceEndpointsNum waits until the amount of endpoints that implement service to expectNum.
func WaitForStableCluster ¶ added in v1.4.0
WaitForStableCluster waits until all existing pods are scheduled and returns their amount.
func WaitTimeoutForPodNoLongerRunningInNamespace ¶ added in v1.4.0
func WatchRecreateDeployment ¶ added in v1.6.0
func WatchRecreateDeployment(c clientset.Interface, d *extensions.Deployment) error
WatchRecreateDeployment watches Recreate deployments and ensures no new pods will run at the same time with old pods.
Types ¶
type APICall ¶
type APICall struct { Resource string `json:"resource"` Verb string `json:"verb"` Latency LatencyMetric `json:"latency"` }
type APIResponsiveness ¶
type APIResponsiveness struct {
APICalls []APICall `json:"apicalls"`
}
func (APIResponsiveness) Len ¶
func (a APIResponsiveness) Len() int
func (APIResponsiveness) Less ¶
func (a APIResponsiveness) Less(i, j int) bool
func (APIResponsiveness) Swap ¶
func (a APIResponsiveness) Swap(i, j int)
type CleanupActionHandle ¶
type CleanupActionHandle *int
func AddCleanupAction ¶
func AddCleanupAction(fn func()) CleanupActionHandle
AddCleanupAction installs a function that will be called in the event of the whole test being terminated. This allows arbitrary pieces of the overall test to hook into SynchronizedAfterSuite().
type ClientConfigGetter ¶
type ClientConfigGetter func() (*restclient.Config, error)
type CloudConfig ¶
type ClusterVerification ¶
type ClusterVerification struct {
// contains filtered or unexported fields
}
func (*ClusterVerification) ForEach ¶
func (cl *ClusterVerification) ForEach(podFunc func(v1.Pod)) error
ForEach runs a function against every verifiable pod. Be warned that this doesn't wait for "n" pods to verifiy, so it may return very quickly if you have strict pod state requirements.
For example, if you require at least 5 pods to be running before your test will pass, its smart to first call "clusterVerification.WaitFor(5)" before you call clusterVerification.ForEach.
func (*ClusterVerification) WaitFor ¶
WaitFor waits for some minimum number of pods to be verified, according to the PodStateVerification definition.
func (*ClusterVerification) WaitForOrFail ¶
func (cl *ClusterVerification) WaitForOrFail(atLeast int, timeout time.Duration)
WaitForOrFail provides a shorthand WaitFor with failure as an option if anything goes wrong.
type ContainerFailures ¶
type ContainerFailures struct { Restarts int // contains filtered or unexported fields }
type ContainerResourceUsage ¶
type ContainersCPUSummary ¶
ContainersCPUSummary is indexed by the container name with each entry a (percentile, value) map.
type CreateTestingNSFn ¶
type E2ETestNodePreparer ¶ added in v1.5.0
type E2ETestNodePreparer struct {
// contains filtered or unexported fields
}
E2ETestNodePreparer implements testutils.TestNodePreparer interface, which is used to create/modify Nodes before running a test.
func (*E2ETestNodePreparer) CleanupNodes ¶ added in v1.5.0
func (p *E2ETestNodePreparer) CleanupNodes() error
func (*E2ETestNodePreparer) PrepareNodes ¶ added in v1.5.0
func (p *E2ETestNodePreparer) PrepareNodes() error
type EventsLister ¶ added in v1.5.0
type ExecOptions ¶ added in v1.5.0
type ExecOptions struct { Command []string Namespace string PodName string ContainerName string Stdin io.Reader CaptureStdout bool CaptureStderr bool // If false, whitespace in std{err,out} will be removed. PreserveWhitespace bool }
ExecOptions passed to ExecWithOptions
type Framework ¶
type Framework struct { BaseName string // ClientSet uses internal objects, you should use ClientSet where possible. ClientSet clientset.Interface InternalClientset *internalclientset.Clientset StagingClient *staging.Clientset ClientPool dynamic.ClientPool Namespace *v1.Namespace // Every test has at least one namespace NamespaceDeletionTimeout time.Duration // Constraints that passed to a check which is executed after data is gathered to // see if 99% of results are within acceptable bounds. It as to be injected in the test, // as expectations vary greatly. Constraints are groupped by the container names. AddonResourceConstraints map[string]ResourceConstraint // configuration for framework's client Options FrameworkOptions // contains filtered or unexported fields }
Framework supports common operations used by e2e tests; it will keep a client & a namespace for you. Eventual goal is to merge this with integration test framework.
func NewDefaultFramework ¶
NewFramework makes a new framework and sets up a BeforeEach/AfterEach for you (you can write additional before/after each functions).
func NewDefaultGroupVersionFramework ¶ added in v1.5.0
func NewDefaultGroupVersionFramework(baseName string, groupVersion schema.GroupVersion) *Framework
func NewFramework ¶
func NewFramework(baseName string, options FrameworkOptions, client clientset.Interface) *Framework
func (*Framework) AfterEach ¶
func (f *Framework) AfterEach()
AfterEach deletes the namespace, after reading its events.
func (*Framework) BeforeEach ¶
func (f *Framework) BeforeEach()
BeforeEach gets a client and makes a namespace.
func (*Framework) CheckFileSizeViaContainer ¶ added in v1.4.6
func (*Framework) CreateNamespace ¶
func (*Framework) CreatePodsPerNodeForSimpleApp ¶
func (f *Framework) CreatePodsPerNodeForSimpleApp(appName string, podSpec func(n v1.Node) v1.PodSpec, maxCount int) map[string]string
CreatePodsPerNodeForSimpleApp Creates pods w/ labels. Useful for tests which make a bunch of pods w/o any networking.
func (*Framework) CreateServiceForSimpleApp ¶
CreateServiceForSimpleApp returns a service that selects/exposes pods (send -1 ports if no exposure needed) with an app label.
func (*Framework) CreateServiceForSimpleAppWithPods ¶
func (f *Framework) CreateServiceForSimpleAppWithPods(contPort int, svcPort int, appName string, podSpec func(n v1.Node) v1.PodSpec, count int, block bool) (error, *v1.Service)
CreateServiceForSimpleAppWithPods is a convenience wrapper to create a service and its matching pods all at once.
func (*Framework) ExecCommandInContainer ¶ added in v1.4.0
ExecCommandInContainer executes a command in the specified container.
func (*Framework) ExecCommandInContainerWithFullOutput ¶ added in v1.5.0
func (f *Framework) ExecCommandInContainerWithFullOutput(podName, containerName string, cmd ...string) (string, string, error)
ExecCommandInContainerWithFullOutput executes a command in the specified container and return stdout, stderr and error
func (*Framework) ExecCommandInPod ¶ added in v1.4.0
func (*Framework) ExecCommandInPodWithFullOutput ¶ added in v1.5.0
func (*Framework) ExecShellInContainer ¶ added in v1.4.0
func (*Framework) ExecShellInPod ¶ added in v1.4.0
func (*Framework) ExecShellInPodWithFullOutput ¶ added in v1.5.0
func (*Framework) ExecWithOptions ¶ added in v1.5.0
func (f *Framework) ExecWithOptions(options ExecOptions) (string, string, error)
ExecWithOptions executes a command in the specified container, returning stdout, stderr and error. `options` allowed for additional parameters to be passed.
func (*Framework) MatchContainerOutput ¶ added in v1.4.0
func (f *Framework) MatchContainerOutput( pod *v1.Pod, containerName string, expectedOutput []string, matcher func(string, ...interface{}) gomegatypes.GomegaMatcher) error
MatchContainerOutput creates a pod and waits for all it's containers to exit with success. It then tests that the matcher with each expectedOutput matches the output of the specified container.
func (*Framework) NewClusterVerification ¶
func (f *Framework) NewClusterVerification(namespace *v1.Namespace, filter PodStateVerification) *ClusterVerification
func (*Framework) PodClient ¶ added in v1.4.0
Convenience method for getting a pod client interface in the framework's namespace, possibly applying test-suite specific transformations to the pod spec, e.g. for node e2e pod scheduling.
func (*Framework) PodClientNS ¶ added in v1.6.0
Convenience method for getting a pod client interface in an alternative namespace, possibly applying test-suite specific transformations to the pod spec, e.g. for node e2e pod scheduling.
func (*Framework) ReadFileViaContainer ¶
func (f *Framework) ReadFileViaContainer(podName, containerName string, path string) (string, error)
Read a file using kubectl exec cat <path>
func (*Framework) TestContainerOutput ¶
func (f *Framework) TestContainerOutput(scenarioName string, pod *v1.Pod, containerIndex int, expectedOutput []string)
TestContainerOutput runs the given pod in the given namespace and waits for all of the containers in the podSpec to move into the 'Success' status, and tests the specified container log against the given expected output using a substring matcher.
func (*Framework) TestContainerOutputRegexp ¶
func (f *Framework) TestContainerOutputRegexp(scenarioName string, pod *v1.Pod, containerIndex int, expectedOutput []string)
TestContainerOutputRegexp runs the given pod in the given namespace and waits for all of the containers in the podSpec to move into the 'Success' status, and tests the specified container log against the given expected output using a regexp matcher.
func (*Framework) WaitForAnEndpoint ¶
WaitForAnEndpoint waits for at least one endpoint to become available in the service's corresponding endpoints object.
func (*Framework) WaitForPodNoLongerRunning ¶
WaitForPodNoLongerRunning waits for the pod to no longer be running in the namespace, for either success or failure.
func (*Framework) WaitForPodReady ¶
WaitForPodReady waits for the pod to flip to ready in the namespace.
func (*Framework) WaitForPodRunning ¶
WaitForPodRunning waits for the pod to run in the namespace.
func (*Framework) WaitForPodRunningSlow ¶
WaitForPodRunningSlow waits for the pod to run in the namespace. It has a longer timeout then WaitForPodRunning (util.slowPodStartTimeout).
func (*Framework) WaitForPodTerminated ¶
WaitForPodTerminated waits for the pod to be terminated with the given reason.
func (*Framework) WriteFileViaContainer ¶
func (f *Framework) WriteFileViaContainer(podName, containerName string, path string, contents string) error
Write a file using kubectl exec echo <contents> > <path> via specified container Because of the primitive technique we're using here, we only allow ASCII alphanumeric characters
type FrameworkOptions ¶
type FrameworkOptions struct { ClientQPS float32 ClientBurst int GroupVersion *schema.GroupVersion }
type InvariantFunc ¶
type KubeCluster ¶
type KubeConfig ¶
type KubeConfig struct { Contexts []struct { Name string `yaml:"name"` Context struct { Cluster string `yaml:"cluster"` User string } `yaml:"context"` } `yaml:"contexts"` Clusters []KubeCluster `yaml:"clusters"` Users []KubeUser `yaml:"users"` }
func (*KubeConfig) FindCluster ¶ added in v1.6.0
func (kc *KubeConfig) FindCluster(name string) *KubeCluster
func (*KubeConfig) FindUser ¶ added in v1.6.0
func (kc *KubeConfig) FindUser(name string) *KubeUser
type KubeletLatencyMetric ¶
type KubeletLatencyMetric struct { // eg: list, info, create Operation string // eg: sync_pods, pod_worker Method string // 0 <= quantile <=1, e.g. 0.95 is 95%tile, 0.5 is median. Quantile float64 Latency time.Duration }
KubeletMetric stores metrics scraped from the kubelet server's /metric endpoint. TODO: Get some more structure around the metrics and this type
type KubeletLatencyMetrics ¶
type KubeletLatencyMetrics []KubeletLatencyMetric
KubeletMetricByLatency implements sort.Interface for []KubeletMetric based on the latency field.
func GetKubeletLatencyMetrics ¶
func GetKubeletLatencyMetrics(ms metrics.KubeletMetrics) KubeletLatencyMetrics
GetKubeletLatencyMetrics gets all latency related kubelet metrics. Note that the KubeletMetrcis passed in should not contain subsystem prefix.
func HighLatencyKubeletOperations ¶
func HighLatencyKubeletOperations(c clientset.Interface, threshold time.Duration, nodeName string, logFunc func(fmt string, args ...interface{})) (KubeletLatencyMetrics, error)
HighLatencyKubeletOperations logs and counts the high latency metrics exported by the kubelet server via /metrics.
func (KubeletLatencyMetrics) Len ¶
func (a KubeletLatencyMetrics) Len() int
func (KubeletLatencyMetrics) Less ¶
func (a KubeletLatencyMetrics) Less(i, j int) bool
func (KubeletLatencyMetrics) Swap ¶
func (a KubeletLatencyMetrics) Swap(i, j int)
type KubemarkResourceUsage ¶ added in v1.6.0
type LatencyMetric ¶
type LatencyMetric struct { Perc50 time.Duration `json:"Perc50"` Perc90 time.Duration `json:"Perc90"` Perc99 time.Duration `json:"Perc99"` Perc100 time.Duration `json:"Perc100"` }
Dashboard metrics
func ExtractLatencyMetrics ¶
func ExtractLatencyMetrics(latencies []PodLatencyData) LatencyMetric
type LatencySlice ¶
type LatencySlice []PodLatencyData
func (LatencySlice) Len ¶
func (a LatencySlice) Len() int
func (LatencySlice) Less ¶
func (a LatencySlice) Less(i, j int) bool
func (LatencySlice) Swap ¶
func (a LatencySlice) Swap(i, j int)
type LogSizeDataTimeseries ¶
type LogSizeDataTimeseries map[string]map[string][]TimestampedSize
type LogSizeGatherer ¶
type LogSizeGatherer struct {
// contains filtered or unexported fields
}
LogSizeGatherer is a worker which grabs a WorkItem from the channel and does assigned work.
func (*LogSizeGatherer) Run ¶
func (g *LogSizeGatherer) Run()
func (*LogSizeGatherer) Work ¶
func (g *LogSizeGatherer) Work() bool
Work does a single unit of work: tries to take out a WorkItem from the queue, ssh-es into a given machine, gathers data, writes it to the shared <data> map, and creates a gorouting which reinserts work item into the queue with a <pollingPeriod> delay. Returns false if worker should exit.
type LogsSizeData ¶
type LogsSizeData struct {
// contains filtered or unexported fields
}
func (*LogsSizeData) AddNewData ¶
func (d *LogsSizeData) AddNewData(ip, path string, timestamp time.Time, size int)
type LogsSizeDataSummary ¶
type LogsSizeDataSummary map[string]map[string]SingleLogSummary
node -> file -> data
func (*LogsSizeDataSummary) PrintHumanReadable ¶
func (s *LogsSizeDataSummary) PrintHumanReadable() string
TODO: make sure that we don't need locking here
func (*LogsSizeDataSummary) PrintJSON ¶
func (s *LogsSizeDataSummary) PrintJSON() string
type LogsSizeVerifier ¶
type LogsSizeVerifier struct {
// contains filtered or unexported fields
}
LogsSizeVerifier gathers data about log files sizes from master and node machines. It oversees a <workersNo> workers which do the gathering.
func NewLogsVerifier ¶
func NewLogsVerifier(c clientset.Interface, stopChannel chan bool) *LogsSizeVerifier
NewLogsVerifier creates a new LogsSizeVerifier which will stop when stopChannel is closed
func (*LogsSizeVerifier) GetSummary ¶
func (s *LogsSizeVerifier) GetSummary() *LogsSizeDataSummary
GetSummary returns a summary (average generation rate and number of probes) of the data gathered by LogSizeVerifier
func (*LogsSizeVerifier) Run ¶
func (v *LogsSizeVerifier) Run()
Run starts log size gathering. It starts a gorouting for every worker and then blocks until stopChannel is closed
type MetricsForE2E ¶
type MetricsForE2E metrics.MetricsCollection
func (*MetricsForE2E) PrintHumanReadable ¶
func (m *MetricsForE2E) PrintHumanReadable() string
func (*MetricsForE2E) PrintJSON ¶
func (m *MetricsForE2E) PrintJSON() string
type NetworkingTestConfig ¶ added in v1.5.0
type NetworkingTestConfig struct { // TestContaienrPod is a test pod running the netexec image. It is capable // of executing tcp/udp requests against ip:port. TestContainerPod *v1.Pod // HostTestContainerPod is a pod running with hostNetworking=true, and the // hostexec image. HostTestContainerPod *v1.Pod // EndpointPods are the pods belonging to the Service created by this // test config. Each invocation of `setup` creates a service with // 1 pod per node running the netexecImage. EndpointPods []*v1.Pod // NodePortService is a Service with Type=NodePort spanning over all // endpointPods. NodePortService *v1.Service // ExternalAddrs is a list of external IPs of nodes in the cluster. ExternalAddrs []string // Nodes is a list of nodes in the cluster. Nodes []v1.Node // MaxTries is the number of retries tolerated for tests run against // endpoints and services created by this config. MaxTries int // The ClusterIP of the Service reated by this test config. ClusterIP string // External ip of first node for use in nodePort testing. NodeIP string // The http/udp nodePorts of the Service. NodeHttpPort int NodeUdpPort int // The kubernetes namespace within which all resources for this // config are created Namespace string // contains filtered or unexported fields }
NetworkingTestConfig is a convenience class around some utility methods for testing kubeproxy/networking/services/endpoints.
func NewCoreNetworkingTestConfig ¶ added in v1.5.0
func NewCoreNetworkingTestConfig(f *Framework) *NetworkingTestConfig
NewNetworkingTestNodeE2EConfig creates and sets up a new test config helper for Node E2E.
func NewNetworkingTestConfig ¶ added in v1.5.0
func NewNetworkingTestConfig(f *Framework) *NetworkingTestConfig
NewNetworkingTestConfig creates and sets up a new test config helper.
func (*NetworkingTestConfig) DeleteNetProxyPod ¶ added in v1.5.0
func (config *NetworkingTestConfig) DeleteNetProxyPod()
func (*NetworkingTestConfig) DeleteNodePortService ¶ added in v1.5.0
func (config *NetworkingTestConfig) DeleteNodePortService()
func (*NetworkingTestConfig) DialFromContainer ¶ added in v1.5.0
func (config *NetworkingTestConfig) DialFromContainer(protocol, containerIP, targetIP string, containerHttpPort, targetPort, maxTries, minTries int, expectedEps sets.String)
DialFromContainers executes a curl via kubectl exec in a test container, which might then translate to a tcp or udp request based on the protocol argument in the url.
- minTries is the minimum number of curl attempts required before declaring success. Set to 0 if you'd like to return as soon as all endpoints respond at least once.
- maxTries is the maximum number of curl attempts. If this many attempts pass and we don't see all expected endpoints, the test fails.
- expectedEps is the set of endpointnames to wait for. Typically this is also the hostname reported by each pod in the service through /hostName.
maxTries == minTries will confirm that we see the expected endpoints and no more for maxTries. Use this if you want to eg: fail a readiness check on a pod and confirm it doesn't show up as an endpoint.
func (*NetworkingTestConfig) DialFromEndpointContainer ¶ added in v1.5.0
func (config *NetworkingTestConfig) DialFromEndpointContainer(protocol, targetIP string, targetPort, maxTries, minTries int, expectedEps sets.String)
func (*NetworkingTestConfig) DialFromNode ¶ added in v1.5.0
func (config *NetworkingTestConfig) DialFromNode(protocol, targetIP string, targetPort, maxTries, minTries int, expectedEps sets.String)
DialFromNode executes a tcp or udp request based on protocol via kubectl exec in a test container running with host networking.
- minTries is the minimum number of curl attempts required before declaring success. Set to 0 if you'd like to return as soon as all endpoints respond at least once.
- maxTries is the maximum number of curl attempts. If this many attempts pass and we don't see all expected endpoints, the test fails.
maxTries == minTries will confirm that we see the expected endpoints and no more for maxTries. Use this if you want to eg: fail a readiness check on a pod and confirm it doesn't show up as an endpoint.
func (*NetworkingTestConfig) DialFromTestContainer ¶ added in v1.5.0
func (config *NetworkingTestConfig) DialFromTestContainer(protocol, targetIP string, targetPort, maxTries, minTries int, expectedEps sets.String)
func (*NetworkingTestConfig) EndpointHostnames ¶ added in v1.5.0
func (config *NetworkingTestConfig) EndpointHostnames() sets.String
EndpointHostnames returns a set of hostnames for existing endpoints.
func (*NetworkingTestConfig) GetSelfURL ¶ added in v1.5.0
func (config *NetworkingTestConfig) GetSelfURL(path string, expected string)
GetSelfURL executes a curl against the given path via kubectl exec into a test container running with host networking, and fails if the output doesn't match the expected string.
type NodeRuntimeOperationErrorRate ¶
type NodeRuntimeOperationErrorRate map[string]*RuntimeOperationErrorRate
NodeRuntimeOperationErrorRate is the runtime operation error rate on one node.
type NodeTestContextType ¶ added in v1.4.0
type NodeTestContextType struct { // NodeE2E indicates whether it is running node e2e. NodeE2E bool // Name of the node to run tests on. NodeName string // NodeConformance indicates whether the test is running in node conformance mode. NodeConformance bool // PrepullImages indicates whether node e2e framework should prepull images. PrepullImages bool // KubeletConfig is the kubelet configuration the test is running against. KubeletConfig componentconfig.KubeletConfiguration }
NodeTestContextType is part of TestContextType, it is shared by all node e2e test.
type NodesCPUSummary ¶
type NodesCPUSummary map[string]ContainersCPUSummary
NodesCPUSummary is indexed by the node name with each entry a ContainersCPUSummary map.
type PodClient ¶ added in v1.4.0
type PodClient struct { v1core.PodInterface // contains filtered or unexported fields }
func (*PodClient) Create ¶ added in v1.4.0
Create creates a new pod according to the framework specifications (don't wait for it to start).
func (*PodClient) CreateBatch ¶ added in v1.4.0
CreateBatch create a batch of pods. All pods are created before waiting.
func (*PodClient) CreateSync ¶ added in v1.4.0
CreateSync creates a new pod according to the framework specifications, and wait for it to start.
func (*PodClient) DeleteSync ¶ added in v1.5.0
DeleteSync deletes the pod and wait for the pod to disappear for `timeout`. If the pod doesn't disappear before the timeout, it will fail the test.
func (*PodClient) MatchContainerOutput ¶ added in v1.5.0
func (c *PodClient) MatchContainerOutput(name string, containerName string, expectedRegexp string) error
MatchContainerOutput gest output of a container and match expected regexp in the output.
type PodLatencyData ¶
type PodLatencyData struct { // Name of the pod Name string // Node this pod was running on Node string // Latency information related to pod startuptime Latency time.Duration }
PodLatencyData encapsulates pod startup latency information.
type PodStartupLatency ¶
type PodStartupLatency struct {
Latency LatencyMetric `json:"latency"`
}
type PodStateVerification ¶
type PodStateVerification struct { // Optional: only pods that have k=v labels will pass this filter. Selectors map[string]string // Required: The phases which are valid for your pod. ValidPhases []v1.PodPhase // Optional: only pods passing this function will pass the filter // Verify a pod. // As an optimization, in addition to specfying filter (boolean), // this function allows specifying an error as well. // The error indicates that the polling of the pod spectrum should stop. Verify func(v1.Pod) (bool, error) // Optional: only pods with this name will pass the filter. PodName string }
PodStateVerification represents a verification of pod state. Any time you have a set of pods that you want to operate against or query, this struct can be used to declaratively identify those pods.
type PortsByPodName ¶ added in v1.6.0
type PortsByPodUID ¶ added in v1.6.0
func GetContainerPortsByPodUID ¶ added in v1.6.0
func GetContainerPortsByPodUID(endpoints *v1.Endpoints) PortsByPodUID
type ResourceConstraint ¶
type ResourceGathererOptions ¶
type ResourceGathererOptions struct {
// contains filtered or unexported fields
}
type ResourceMonitor ¶
type ResourceMonitor struct {
// contains filtered or unexported fields
}
ResourceMonitor manages a resourceCollector per node.
func NewResourceMonitor ¶
func (*ResourceMonitor) FormatCPUSummary ¶
func (r *ResourceMonitor) FormatCPUSummary(summary NodesCPUSummary) string
func (*ResourceMonitor) FormatResourceUsage ¶
func (r *ResourceMonitor) FormatResourceUsage(s ResourceUsagePerNode) string
func (*ResourceMonitor) GetCPUSummary ¶
func (r *ResourceMonitor) GetCPUSummary() NodesCPUSummary
func (*ResourceMonitor) GetLatest ¶
func (r *ResourceMonitor) GetLatest() (ResourceUsagePerNode, error)
func (*ResourceMonitor) GetMasterNodeCPUSummary ¶
func (r *ResourceMonitor) GetMasterNodeCPUSummary(summaryPerNode NodesCPUSummary) NodesCPUSummary
func (*ResourceMonitor) GetMasterNodeLatest ¶
func (r *ResourceMonitor) GetMasterNodeLatest(usagePerNode ResourceUsagePerNode) ResourceUsagePerNode
func (*ResourceMonitor) LogCPUSummary ¶
func (r *ResourceMonitor) LogCPUSummary()
func (*ResourceMonitor) LogLatest ¶
func (r *ResourceMonitor) LogLatest()
func (*ResourceMonitor) Reset ¶
func (r *ResourceMonitor) Reset()
func (*ResourceMonitor) Start ¶
func (r *ResourceMonitor) Start()
func (*ResourceMonitor) Stop ¶
func (r *ResourceMonitor) Stop()
type ResourceUsagePerContainer ¶
type ResourceUsagePerContainer map[string]*ContainerResourceUsage
type ResourceUsagePerNode ¶
type ResourceUsagePerNode map[string]ResourceUsagePerContainer
type ResourceUsageSummary ¶
type ResourceUsageSummary map[string][]SingleContainerSummary
we can't have int here, as JSON does not accept integer keys.
func (*ResourceUsageSummary) PrintHumanReadable ¶
func (s *ResourceUsageSummary) PrintHumanReadable() string
func (*ResourceUsageSummary) PrintJSON ¶
func (s *ResourceUsageSummary) PrintJSON() string
type RuntimeOperationErrorRate ¶
RuntimeOperationErrorRate is the error rate of a specified runtime operation.
type RuntimeOperationMonitor ¶
type RuntimeOperationMonitor struct {
// contains filtered or unexported fields
}
RuntimeOperationMonitor is the tool getting and parsing docker operation metrics.
func NewRuntimeOperationMonitor ¶
func NewRuntimeOperationMonitor(c clientset.Interface) *RuntimeOperationMonitor
func (*RuntimeOperationMonitor) GetLatestRuntimeOperationErrorRate ¶
func (m *RuntimeOperationMonitor) GetLatestRuntimeOperationErrorRate() map[string]NodeRuntimeOperationErrorRate
GetLatestRuntimeOperationErrorRate gets latest error rate and timeout rate from last observed RuntimeOperationErrorRate.
func (*RuntimeOperationMonitor) GetRuntimeOperationErrorRate ¶
func (m *RuntimeOperationMonitor) GetRuntimeOperationErrorRate() map[string]NodeRuntimeOperationErrorRate
GetRuntimeOperationErrorRate gets runtime operation records from kubelet metrics and calculate error rates of all runtime operations.
type SSHResult ¶
func IssueSSHCommandWithResult ¶ added in v1.4.6
type SaturationTime ¶
type SchedulingLatency ¶
type SchedulingLatency struct { Scheduling LatencyMetric `json:"scheduling"` Binding LatencyMetric `json:"binding"` Total LatencyMetric `json:"total"` }
type ServiceTestFixture ¶ added in v1.6.0
type ServiceTestFixture struct { ServiceName string Namespace string Client clientset.Interface TestId string Labels map[string]string Name string Image string // contains filtered or unexported fields }
Simple helper class to avoid too much boilerplate in tests
func NewServerTest ¶ added in v1.6.0
func NewServerTest(client clientset.Interface, namespace string, serviceName string) *ServiceTestFixture
func (*ServiceTestFixture) BuildServiceSpec ¶ added in v1.6.0
func (t *ServiceTestFixture) BuildServiceSpec() *v1.Service
Build default config for a service (which can then be changed)
func (*ServiceTestFixture) Cleanup ¶ added in v1.6.0
func (t *ServiceTestFixture) Cleanup() []error
func (*ServiceTestFixture) CreateRC ¶ added in v1.6.0
func (t *ServiceTestFixture) CreateRC(rc *v1.ReplicationController) (*v1.ReplicationController, error)
CreateRC creates a replication controller and records it for cleanup.
func (*ServiceTestFixture) CreateService ¶ added in v1.6.0
Create a service, and record it for cleanup
func (*ServiceTestFixture) CreateWebserverRC ¶ added in v1.6.0
func (t *ServiceTestFixture) CreateWebserverRC(replicas int32) *v1.ReplicationController
CreateWebserverRC creates rc-backed pods with the well-known webserver configuration and records it for cleanup.
func (*ServiceTestFixture) DeleteService ¶ added in v1.6.0
func (t *ServiceTestFixture) DeleteService(serviceName string) error
Delete a service, and remove it from the cleanup list
type ServiceTestJig ¶ added in v1.6.0
type ServiceTestJig struct { ID string Name string Client clientset.Interface Labels map[string]string }
A test jig to help service testing.
func NewServiceTestJig ¶ added in v1.6.0
func NewServiceTestJig(client clientset.Interface, name string) *ServiceTestJig
NewServiceTestJig allocates and inits a new ServiceTestJig.
func (*ServiceTestJig) ChangeServiceNodePortOrFail ¶ added in v1.6.0
func (j *ServiceTestJig) ChangeServiceNodePortOrFail(namespace, name string, initial int) *v1.Service
func (*ServiceTestJig) ChangeServiceType ¶ added in v1.6.0
func (j *ServiceTestJig) ChangeServiceType(namespace, name string, newType v1.ServiceType, timeout time.Duration)
func (*ServiceTestJig) CreateOnlyLocalLoadBalancerService ¶ added in v1.6.0
func (j *ServiceTestJig) CreateOnlyLocalLoadBalancerService(namespace, serviceName string, timeout time.Duration, createPod bool, tweak func(svc *v1.Service)) *v1.Service
CreateOnlyLocalLoadBalancerService creates a loadbalancer service and waits for it to acquire an ingress IP. If createPod is true, it also creates an RC with 1 replica of the standard netexec container used everywhere in this test.
func (*ServiceTestJig) CreateOnlyLocalNodePortService ¶ added in v1.6.0
func (j *ServiceTestJig) CreateOnlyLocalNodePortService(namespace, serviceName string, createPod bool) *v1.Service
CreateOnlyLocalNodePortService creates a loadbalancer service and sanity checks its nodePort. If createPod is true, it also creates an RC with 1 replica of the standard netexec container used everywhere in this test.
func (*ServiceTestJig) CreateTCPServiceOrFail ¶ added in v1.6.0
func (j *ServiceTestJig) CreateTCPServiceOrFail(namespace string, tweak func(svc *v1.Service)) *v1.Service
CreateTCPServiceOrFail creates a new TCP Service based on the jig's defaults. Callers can provide a function to tweak the Service object before it is created.
func (*ServiceTestJig) CreateTCPServiceWithPort ¶ added in v1.6.0
func (j *ServiceTestJig) CreateTCPServiceWithPort(namespace string, tweak func(svc *v1.Service), port int32) *v1.Service
CreateTCPServiceWithPort creates a new TCP Service with given port based on the jig's defaults. Callers can provide a function to tweak the Service object before it is created.
func (*ServiceTestJig) CreateUDPServiceOrFail ¶ added in v1.6.0
func (j *ServiceTestJig) CreateUDPServiceOrFail(namespace string, tweak func(svc *v1.Service)) *v1.Service
CreateUDPServiceOrFail creates a new UDP Service based on the jig's defaults. Callers can provide a function to tweak the Service object before it is created.
func (*ServiceTestJig) GetEndpointNodes ¶ added in v1.6.0
func (j *ServiceTestJig) GetEndpointNodes(svc *v1.Service) map[string][]string
GetEndpointNodes returns a map of nodenames:external-ip on which the endpoints of the given Service are running.
func (*ServiceTestJig) GetHTTPContent ¶ added in v1.6.0
func (*ServiceTestJig) GetNodes ¶ added in v1.6.0
func (j *ServiceTestJig) GetNodes(maxNodesForTest int) (nodes *v1.NodeList)
getNodes returns the first maxNodesForTest nodes. Useful in large clusters where we don't eg: want to create an endpoint per node.
func (*ServiceTestJig) GetNodesNames ¶ added in v1.6.0
func (j *ServiceTestJig) GetNodesNames(maxNodesForTest int) []string
func (*ServiceTestJig) LaunchEchoserverPodOnNode ¶ added in v1.6.0
func (j *ServiceTestJig) LaunchEchoserverPodOnNode(f *Framework, nodeName, podName string)
LaunchEchoserverPodOnNode launches a pod serving http on port 8080 to act as the target for source IP preservation test. The client's source ip would be echoed back by the web server.
func (*ServiceTestJig) LaunchNetexecPodOnNode ¶ added in v1.6.0
func (j *ServiceTestJig) LaunchNetexecPodOnNode(f *Framework, nodeName, podName string, httpPort, udpPort int32, hostNetwork bool)
func (*ServiceTestJig) RunOrFail ¶ added in v1.6.0
func (j *ServiceTestJig) RunOrFail(namespace string, tweak func(rc *v1.ReplicationController)) *v1.ReplicationController
RunOrFail creates a ReplicationController and Pod(s) and waits for the Pod(s) to be running. Callers can provide a function to tweak the RC object before it is created.
func (*ServiceTestJig) SanityCheckService ¶ added in v1.6.0
func (j *ServiceTestJig) SanityCheckService(svc *v1.Service, svcType v1.ServiceType)
func (*ServiceTestJig) TestHTTPHealthCheckNodePort ¶ added in v1.6.0
func (*ServiceTestJig) TestNotReachableHTTP ¶ added in v1.6.0
func (j *ServiceTestJig) TestNotReachableHTTP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestNotReachableUDP ¶ added in v1.6.0
func (j *ServiceTestJig) TestNotReachableUDP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestReachableHTTP ¶ added in v1.6.0
func (j *ServiceTestJig) TestReachableHTTP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestReachableUDP ¶ added in v1.6.0
func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) UpdateService ¶ added in v1.6.0
func (j *ServiceTestJig) UpdateService(namespace, name string, update func(*v1.Service)) (*v1.Service, error)
UpdateService fetches a service, calls the update function on it, and then attempts to send the updated service. It tries up to 3 times in the face of timeouts and conflicts.
func (*ServiceTestJig) UpdateServiceOrFail ¶ added in v1.6.0
func (j *ServiceTestJig) UpdateServiceOrFail(namespace, name string, update func(*v1.Service)) *v1.Service
UpdateServiceOrFail fetches a service, calls the update function on it, and then attempts to send the updated service. It tries up to 3 times in the face of timeouts and conflicts.
func (*ServiceTestJig) WaitForEndpointOnNode ¶ added in v1.6.0
func (j *ServiceTestJig) WaitForEndpointOnNode(namespace, serviceName, nodeName string)
func (*ServiceTestJig) WaitForLoadBalancerDestroyOrFail ¶ added in v1.6.0
func (*ServiceTestJig) WaitForLoadBalancerOrFail ¶ added in v1.6.0
type SingleContainerSummary ¶
type SingleLogSummary ¶
type TestContextType ¶
type TestContextType struct { KubeConfig string KubeContext string KubeAPIContentType string KubeVolumeDir string CertDir string Host string // TODO: Deprecating this over time... instead just use gobindata_util.go , see #23987. RepoRoot string Provider string CloudConfig CloudConfig KubectlPath string OutputDir string ReportDir string ReportPrefix string Prefix string MinStartupPods int // Timeout for waiting for system pods to be running SystemPodsStartupTimeout time.Duration UpgradeTarget string UpgradeImage string PrometheusPushGateway string ContainerRuntime string MasterOSDistro string NodeOSDistro string VerifyServiceAccount bool DeleteNamespace bool DeleteNamespaceOnFailure bool AllowedNotReadyNodes int CleanStart bool // If set to 'true' or 'all' framework will start a goroutine monitoring resource usage of system add-ons. // It will read the data every 30 seconds from all Nodes and print summary during afterEach. If set to 'master' // only master Node will be monitored. GatherKubeSystemResourceUsageData string GatherLogsSizes bool GatherMetricsAfterTest bool // Currently supported values are 'hr' for human-readable and 'json'. It's a comma separated list. OutputPrintType string // NodeSchedulableTimeout is the timeout for waiting for all nodes to be schedulable. NodeSchedulableTimeout time.Duration // CreateTestingNS is responsible for creating namespace used for executing e2e tests. // It accepts namespace base name, which will be prepended with e2e prefix, kube client // and labels to be applied to a namespace. CreateTestingNS CreateTestingNSFn // If set to true test will dump data about the namespace in which test was running. DumpLogsOnFailure bool // If the garbage collector is enabled in the kube-apiserver and kube-controller-manager. GarbageCollectorEnabled bool // FeatureGates is a set of key=value pairs that describe feature gates for alpha/experimental features. FeatureGates string // Node e2e specific test context NodeTestContextType // Federation e2e context FederatedKubeContext string Viper string Cadvisor struct { MaxRetries int SleepDurationMS int } LoggingSoak struct { Scale int MilliSecondsBetweenWaves int } }
var TestContext TestContextType
type TestDataSummary ¶
type TimestampedSize ¶
type TimestampedSize struct {
// contains filtered or unexported fields
}
TimestampedSize contains a size together with a time of measurement.
Source Files ¶
- authorizer_util.go
- cleanup.go
- exec_util.go
- federation_util.go
- firewall_util.go
- framework.go
- get-kubemark-resource-usage.go
- google_compute.go
- kubelet_stats.go
- log_size_monitoring.go
- metrics_util.go
- networking_utils.go
- nodes_util.go
- perf_util.go
- pods.go
- resource_usage_gatherer.go
- service_util.go
- test_context.go
- util.go