Documentation ¶
Overview ¶
Package framework contains provider-independent helper code for building and running E2E tests with Ginkgo. The actual Ginkgo test suites gets assembled by combining this framework, the optional provider support code and specific tests via a separate .go file like Kubernetes' test/e2e.go.
Index ¶
- Constants
- Variables
- func AddOrUpdateAvoidPodOnNode(c clientset.Interface, nodeName string, avoidPods v1.AvoidPods)
- func AddOrUpdateLabelOnNode(c clientset.Interface, nodeName string, labelKey, labelValue string)
- func AddOrUpdateLabelOnNodeAndReturnOldValue(c clientset.Interface, nodeName string, labelKey, labelValue string) string
- func AddOrUpdateTaintOnNode(c clientset.Interface, nodeName string, taint v1.Taint)
- func AfterReadingAllFlags(t *TestContextType)
- 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 BindRoleInNamespace(c v1beta1rbac.RoleBindingsGetter, role, 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 CheckAffinity(jig *ServiceTestJig, execPod *v1.Pod, targetIp string, targetPort int, ...) bool
- func CheckConnectivityToHost(f *Framework, nodeName, podName, host string, pingCmd PingCommand, timeout int) error
- func CheckDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName, revision, image string) error
- func CheckForAllJobPodsRunning(c clientset.Interface, ns, jobName string, parallelism int32) (bool, error)
- func CheckForControllerManagerHealthy(duration time.Duration) error
- func CheckInvariants(events []watch.Event, fns ...InvariantFunc) error
- func CheckMasterVersion(c clientset.Interface, want string) error
- func CheckNewRSAnnotations(c clientset.Interface, ns, deploymentName string, ...) error
- func CheckNodesReady(c clientset.Interface, size int, timeout time.Duration) ([]v1.Node, error)
- func CheckNodesVersions(cs clientset.Interface, want string) 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 CheckReachabilityFromPod(expectToBeReachable bool, timeout time.Duration, namespace, pod, target string)
- func CheckTestingNSDeletedExcept(c clientset.Interface, skip string) error
- func CleanUpVolumeServer(f *Framework, serverPod *v1.Pod)
- func CleanUpVolumeServerWithSecret(f *Framework, serverPod *v1.Pod, secret *v1.Secret)
- func Cleanup(filePath, ns string, selectors ...string)
- func CleanupServiceResources(c clientset.Interface, loadBalancerName, region, zone string)
- func ClusterMonitoringModeIs(monitoringModes ...string) bool
- func CollectAddresses(nodes *v1.NodeList, addressType v1.NodeAddressType) []string
- func ConformanceIt(text string, body interface{}, timeout ...float64) bool
- func ContainerInitInvariant(older, newer runtime.Object) error
- func CoreDump(dir string)
- func CreateClientPod(c clientset.Interface, ns string, pvc *v1.PersistentVolumeClaim) (*v1.Pod, error)
- func CreateDeployment(client clientset.Interface, replicas int32, podLabels map[string]string, ...) (*apps.Deployment, error)
- func CreateEmptyFileOnPod(namespace string, podName string, filePath string) error
- func CreateExecPodOrFail(client clientset.Interface, ns, generateName string, tweak func(*v1.Pod)) string
- func CreateGCEVolume() (*v1.PersistentVolumeSource, string)
- func CreateJob(c clientset.Interface, ns string, job *batch.Job) (*batch.Job, error)
- func CreateManagedInstanceGroup(size int64, zone, template string) error
- func CreateNginxPod(client clientset.Interface, namespace string, nodeSelector map[string]string, ...) (*v1.Pod, error)
- func CreatePDWithRetry() (string, error)
- func CreatePDWithRetryAndZone(zone string) (string, error)
- func CreatePV(c clientset.Interface, pv *v1.PersistentVolume) (*v1.PersistentVolume, error)
- func CreatePVC(c clientset.Interface, ns string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
- func CreatePVCPV(c clientset.Interface, pvConfig PersistentVolumeConfig, ...) (*v1.PersistentVolume, *v1.PersistentVolumeClaim, error)
- func CreatePVPVC(c clientset.Interface, pvConfig PersistentVolumeConfig, ...) (*v1.PersistentVolume, *v1.PersistentVolumeClaim, error)
- func CreatePVSource(zone string) (*v1.PersistentVolumeSource, error)
- func CreatePVsPVCs(numpvs, numpvcs int, c clientset.Interface, ns string, ...) (PVMap, PVCMap, error)
- func CreatePod(client clientset.Interface, namespace string, nodeSelector map[string]string, ...) (*v1.Pod, error)
- func CreatePodOrFail(c clientset.Interface, ns, name string, labels map[string]string, ...)
- func CreatePrivilegedPSPBinding(f *Framework, namespace string)
- func CreateSecPod(client clientset.Interface, namespace string, ...) (*v1.Pod, error)
- func CreateSecPodWithNodeName(client clientset.Interface, namespace string, ...) (*v1.Pod, error)
- func CreateServiceSpec(serviceName, externalName string, isHeadless bool, selector map[string]string) *v1.Service
- func CreateStatefulSetService(name string, labels map[string]string) *v1.Service
- func CreateStorageServer(cs clientset.Interface, config VolumeTestConfig) (pod *v1.Pod, ip string)
- func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error)
- func CreateUnschedulablePod(client clientset.Interface, namespace string, nodeSelector map[string]string, ...) (*v1.Pod, error)
- func CreateWaitAndDeletePod(f *Framework, c clientset.Interface, ns string, pvc *v1.PersistentVolumeClaim) (err error)
- func DeleteAllStatefulSets(c clientset.Interface, ns string)
- func DeleteJob(c clientset.Interface, ns, name string) error
- func DeleteManagedInstanceGroup(zone string) error
- func DeleteNamespaces(c clientset.Interface, deleteFilter, skipFilter []string) ([]string, error)
- func DeleteNodeOnCloudProvider(node *v1.Node) error
- func DeletePDWithRetry(diskName string) error
- func DeletePVCandValidatePV(c clientset.Interface, ns string, pvc *v1.PersistentVolumeClaim, ...) error
- func DeletePVCandValidatePVGroup(c clientset.Interface, ns string, pvols PVMap, claims PVCMap, ...) error
- func DeletePVSource(pvSource *v1.PersistentVolumeSource) error
- func DeletePersistentVolume(c clientset.Interface, pvName string) error
- func DeletePersistentVolumeClaim(c clientset.Interface, pvcName string, ns string) error
- func DeletePodOrFail(c clientset.Interface, ns, name string)
- func DeletePodWithWait(f *Framework, c clientset.Interface, pod *v1.Pod) error
- func DeletePodWithWaitByName(f *Framework, c clientset.Interface, podName, podNamespace string) error
- func DeleteRCAndWaitForGC(c clientset.Interface, ns, name string) error
- func DeleteResourceAndWaitForGC(c clientset.Interface, kind schema.GroupKind, ns, name string) error
- func DescribeIng(ns string)
- func DescribeItem(item interface{}) string
- func DescribeSvc(ns string)
- func DsFromManifest(url string) (*apps.DaemonSet, error)
- func DumpAllNamespaceInfo(c clientset.Interface, namespace string)
- func DumpDebugInfo(c clientset.Interface, ns string)
- func DumpEventsInNamespace(eventsLister EventsLister, namespace string)
- func DumpNodeDebugInfo(c clientset.Interface, nodeNames []string, ...)
- func EnableAndDisableInternalLB() (enable func(svc *v1.Service), disable func(svc *v1.Service))
- func EnsureLoadBalancerResourcesDeleted(ip, portRange string) error
- func EtcdUpgrade(target_storage, target_version string) error
- func ExpectNoError(err error, explain ...interface{})
- func ExpectNoErrorWithOffset(offset int, 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 FailfWithOffset(offset int, format string, args ...interface{})
- func FilterNodes(nodeList *v1.NodeList, fn func(node v1.Node) bool)
- func FormatRuntimeOperationErrorRate(nodesResult map[string]NodeRuntimeOperationErrorRate) string
- func GatherCPUProfile(componentName string, profileBaseName string, wg *sync.WaitGroup)
- func GatherCPUProfileForSeconds(componentName string, profileBaseName string, seconds int, wg *sync.WaitGroup)
- func GatherMemoryProfile(componentName string, profileBaseName string, wg *sync.WaitGroup)
- func GenerateMasterRegexp(prefix string) string
- func GeneratePodSecurityContext(fsGroup *int64, seLinuxOptions *v1.SELinuxOptions) *v1.PodSecurityContext
- func GenerateReadFileCmd(fullPath string) []string
- func GenerateScriptCmd(command string) []string
- func GenerateSecurityContext(privileged bool) *v1.SecurityContext
- func GenerateWriteFileCmd(content, fullPath string) []string
- func GenerateWriteandExecuteScriptFileCmd(content, fileName, filePath string) []string
- func GetAllMasterAddresses(c clientset.Interface) []string
- func GetClusterZones(c clientset.Interface) (sets.String, error)
- func GetFileModeRegex(filePath string, mask *int32) string
- func GetGPUDevicePluginImage() string
- func GetGroupNodes(group string) ([]string, error)
- func GetHostExternalAddress(client clientset.Interface, p *v1.Pod) (externalAddress string, err error)
- func GetIngressPoint(ing *v1.LoadBalancerIngress) string
- func GetJob(c clientset.Interface, ns, name string) (*batch.Job, error)
- func GetJobPods(c clientset.Interface, ns, jobName string) (*v1.PodList, error)
- 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 GetLogToFileFunc(file *os.File) func(format string, args ...interface{})
- func GetManagedInstanceGroupTemplateName(zone string) (string, error)
- 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, error)
- func GetNodeInternalIP(node *v1.Node) (string, error)
- func GetNodePortURL(client clientset.Interface, ns, name string, svcPort int) (string, error)
- func GetNodePublicIps(c clientset.Interface) ([]string, error)
- func GetNodeTTLAnnotationValue(c clientset.Interface) (time.Duration, error)
- func GetPodLogs(c clientset.Interface, namespace, podName, containerName string) (string, error)
- func GetPodSecretUpdateTimeout(c clientset.Interface) time.Duration
- func GetPodsForDeployment(client clientset.Interface, deployment *apps.Deployment) (*v1.PodList, 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 GetProviders() []string
- func GetReadyNodesIncludingTaintedOrDie(c clientset.Interface) (nodes *v1.NodeList)
- func GetReadySchedulableNodesOrDie(c clientset.Interface) (nodes *v1.NodeList)
- func GetServerArchitecture(c clientset.Interface) string
- func GetServiceLoadBalancerCreationTimeout(cs clientset.Interface) time.Duration
- func GetServicesProxyRequest(c clientset.Interface, request *restclient.Request) (*restclient.Request, error)
- func GetSigner(provider string) (ssh.Signer, error)
- func GetStatsSummary(c clientset.Interface, nodeName string) (*stats.Summary, error)
- func GetTestImage(image string) string
- func GroupSize(group string) (int, error)
- func HandleFlags()
- func IngressUpgrade(isUpgrade bool) error
- func InjectHtml(client clientset.Interface, config VolumeTestConfig, fsGroup *int64, ...)
- 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 IsPodSecurityPolicyEnabled(f *Framework) bool
- func IsRBACEnabled(f *Framework) bool
- func IssueSSHCommand(cmd, provider string, node *v1.Node) error
- func JobFinishTime(finishedJob *batch.Job) metav1.Time
- 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 LogClusterImageSources()
- 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 MakeDeployment(replicas int32, podLabels map[string]string, nodeSelector map[string]string, ...) *apps.Deployment
- func MakeNginxPod(ns string, nodeSelector map[string]string, ...) *v1.Pod
- func MakePersistentVolume(pvConfig PersistentVolumeConfig) *v1.PersistentVolume
- func MakePersistentVolumeClaim(cfg PersistentVolumeClaimConfig, ns string) *v1.PersistentVolumeClaim
- func MakePod(ns string, nodeSelector map[string]string, ...) *v1.Pod
- func MakeSecPod(ns string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, ...) *v1.Pod
- func MakeWritePod(ns string, pvc *v1.PersistentVolumeClaim) *v1.Pod
- func MasterOSDistroIs(supportedMasterOsDistros ...string) bool
- func MasterUpgrade(v string) error
- func MasterUpgradeGCEWithKubeProxyDaemonSet(v string, enableKubeProxyDaemonSet bool) error
- func MigTemplate() (string, error)
- func NVIDIADevicePlugin() *v1.Pod
- func NewDeployment(deploymentName string, replicas int32, podLabels map[string]string, ...) *apps.Deployment
- func NewE2ETestNodePreparer(client clientset.Interface, countToStrategy []testutils.CountToStrategy) testutils.TestNodePreparer
- func NewExecPodSpec(ns, name string, hostNetwork bool) *v1.Pod
- func NewKubectlCommand(args ...string) *kubectlBuilder
- func NewReplicaSet(name, namespace string, replicas int32, podLabels map[string]string, ...) *apps.ReplicaSet
- func NewStatefulSet(name, ns, governingSvcName string, replicas int32, ...) *apps.StatefulSet
- func NewStatefulSetPVC(name string) v1.PersistentVolumeClaim
- func NewStatefulSetScale(ss *apps.StatefulSet) *appsV1beta2.Scale
- func NewTestJob(behavior, name string, rPol v1.RestartPolicy, parallelism, completions int32, ...) *batch.Job
- func NodeAddresses(nodelist *v1.NodeList, addrType v1.NodeAddressType) []string
- func NodeHasTaint(c clientset.Interface, nodeName string, taint *v1.Taint) (bool, error)
- func NodeOSDistroIs(supportedNodeOsDistros ...string) bool
- func NodeProxyRequest(c clientset.Interface, node, endpoint string, port int) (restclient.Result, error)
- func NodeSSHHosts(c clientset.Interface) ([]string, error)
- func NodeUpgrade(f *Framework, v string, img string) error
- func NodeUpgradeGCEWithKubeProxyDaemonSet(f *Framework, v string, img string, enableKubeProxyDaemonSet bool) error
- func NumberOfNVIDIAGPUs(node *v1.Node) int64
- func NumberOfReadyNodes(c clientset.Interface) (int, error)
- func NumberOfRegisteredNodes(c clientset.Interface) (int, error)
- func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []string) (*websocket.Conn, error)
- func PVPVCCleanup(c clientset.Interface, ns string, pv *v1.PersistentVolume, ...) []error
- func PVPVCMapCleanup(c clientset.Interface, ns string, pvols PVMap, claims PVCMap) []error
- 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 PodStartupLatencyToPerfData(latency *PodStartupLatency) *perftype.PerfData
- 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 PrettyPrint(item interface{}) string
- func PrettyPrintJSON(metrics interface{}) string
- func PrintAllKubeletPods(c clientset.Interface, nodeName string)
- func PrintLatencies(latencies []PodLatencyData, header string)
- func PrintPerfData(p *perftype.PerfData)
- func PrintSummaries(summaries []TestDataSummary, testBaseName string)
- func PrivilegedPSP(name string) *policy.PodSecurityPolicy
- func ProviderIs(providers ...string) bool
- func ProxyMode(f *Framework) (string, error)
- func RandomSuffix() string
- 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 RealVersion(s string) (string, error)
- func RegisterClusterFlags()
- func RegisterCommonFlags()
- func RegisterNodeFlags()
- func RegisterProvider(name string, factory Factory)
- func RemoveAvoidPodsOffNode(c clientset.Interface, nodeName string)
- 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 ResetSchedulerMetrics(c clientset.Interface) error
- func ResizeGroup(group string, size int32) error
- func ResourceUsageToPerfData(usagePerNode ResourceUsagePerNode) *perftype.PerfData
- func ResourceUsageToPerfDataWithLabels(usagePerNode ResourceUsagePerNode, labels map[string]string) *perftype.PerfData
- func RestartApiserver(cs clientset.Interface) error
- func RestartControllerManager() error
- func RestartKubeProxy(host string) error
- func RestartKubelet(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 RunHostCmdWithRetries(ns, name, cmd string, interval, timeout time.Duration) (string, error)
- func RunIfContainerRuntimeIs(runtimes ...string)
- func RunIfSystemSpecNameIs(names ...string)
- func RunKubectl(args ...string) (string, error)
- func RunKubectlInput(data string, args ...string) (string, error)
- func RunKubectlOrDie(args ...string) string
- func RunKubectlOrDieInput(data string, args ...string) string
- func RunKubemciCmd(args ...string) (string, error)
- func RunKubemciWithKubeconfig(args ...string) (string, error)
- func RunRC(config testutils.RCConfig) error
- func RunReplicaSet(config testutils.ReplicaSetConfig) error
- func RunSSHCommandViaBastion(cmd, user, bastion, host string, signer ssh.Signer) (string, string, int, error)
- func ScaleDeployment(clientset clientset.Interface, scalesGetter scaleclient.ScalesGetter, ...) error
- func ScaleRC(clientset clientset.Interface, scalesGetter scaleclient.ScalesGetter, ...) error
- func ScaleRCByLabels(clientset clientset.Interface, scalesGetter scaleclient.ScalesGetter, ...) error
- func ScaleResource(clientset clientset.Interface, scalesGetter scaleclient.ScalesGetter, ...) error
- func ServerVersionGTE(v *utilversion.Version, c discovery.ServerVersionInterface) (bool, error)
- func ServiceResponding(c clientset.Interface, ns, name string) error
- func SimpleGET(c *http.Client, url, host string) (string, error)
- func SkipIfContainerRuntimeIs(runtimes ...string)
- func SkipIfMissingResource(dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, ...)
- func SkipIfMultizone(c clientset.Interface)
- func SkipIfProviderIs(unsupportedProviders ...string)
- func SkipUnlessAtLeast(value int, minValue int, message string)
- func SkipUnlessClusterMonitoringModeIs(supportedMonitoring ...string)
- func SkipUnlessKubectlVersionGTE(v *utilversion.Version)
- func SkipUnlessLocalEphemeralStorageEnabled()
- func SkipUnlessMasterOSDistroIs(supportedMasterOsDistros ...string)
- func SkipUnlessMultizone(c clientset.Interface)
- func SkipUnlessNodeCountIsAtLeast(minNodeCount int)
- func SkipUnlessNodeCountIsAtMost(maxNodeCount int)
- func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string)
- func SkipUnlessPrometheusMonitoringIsEnabled(supportedMonitoring ...string)
- func SkipUnlessProviderIs(supportedProviders ...string)
- func SkipUnlessSSHKeyPresent()
- func SkipUnlessSecretExistsAfterWait(c clientset.Interface, name, namespace string, timeout time.Duration)
- func SkipUnlessServerVersionGTE(v *utilversion.Version, c discovery.ServerVersionInterface)
- func SkipUnlessTaintBasedEvictionsEnabled()
- func Skipf(format string, args ...interface{})
- func StartCPUProfileGatherer(componentName string, profileBaseName string, interval time.Duration) chan struct{}
- func StartCmdAndStreamOutput(cmd *exec.Cmd) (stdout, stderr io.ReadCloser, err error)
- func StartServeHostnameService(c clientset.Interface, internalClient internalclientset.Interface, ...) ([]string, string, error)
- func StartVolumeServer(client clientset.Interface, config VolumeTestConfig) *v1.Pod
- func StopServeHostnameService(clientset clientset.Interface, ns, name string) 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 TestUnderTemporaryNetworkFailure(c clientset.Interface, ns string, node *v1.Node, testFunc func())
- func TestVolumeClient(client clientset.Interface, config VolumeTestConfig, fsGroup *int64, ...)
- func TryKill(cmd *exec.Cmd)
- func UnblockNetwork(from string, to string)
- func UpdateDaemonSetWithRetries(c clientset.Interface, namespace, name string, applyUpdate updateDSFunc) (ds *apps.DaemonSet, err error)
- func UpdateDeploymentWithRetries(c clientset.Interface, namespace, name string, ...) (*apps.Deployment, error)
- func UpdateJob(c clientset.Interface, ns string, job *batch.Job) (*batch.Job, error)
- func UpdateJobFunc(c clientset.Interface, ns, name string, updateFn func(job *batch.Job))
- 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, ...) (*apps.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 VerifyLatencyWithinThreshold(threshold, actual LatencyMetric, metricName string) 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 VerifyServeHostnameServiceDown(c clientset.Interface, host string, serviceIP string, servicePort int) error
- func VerifyServeHostnameServiceUp(c clientset.Interface, ns, host string, expectedPods []string, ...) error
- func VerifyThatTaintIsGone(c clientset.Interface, nodeName string, taint *v1.Taint)
- func VolumeTestCleanup(f *Framework, config VolumeTestConfig)
- func WaitAndVerifyBinds(c clientset.Interface, ns string, pvols PVMap, claims PVCMap, ...) error
- func WaitForAllJobPodsGone(c clientset.Interface, ns, jobName string) error
- func WaitForAllJobPodsRunning(c clientset.Interface, ns, jobName string, parallelism int32) error
- 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 WaitForControlledPods(c clientset.Interface, ns, name string, kind schema.GroupKind) (pods *v1.PodList, err error)
- func WaitForControlledPodsRunning(c clientset.Interface, ns, name string, kind schema.GroupKind) error
- func WaitForControllerManagerUp() error
- func WaitForDaemonSets(c clientset.Interface, ns string, allowedNotReadyNodes int32, ...) error
- func WaitForDefaultServiceAccountInNamespace(c clientset.Interface, namespace string) error
- func WaitForDeploymentComplete(c clientset.Interface, d *apps.Deployment) error
- func WaitForDeploymentCompleteAndCheckRolling(c clientset.Interface, d *apps.Deployment) error
- func WaitForDeploymentOldRSsNum(c clientset.Interface, ns, deploymentName string, desiredRSNum int) error
- func WaitForDeploymentRevision(c clientset.Interface, d *apps.Deployment, targetRevision string) error
- func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName string, revision, image string) error
- func WaitForDeploymentRollbackCleared(c clientset.Interface, ns, deploymentName string) error
- func WaitForDeploymentUpdatedReplicasGTE(c clientset.Interface, ns, deploymentName string, minUpdatedReplicas int32, ...) 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 WaitForGroupSize(group string, size int32) error
- func WaitForJobComplete(c clientset.Interface, ns, jobName string, completions int32) error
- func WaitForJobDeleting(c clientset.Interface, ns, jobName string) error
- func WaitForJobFailure(c clientset.Interface, ns, jobName string, timeout time.Duration, ...) error
- func WaitForJobFinish(c clientset.Interface, ns, jobName string) error
- func WaitForJobGone(c clientset.Interface, ns, jobName string, timeout time.Duration) error
- func WaitForKubeletUp(host 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 WaitForNamedAuthorizationUpdate(c v1beta1authorization.SubjectAccessReviewsGetter, ...) error
- func WaitForNamespacesDeleted(c clientset.Interface, namespaces []string, timeout time.Duration) error
- func WaitForNodeHasTaintOrNot(c clientset.Interface, nodeName string, taint *v1.Taint, wantTrue bool, ...) 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 WaitForPVClaimBoundPhase(client clientset.Interface, pvclaims []*v1.PersistentVolumeClaim, ...) ([]*v1.PersistentVolume, error)
- func WaitForPartialEvents(c clientset.Interface, ns string, objOrRef runtime.Object, ...) error
- func WaitForPersistentVolumeClaimDeleted(c clientset.Interface, ns string, pvcName string, Poll, timeout time.Duration) error
- func WaitForPersistentVolumeClaimPhase(phase v1.PersistentVolumeClaimPhase, c clientset.Interface, ns string, ...) error
- func WaitForPersistentVolumeClaimsPhase(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 WaitForPodNameUnschedulableInNamespace(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, allowedNotReadyPods int32, ...) 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 WaitForReadyNodes(c clientset.Interface, size int, timeout time.Duration) error
- func WaitForReadyReplicaSet(c clientset.Interface, ns, name string) error
- func WaitForReplicaSetDesiredReplicas(rsClient appsclient.ReplicaSetsGetter, replicaSet *apps.ReplicaSet) error
- func WaitForReplicaSetTargetAvailableReplicas(c clientset.Interface, replicaSet *apps.ReplicaSet, targetReplicaNum int32) error
- func WaitForReplicaSetTargetSpecReplicas(c clientset.Interface, replicaSet *apps.ReplicaSet, targetReplicaNum int32) error
- func WaitForReplicationController(c clientset.Interface, namespace, name string, exist bool, ...) error
- func WaitForReplicationControllerwithSelector(c clientset.Interface, namespace string, selector labels.Selector, 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 WaitForServiceWithSelector(c clientset.Interface, namespace string, selector labels.Selector, exist bool, ...) error
- func WaitForStableCluster(c clientset.Interface, masterNodes sets.String) int
- func WaitForStatefulSetReplicasReady(statefulSetName, ns string, c clientset.Interface, Poll, timeout time.Duration) error
- func WaitOnPVandPVC(c clientset.Interface, ns string, pv *v1.PersistentVolume, ...) error
- func WaitTimeoutForPodEvent(c clientset.Interface, podName, namespace, eventSelector, msg string, ...) error
- func WaitTimeoutForPodNoLongerRunningInNamespace(c clientset.Interface, podName, namespace string, timeout time.Duration) error
- func WaitTimeoutForPodRunningInNamespace(c clientset.Interface, podName, namespace string, timeout time.Duration) error
- func WatchRecreateDeployment(c clientset.Interface, d *apps.Deployment) error
- type APICall
- type APIResponsiveness
- type Address
- type CleanupActionHandle
- type ClientConfigGetter
- type CloudConfig
- type ClusterVerification
- type ContainerFailures
- type ContainerResourceGatherer
- type ContainerResourceUsage
- type ContainersCPUSummary
- type CreateTestingNSFn
- type E2ETestNodePreparer
- type EtcdMetrics
- type EtcdMetricsCollector
- type EventsLister
- type ExecOptions
- type Factory
- type FlakeReport
- type Framework
- func (f *Framework) AddNamespacesToDelete(namespaces ...*v1.Namespace)
- func (f *Framework) AfterEach()
- func (f *Framework) BeforeEach()
- func (f *Framework) CheckFileSizeViaContainer(podName, containerName, path string) (string, error)
- func (f *Framework) CreateFromManifests(patch func(item interface{}) error, files ...string) (func(), error)
- func (f *Framework) CreateItems(items ...interface{}) (func(), 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) LoadFromManifests(files ...string) ([]interface{}, 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) NewTestPod(name string, requests v1.ResourceList, limits v1.ResourceList) *v1.Pod
- func (f *Framework) PatchItems(items ...interface{}) error
- func (f *Framework) PatchName(item *string)
- func (f *Framework) PatchNamespace(item *string)
- 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) RecordFlakeIfError(err error, optionalDescription ...interface{})
- 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) WaitForPodNoLongerRunning(podName string) error
- func (f *Framework) WaitForPodNotFound(podName string, timeout time.Duration) 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 HTTPPokeParams
- type HTTPPokeResult
- type HTTPPokeStatus
- type Histogram
- type HistogramVec
- type InvariantFunc
- type ItemFactory
- type KubeCluster
- type KubeConfig
- type KubeUser
- type KubeletLatencyMetric
- type KubeletLatencyMetrics
- func GetDefaultKubeletLatencyMetrics(ms metrics.KubeletMetrics) KubeletLatencyMetrics
- func GetKubeletLatencyMetrics(ms metrics.KubeletMetrics, filterMetricNames sets.String) KubeletLatencyMetrics
- func HighLatencyKubeletOperations(c clientset.Interface, threshold time.Duration, nodeName string, ...) (KubeletLatencyMetrics, error)
- 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) GetEndpointsFromContainer(protocol, containerIP, targetIP string, ...) (sets.String, error)
- func (config *NetworkingTestConfig) GetEndpointsFromTestContainer(protocol, targetIP string, targetPort, tries int) (sets.String, error)
- func (config *NetworkingTestConfig) GetSelfURL(port int32, path string, expected string)
- func (config *NetworkingTestConfig) GetSelfURLStatusCode(port int32, path string, expected string)
- type NodeKiller
- type NodeKillerConfig
- type NodeRuntimeOperationErrorRate
- type NodeTestContextType
- type NodesCPUSummary
- type NodesSet
- type NullProvider
- func (n NullProvider) CleanupServiceResources(c clientset.Interface, loadBalancerName, region, zone string)
- func (n NullProvider) CreatePD(zone string) (string, error)
- func (n NullProvider) CreatePVSource(zone, diskName string) (*v1.PersistentVolumeSource, error)
- func (n NullProvider) DeleteNode(node *v1.Node) error
- func (n NullProvider) DeletePD(pdName string) error
- func (n NullProvider) DeletePVSource(pvSource *v1.PersistentVolumeSource) error
- func (n NullProvider) EnableAndDisableInternalLB() (enable, disable func(svc *v1.Service))
- func (n NullProvider) EnsureLoadBalancerResourcesDeleted(ip, portRange string) error
- func (n NullProvider) FrameworkAfterEach(f *Framework)
- func (n NullProvider) FrameworkBeforeEach(f *Framework)
- func (n NullProvider) GetGroupNodes(group string) ([]string, error)
- func (n NullProvider) GroupSize(group string) (int, error)
- func (n NullProvider) LoadBalancerSrcRanges() []string
- func (n NullProvider) ResizeGroup(string, int32) error
- type PVCMap
- type PVMap
- type PersistentVolumeClaimConfig
- type PersistentVolumeConfig
- type PingCommand
- type PodClient
- func (c *PodClient) Create(pod *v1.Pod) *v1.Pod
- func (c *PodClient) CreateBatch(pods []*v1.Pod) []*v1.Pod
- func (c *PodClient) CreateEventually(pod *v1.Pod, opts ...interface{}) *v1.Pod
- func (c *PodClient) CreateSync(pod *v1.Pod) *v1.Pod
- func (c *PodClient) CreateSyncInNamespace(pod *v1.Pod, namespace string) *v1.Pod
- func (c *PodClient) DeleteSync(name string, options *metav1.DeleteOptions, timeout time.Duration)
- func (c *PodClient) DeleteSyncInNamespace(name string, namespace string, options *metav1.DeleteOptions, ...)
- func (c *PodClient) MatchContainerOutput(name string, containerName string, expectedRegexp string) error
- func (c *PodClient) PodIsReady(name string) bool
- func (c *PodClient) Update(name string, updateFn func(pod *v1.Pod))
- func (c *PodClient) WaitForErrorEventOrSuccess(pod *v1.Pod) (*v1.Event, error)
- func (c *PodClient) WaitForFailure(name string, timeout time.Duration)
- func (c *PodClient) WaitForSuccess(name string, timeout time.Duration)
- type PodLatencyData
- type PodNode
- type PodStartupLatency
- type PodStateVerification
- type PortsByPodName
- type PortsByPodUID
- type ProviderInterface
- 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 SchedulingMetrics
- 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) AddRCAntiAffinity(rc *v1.ReplicationController)
- 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) CreateExternalNameServiceOrFail(namespace string, tweak func(svc *v1.Service)) *v1.Service
- func (j *ServiceTestJig) CreateLoadBalancerService(namespace, serviceName string, timeout time.Duration, ...) *v1.Service
- 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) CreatePDBOrFail(namespace string, rc *v1.ReplicationController) *policyv1beta1.PodDisruptionBudget
- func (j *ServiceTestJig) CreateServiceWithServicePort(labels map[string]string, namespace string, ports []v1.ServicePort) (*v1.Service, error)
- 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) Scale(namespace string, replicas int)
- func (j *ServiceTestJig) TestHTTPHealthCheckNodePort(host string, port int, request string, timeout time.Duration, ...) error
- 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) TestReachableHTTPWithRetriableErrorCodes(host string, port int, retriableErrCodes []int, timeout time.Duration)
- func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestRejectedHTTP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestRejectedUDP(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
- func (j *ServiceTestJig) WaitForNewIngressIPOrFail(namespace, name, existingIP string, timeout time.Duration) *v1.Service
- type SingleContainerSummary
- type SingleLogSummary
- type StatefulSetTester
- func (s *StatefulSetTester) BreakHttpProbe(ss *apps.StatefulSet) error
- func (s *StatefulSetTester) BreakPodHttpProbe(ss *apps.StatefulSet, pod *v1.Pod) error
- func (s *StatefulSetTester) CheckHostname(ss *apps.StatefulSet) error
- func (s *StatefulSetTester) CheckMount(ss *apps.StatefulSet, mountPath string) error
- func (p *StatefulSetTester) CheckServiceName(ss *apps.StatefulSet, expectedServiceName string) error
- func (s *StatefulSetTester) ConfirmStatefulPodCount(count int, ss *apps.StatefulSet, timeout time.Duration, hard bool)
- func (s *StatefulSetTester) CreateStatefulSet(manifestPath, ns string) *apps.StatefulSet
- func (s *StatefulSetTester) DeleteStatefulPodAtIndex(index int, ss *apps.StatefulSet)
- func (s *StatefulSetTester) ExecInStatefulPods(ss *apps.StatefulSet, cmd string) error
- func (s *StatefulSetTester) GetPodList(ss *apps.StatefulSet) *v1.PodList
- func (s *StatefulSetTester) GetStatefulSet(namespace, name string) *apps.StatefulSet
- func (s *StatefulSetTester) PauseNewPods(ss *apps.StatefulSet)
- func (s *StatefulSetTester) Restart(ss *apps.StatefulSet)
- func (s *StatefulSetTester) RestoreHttpProbe(ss *apps.StatefulSet) error
- func (s *StatefulSetTester) RestorePodHttpProbe(ss *apps.StatefulSet, pod *v1.Pod) error
- func (s *StatefulSetTester) ResumeNextPod(ss *apps.StatefulSet)
- func (s *StatefulSetTester) Saturate(ss *apps.StatefulSet)
- func (s *StatefulSetTester) Scale(ss *apps.StatefulSet, count int32) (*apps.StatefulSet, error)
- func (s *StatefulSetTester) SetHttpProbe(ss *apps.StatefulSet)
- func (s *StatefulSetTester) SortStatefulPods(pods *v1.PodList)
- func (s *StatefulSetTester) UpdateReplicas(ss *apps.StatefulSet, count int32)
- func (s *StatefulSetTester) VerifyPodAtIndex(index int, ss *apps.StatefulSet, verify VerifyStatefulPodFunc)
- func (s *StatefulSetTester) WaitForPartitionedRollingUpdate(set *apps.StatefulSet) (*apps.StatefulSet, *v1.PodList)
- func (s *StatefulSetTester) WaitForPodNotReady(set *apps.StatefulSet, podName string) (*apps.StatefulSet, *v1.PodList)
- func (s *StatefulSetTester) WaitForPodReady(set *apps.StatefulSet, podName string) (*apps.StatefulSet, *v1.PodList)
- func (s *StatefulSetTester) WaitForRollingUpdate(set *apps.StatefulSet) (*apps.StatefulSet, *v1.PodList)
- func (s *StatefulSetTester) WaitForRunning(numPodsRunning, numPodsReady int32, ss *apps.StatefulSet)
- func (s *StatefulSetTester) WaitForRunningAndNotReady(numStatefulPods int32, ss *apps.StatefulSet)
- func (s *StatefulSetTester) WaitForRunningAndReady(numStatefulPods int32, ss *apps.StatefulSet)
- func (s *StatefulSetTester) WaitForState(ss *apps.StatefulSet, until func(*apps.StatefulSet, *v1.PodList) (bool, error))
- func (s *StatefulSetTester) WaitForStatus(set *apps.StatefulSet) *apps.StatefulSet
- func (s *StatefulSetTester) WaitForStatusReadyReplicas(ss *apps.StatefulSet, expectedReplicas int32)
- func (s *StatefulSetTester) WaitForStatusReplicas(ss *apps.StatefulSet, expectedReplicas int32)
- type TestContextType
- type TestDataSummary
- type TimestampedSize
- type UDPPokeParams
- type UDPPokeResult
- type UDPPokeStatus
- type VerifyStatefulPodFunc
- type VolumeTest
- type VolumeTestConfig
- func NewGlusterfsServer(cs clientset.Interface, namespace string) (config VolumeTestConfig, pod *v1.Pod, ip string)
- func NewISCSIServer(cs clientset.Interface, namespace string) (config VolumeTestConfig, pod *v1.Pod, ip string)
- func NewNFSServer(cs clientset.Interface, namespace string, args []string) (config VolumeTestConfig, pod *v1.Pod, ip string)
- func NewRBDServer(cs clientset.Interface, namespace string) (config VolumeTestConfig, pod *v1.Pod, secret *v1.Secret, ip string)
- type What
- type WorkItem
Constants ¶
const ( // GPUResourceName is the extended name of the GPU resource since v1.8 // this uses the device plugin mechanism NVIDIAGPUResourceName = "nvidia.com/gpu" // TODO: Parametrize it by making it a feature in TestFramework. // so we can override the daemonset in other setups (non COS). // GPUDevicePluginDSYAML is the official Google Device Plugin Daemonset NVIDIA GPU manifest for GKE GPUDevicePluginDSYAML = "https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/device-plugins/nvidia-gpu/daemonset.yaml" )
const ( // How long to wait for a job to finish. JobTimeout = 15 * time.Minute // Job selector name JobSelectorKey = "job" )
const ( EndpointHttpPort = 8080 EndpointUdpPort = 8081 TestContainerHttpPort = 8080 ClusterHttpPort = 80 ClusterUdpPort = 90 // Number of checks to hit a given set of endpoints when enable session affinity. SessionAffinityChecks = 10 )
const ( PDRetryTimeout = 5 * time.Minute PDRetryPollTime = 5 * time.Second VolumeSelectorKey = "e2e-pv-pool" )
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 // KubeProxyEndpointLagTimeout is the maximum time a kube-proxy daemon on a node is allowed // to not notice an Endpoint update. KubeProxyEndpointLagTimeout = 30 * time.Second // 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 // GCPMaxInstancesInInstanceGroup is the maximum number of instances supported in // one instance group on GCP. GCPMaxInstancesInInstanceGroup = 2000 // AffinityConfirmCount is the number of needed continuous requests to confirm that // affinity is enabled. AffinityConfirmCount = 15 )
const ( // Poll interval for StatefulSet tests StatefulSetPoll = 10 * time.Second // Timeout interval for StatefulSet operations StatefulSetTimeout = 10 * time.Minute // Timeout for stateful pods to change state StatefulPodTimeout = 5 * time.Minute )
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 // Same as `PodStartTimeout` to wait for the pod to be started, but shorter. // Use it case by case when we are sure pod start will not be delayed // minutes by slow docker pulls or something else. PodStartShortTimeout = 2 * time.Minute // How long to wait for a pod to be deleted PodDeleteTimeout = 5 * time.Minute // PodEventTimeout is how much we wait for a pod event to occur. PodEventTimeout = 2 * 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 = 3 * 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 // Same as `ClaimProvisionTimeout` to wait for claim to be dynamically provisioned, but shorter. // Use it case by case when we are sure this timeout is enough. ClaimProvisionShortTimeout = 1 * time.Minute // How long claims have to become bound ClaimBindingTimeout = 3 * time.Minute // How long claims have to become deleted ClaimDeletingTimeout = 3 * time.Minute // How long PVs have to beome reclaimed PVReclaimingTimeout = 3 * time.Minute // How long PVs have to become bound PVBindingTimeout = 3 * time.Minute // How long PVs have to become deleted PVDeletingTimeout = 3 * time.Minute // 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 // How long for snapshot to create snapshotContent SnapshotCreateTimeout = 5 * time.Minute )
const ( Kb int64 = 1000 Mb int64 = 1000 * Kb Gb int64 = 1000 * Mb Tb int64 = 1000 * Gb KiB int64 = 1024 MiB int64 = 1024 * KiB GiB int64 = 1024 * MiB TiB int64 = 1024 * GiB // Waiting period for volume server (Ceph, ...) to initialize itself. VolumeServerPodStartupTimeout = 3 * time.Minute // Waiting period for pod to be cleaned up and unmount its volumes so we // don't tear down containers with NFS/Ceph/Gluster server too early. PodCleanupTimeout = 20 * time.Second )
const CurrentKubeletPerfMetricsVersion = "v2"
CurrentKubeletPerfMetricsVersion is the current kubelet performance metrics version. This is used by mutiple perf related data structures. We should bump up the version each time we make an incompatible change to the metrics.
const (
// Default value for how long the CPU profile is gathered for.
DefaultCPUProfileSeconds = 30
)
const ( // TODO(mikedanese): reset this to 5 minutes once #47135 is resolved. // ref https://github.com/kubernetes/kubernetes/issues/47135 DefaultNamespaceDeletionTimeout = 10 * time.Minute )
const (
// DefaultNumNodes is the number of nodes. If not specified, then number of nodes is auto-detected
DefaultNumNodes = -1
)
const DefaultPodDeletionTimeout = 3 * time.Minute
const NoCPUConstraint = math.MaxFloat64
const ( // NodeStartupThreshold is a rough estimate of the time allocated for a pod to start on a node. NodeStartupThreshold = 4 * time.Second )
Variables ¶
var ( BusyBoxImage = imageutils.GetE2EImage(imageutils.BusyBox) // Serve hostname image name ServeHostnameImage = imageutils.GetE2EImage(imageutils.ServeHostname) )
var Factories = map[What]ItemFactory{
{"ClusterRole"}: &clusterRoleFactory{},
{"ClusterRoleBinding"}: &clusterRoleBindingFactory{},
{"DaemonSet"}: &daemonSetFactory{},
{"Role"}: &roleFactory{},
{"RoleBinding"}: &roleBindingFactory{},
{"Secret"}: &secretFactory{},
{"Service"}: &serviceFactory{},
{"ServiceAccount"}: &serviceAccountFactory{},
{"StatefulSet"}: &statefulSetFactory{},
{"StorageClass"}: &storageClassFactory{},
}
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_total",
"apiserver_request_latencies_summary",
"apiserver_init_events_total",
}
var InterestingClusterAutoscalerMetrics = []string{
"function_duration_seconds",
"errors_total",
"evicted_pods_total",
}
var InterestingControllerManagerMetrics = []string{
"garbage_collector_attempt_to_delete_queue_latency",
"garbage_collector_attempt_to_delete_work_duration",
"garbage_collector_attempt_to_orphan_queue_latency",
"garbage_collector_attempt_to_orphan_work_duration",
"garbage_collector_dirty_processing_latency_microseconds",
"garbage_collector_event_processing_latency_microseconds",
"garbage_collector_graph_changes_queue_latency",
"garbage_collector_graph_changes_work_duration",
"garbage_collector_orphan_processing_latency_microseconds",
"namespace_queue_latency",
"namespace_queue_latency_sum",
"namespace_queue_latency_count",
"namespace_retries",
"namespace_work_duration",
"namespace_work_duration_sum",
"namespace_work_duration_count",
}
var InterestingKubeletMetrics = []string{
"kubelet_container_manager_latency_microseconds",
"kubelet_docker_errors",
"kubelet_docker_operations_duration_seconds",
"kubelet_generate_pod_status_latency_microseconds",
"kubelet_pod_start_duration_seconds",
"kubelet_pod_worker_duration_seconds",
"kubelet_pod_worker_start_duration_seconds",
"kubelet_sync_pods_latency_microseconds",
}
var ItemNotSupported = errors.New("not supported")
ItemNotSupported is the error that Create methods must return or wrap when they don't support the given item.
var NetexecImageName = imageutils.GetE2EImage(imageutils.Netexec)
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 ( // Common selinux labels SELinuxLabel = &v1.SELinuxOptions{ Level: "s0:c0,c1"} )
var SchedulingLatencyMetricName = model.LabelValue(schedulermetric.SchedulerSubsystem + "_" + schedulermetric.SchedulingLatencyName)
var ServiceNodePortRange = utilnet.PortRange{Base: 30000, Size: 2768}
This should match whatever the default/configured range is
Functions ¶
func AddOrUpdateAvoidPodOnNode ¶
AddOrUpdateAvoidPodOnNode adds avoidPods annotations to node, will override if it exists
func AddOrUpdateLabelOnNode ¶
func AddOrUpdateTaintOnNode ¶
func AfterReadingAllFlags ¶
func AfterReadingAllFlags(t *TestContextType)
AfterReadingAllFlags makes changes to the context after all flags have been read.
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 ¶
func BindClusterRole(c v1beta1rbac.ClusterRoleBindingsGetter, clusterRole, ns string, subjects ...rbacv1beta1.Subject)
BindClusterRole binds the cluster role at the cluster scope
func BindClusterRoleInNamespace ¶
func BindClusterRoleInNamespace(c v1beta1rbac.RoleBindingsGetter, clusterRole, ns string, subjects ...rbacv1beta1.Subject)
BindClusterRoleInNamespace binds the cluster role at the namespace scope
func BindRoleInNamespace ¶
func BindRoleInNamespace(c v1beta1rbac.RoleBindingsGetter, role, ns string, subjects ...rbacv1beta1.Subject)
BindRoleInNamespace binds the 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 ¶
func CPUUsageToPerfDataWithLabels(usagePerNode NodesCPUSummary, labels map[string]string) *perftype.PerfData
CPUUsageToPerfDataWithLabels transforms NodesCPUSummary to PerfData with additional labels.
func CheckAffinity ¶
func CheckAffinity(jig *ServiceTestJig, execPod *v1.Pod, targetIp string, targetPort int, shouldHold bool) bool
CheckAffinity function tests whether the service affinity works as expected. If affinity is expected, the test will return true once affinityConfirmCount number of same response observed in a row. If affinity is not expected, the test will keep observe until different responses observed. The function will return false only in case of unexpected errors.
func CheckConnectivityToHost ¶
func CheckConnectivityToHost(f *Framework, nodeName, podName, host string, pingCmd PingCommand, timeout int) error
CheckConnectivityToHost launches a pod to test connectivity to the specified host. An error will be returned if the host is not reachable from the pod.
An empty nodeName will use the schedule to choose where the pod is executed.
func CheckDeploymentRevisionAndImage ¶
func CheckDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName, revision, image string) error
CheckDeploymentRevisionAndImage checks if the input deployment's and its new replica set's revision and image are as expected.
func CheckForAllJobPodsRunning ¶
func CheckForAllJobPodsRunning(c clientset.Interface, ns, jobName string, parallelism int32) (bool, error)
CheckForAllJobPodsRunning uses c to check in the Job named jobName in ns is running. If the returned error is not nil the returned bool is true if the Job is running.
func CheckForControllerManagerHealthy ¶
CheckForControllerManagerHealthy checks that the controller manager does not crash within "duration"
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 timeout for cluster to has desired size and there is no not-ready nodes in it. By cluster size we mean number of Nodes excluding Master Node.
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 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 CleanUpVolumeServer ¶
Wrapper of cleanup function for volume server without secret created by specific CreateStorageServer function.
func CleanUpVolumeServerWithSecret ¶
Wrapper of cleanup function for volume server with secret created by specific CreateStorageServer function.
func Cleanup ¶
Stops everything from filePath from namespace ns and checks if everything matching selectors from the given namespace is correctly stopped.
func CleanupServiceResources ¶
func ClusterMonitoringModeIs ¶
func CollectAddresses ¶
func CollectAddresses(nodes *v1.NodeList, addressType v1.NodeAddressType) []string
func ConformanceIt ¶
Wrapper function for ginkgo It. Adds "[Conformance]" tag and makes static analysis easier.
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/log-dump.sh to accomplish this.
func CreateClientPod ¶
func CreateClientPod(c clientset.Interface, ns string, pvc *v1.PersistentVolumeClaim) (*v1.Pod, error)
Define and create a pod with a mounted PV. Pod runs infinite loop until killed.
func CreateDeployment ¶
func CreateEmptyFileOnPod ¶
create empty file at given path on the pod.
func CreateExecPodOrFail ¶
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 CreateGCEVolume ¶
func CreateGCEVolume() (*v1.PersistentVolumeSource, string)
func CreateJob ¶
CreateJob uses c to create job in namespace ns. If the returned error is nil, the returned Job is valid and has been created.
func CreateNginxPod ¶
func CreatePDWithRetry ¶
func CreatePV ¶
func CreatePV(c clientset.Interface, pv *v1.PersistentVolume) (*v1.PersistentVolume, error)
create the PV resource. Fails test on error.
func CreatePVC ¶
func CreatePVC(c clientset.Interface, ns string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
create the PVC resource. Fails test on error.
func CreatePVCPV ¶
func CreatePVCPV(c clientset.Interface, pvConfig PersistentVolumeConfig, pvcConfig PersistentVolumeClaimConfig, ns string, preBind bool) (*v1.PersistentVolume, *v1.PersistentVolumeClaim, error)
Create a PVC followed by the PV based on the passed in nfs-server ip and namespace. If the "preBind" bool is true then pre-bind the PV to the PVC via the PV's ClaimRef. Return the pv and pvc to reflect the created objects. Note: in the pre-bind case the real PVC name, which is generated, is not
known until after the PVC is instantiated. This is why the pvc is created before the pv.
func CreatePVPVC ¶
func CreatePVPVC(c clientset.Interface, pvConfig PersistentVolumeConfig, pvcConfig PersistentVolumeClaimConfig, ns string, preBind bool) (*v1.PersistentVolume, *v1.PersistentVolumeClaim, error)
Create a PV followed by the PVC based on the passed in nfs-server ip and namespace. If the "preBind" bool is true then pre-bind the PVC to the PV via the PVC's VolumeName. Return the pv and pvc to reflect the created objects. Note: in the pre-bind case the real PV name, which is generated, is not
known until after the PV is instantiated. This is why the pv is created before the pvc.
func CreatePVSource ¶
func CreatePVSource(zone string) (*v1.PersistentVolumeSource, error)
func CreatePVsPVCs ¶
func CreatePVsPVCs(numpvs, numpvcs int, c clientset.Interface, ns string, pvConfig PersistentVolumeConfig, pvcConfig PersistentVolumeClaimConfig) (PVMap, PVCMap, error)
Create the desired number of PVs and PVCs and return them in separate maps. If the number of PVs != the number of PVCs then the min of those two counts is the number of PVs expected to bind. If a Create error occurs, the returned maps may contain pv and pvc entries for the resources that were successfully created. In other words, when the caller sees an error returned, it needs to decide what to do about entries in the maps. Note: when the test suite deletes the namespace orphaned pvcs and pods are deleted. However,
orphaned pvs are not deleted and will remain after the suite completes.
func CreatePod ¶
func CreatePod(client clientset.Interface, namespace string, nodeSelector map[string]string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string) (*v1.Pod, error)
CreatePod with given claims based on node selector
func CreatePodOrFail ¶
func CreateSecPod ¶
func CreateSecPod(client clientset.Interface, namespace string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string, hostIPC bool, hostPID bool, seLinuxLabel *v1.SELinuxOptions, fsGroup *int64, timeout time.Duration) (*v1.Pod, error)
create security pod with given claims
func CreateSecPodWithNodeName ¶
func CreateSecPodWithNodeName(client clientset.Interface, namespace string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string, hostIPC bool, hostPID bool, seLinuxLabel *v1.SELinuxOptions, fsGroup *int64, nodeName string, timeout time.Duration) (*v1.Pod, error)
create security pod with given claims
func CreateServiceSpec ¶
func CreateStatefulSetService ¶
CreateStatefulSetService creates a Headless Service with Name name and Selector set to match labels.
func CreateStorageServer ¶
Wrapper for StartVolumeServer(). A storage server config is passed in, and a pod pointer and ip address string are returned. Note: Expect() is called so no error is returned.
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 CreateUnschedulablePod ¶
func CreateUnschedulablePod(client clientset.Interface, namespace string, nodeSelector map[string]string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string) (*v1.Pod, error)
CreateUnschedulablePod with given claims based on node selector
func CreateWaitAndDeletePod ¶
func CreateWaitAndDeletePod(f *Framework, c clientset.Interface, ns string, pvc *v1.PersistentVolumeClaim) (err error)
Create the test pod, wait for (hopefully) success, and then delete the pod. Note: need named return value so that the err assignment in the defer sets the returned error.
Has been shown to be necessary using Go 1.7.
func DeleteAllStatefulSets ¶
DeleteAllStatefulSets deletes all StatefulSet API Objects in Namespace ns.
func DeleteJob ¶
DeleteJob uses c to delete the Job named name in namespace ns. If the returned error is nil, the Job has been deleted.
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 DeletePDWithRetry ¶
func DeletePVCandValidatePV ¶
func DeletePVCandValidatePV(c clientset.Interface, ns string, pvc *v1.PersistentVolumeClaim, pv *v1.PersistentVolume, expectPVPhase v1.PersistentVolumePhase) error
Delete the PVC and wait for the PV to enter its expected phase. Validate that the PV has been reclaimed (assumption here about reclaimPolicy). Caller tells this func which phase value to expect for the pv bound to the to-be-deleted claim.
func DeletePVCandValidatePVGroup ¶
func DeletePVCandValidatePVGroup(c clientset.Interface, ns string, pvols PVMap, claims PVCMap, expectPVPhase v1.PersistentVolumePhase) error
Wraps deletePVCandValidatePV() by calling the function in a loop over the PV map. Only bound PVs are deleted. Validates that the claim was deleted and the PV is in the expected Phase (Released, Available, Bound). Note: if there are more claims than pvs then some of the remaining claims may bind to just made
available pvs.
func DeletePVSource ¶
func DeletePVSource(pvSource *v1.PersistentVolumeSource) error
func DeletePersistentVolume ¶
Delete the PV.
func DeletePersistentVolumeClaim ¶
Delete the Claim
func DeletePodOrFail ¶
func DeletePodWithWait ¶
Deletes the passed-in pod and waits for the pod to be terminated. Resilient to the pod not existing.
func DeletePodWithWaitByName ¶
func DeletePodWithWaitByName(f *Framework, c clientset.Interface, podName, podNamespace string) error
Deletes the named and namespaced pod and waits for the pod to be terminated. Resilient to the pod not existing.
func DeleteRCAndWaitForGC ¶
DeleteRCAndWaitForGC deletes only the Replication Controller and waits for GC to delete the pods.
func DeleteResourceAndWaitForGC ¶
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 ¶
func DescribeIng(ns string)
func DescribeItem ¶
func DescribeItem(item interface{}) string
DescribeItem always returns a string that describes the item, usually by calling out to cache.MetaNamespaceKeyFunc which concatenates namespace (if set) and name. If that fails, the entire item gets converted to a string.
func DescribeSvc ¶
func DescribeSvc(ns string)
func DsFromManifest ¶
DsFromManifest reads a .json/yaml file and returns the daemonset in it.
func DumpAllNamespaceInfo ¶
func DumpDebugInfo ¶
func DumpEventsInNamespace ¶
func DumpEventsInNamespace(eventsLister EventsLister, namespace string)
func DumpNodeDebugInfo ¶
func EnableAndDisableInternalLB ¶
EnableAndDisableInternalLB returns two functions for enabling and disabling the internal load balancer setting for the supported cloud providers (currently GCE/GKE and Azure) and empty functions for others.
func EnsureLoadBalancerResourcesDeleted ¶
EnsureLoadBalancerResourcesDeleted ensures that cloud load balancer resources that were created are actually cleaned up. Currently only implemented for GCE/GKE.
func EtcdUpgrade ¶
func ExpectNoError ¶
func ExpectNoError(err error, explain ...interface{})
func ExpectNoErrorWithOffset ¶
ExpectNoErrorWithOffset checks if "err" is set, and if so, fails assertion while logging the error at "offset" levels above its caller (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for "f").
func ExpectNodeHasLabel ¶
func ExpectNodeHasTaint ¶
func FailfWithOffset ¶
FailfWithOffset calls "Fail" and logs the error at "offset" levels above its caller (for example, for call chain f -> g -> FailfWithOffset(1, ...) error would be logged for "f").
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 GatherCPUProfile ¶
func GatherMemoryProfile ¶
func GenerateMasterRegexp ¶
func GeneratePodSecurityContext ¶
func GeneratePodSecurityContext(fsGroup *int64, seLinuxOptions *v1.SELinuxOptions) *v1.PodSecurityContext
GeneratePodSecurityContext generates the corresponding pod security context with the given inputs If the Node OS is windows, currently we will ignore the inputs and return nil. TODO: Will modify it after windows has its own security context
func GenerateReadFileCmd ¶
GenerateReadFileCmd generates the corresponding command lines to read from a file with the given file path. Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
func GenerateScriptCmd ¶
GenerateScriptCmd generates the corresponding command lines to execute a command. Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
func GenerateSecurityContext ¶
func GenerateSecurityContext(privileged bool) *v1.SecurityContext
GenerateSecurityContext generates the corresponding container security context with the given inputs If the Node OS is windows, currently we will ignore the inputs and return nil. TODO: Will modify it after windows has its own security context
func GenerateWriteFileCmd ¶
GenerateWriteFileCmd generates the corresponding command lines to write a file with the given content and file path. Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
func GenerateWriteandExecuteScriptFileCmd ¶
GenerateWriteandExecuteScriptFileCmd generates the corresponding command lines to write a file with the given file path and also execute this file. Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
func GetAllMasterAddresses ¶
GetAllMasterAddresses returns all IP addresses on which the kubelet can reach the master. It may return internal and external IPs, even if we expect for e.g. internal IPs to be used (issue #56787), so that we can be sure to block the master fully during tests.
func GetFileModeRegex ¶
GetFileModeRegex returns a file mode related regex which should be matched by the mounttest pods' output. If the given mask is nil, then the regex will contain the default OS file modes, which are 0644 for Linux and 0775 for Windows.
func GetGPUDevicePluginImage ¶
func GetGPUDevicePluginImage() string
func GetGroupNodes ¶
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 ¶
func GetIngressPoint(ing *v1.LoadBalancerIngress) string
func GetJob ¶
GetJob uses c to get the Job in namespace ns named name. If the returned error is nil, the returned Job is valid.
func GetJobPods ¶
GetJobPods returns a list of Pods belonging to a Job.
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 ¶
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 GetLogToFileFunc ¶
GetLogToFileFunc is a convenience function that returns a function that have the same interface as Logf, but writes to a specified file.
func GetMasterAndWorkerNodesOrDie ¶
GetMasterAndWorkerNodesOrDie will return a list masters and schedulable worker nodes
func GetMasterHost ¶
func GetMasterHost() string
func GetNodeAddresses ¶
func GetNodeAddresses(node *v1.Node, addressType v1.NodeAddressType) (ips []string)
func GetNodeExternalIP ¶
GetNodeExternalIP returns node external IP concatenated with port 22 for ssh e.g. 1.2.3.4:22
func GetNodeInternalIP ¶
GetNodeInternalIP returns node internal IP
func GetNodePortURL ¶
GetNodePortURL returns the url to a nodeport Service.
func GetPodLogs ¶
TODO(random-liu): Change this to be a member function of the framework.
func GetPodsForDeployment ¶
func GetPodsForDeployment(client clientset.Interface, deployment *apps.Deployment) (*v1.PodList, error)
GetPodsForDeployment gets pods for the given deployment
func GetPodsInNamespace ¶
func GetPodsScheduled ¶
func GetPodsScheduled(masterNodes sets.String, pods *v1.PodList) (scheduledPods, notScheduledPods []v1.Pod)
GetPodsScheduled returns a number of currently scheduled and not scheduled Pods.
func GetProviders ¶
func GetProviders() []string
GetProviders returns the names of all currently registered providers.
func GetReadyNodesIncludingTaintedOrDie ¶
GetReadyNodesIncludingTaintedOrDie returns all ready nodes, even those which are tainted. There are cases when we care about tainted nodes E.g. in tests related to nodes with gpu we care about nodes despite presence of nvidia.com/gpu=present:NoSchedule taint
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 GetStatsSummary ¶
GetStatsSummary contacts kubelet for the container information.
func GetTestImage ¶
GetTestImage returns the image name with the given input If the Node OS is windows, currently we return Nettest image for Windows node due to the issue of #https://github.com/kubernetes-sigs/windows-testing/pull/35.
func IngressUpgrade ¶
func InjectHtml ¶
func InjectHtml(client clientset.Interface, config VolumeTestConfig, fsGroup *int64, volume v1.VolumeSource, content string)
InjectHtml insert index.html with given content into given volume. It does so by starting and auxiliary pod which writes the file there. The volume must be writable.
func IsNodeConditionUnset ¶
func IsNodeConditionUnset(node *v1.Node, conditionType v1.NodeConditionType) bool
func IsRBACEnabled ¶
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 LoadClientset ¶
func LoadConfig ¶
func LoadConfig() (*restclient.Config, error)
func LoadInternalClientset ¶
func LoadInternalClientset() (*internalclientset.Clientset, error)
func LogClusterImageSources ¶
func LogClusterImageSources()
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 MakeDeployment ¶
func MakeDeployment(replicas int32, podLabels map[string]string, nodeSelector map[string]string, namespace string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string) *apps.Deployment
MakeDeployment creates a deployment definition based on the namespace. The deployment references the PVC's name. A slice of BASH commands can be supplied as args to be run by the pod
func MakeNginxPod ¶
func MakeNginxPod(ns string, nodeSelector map[string]string, pvclaims []*v1.PersistentVolumeClaim) *v1.Pod
Returns a pod definition based on the namespace using nginx image
func MakePersistentVolume ¶
func MakePersistentVolume(pvConfig PersistentVolumeConfig) *v1.PersistentVolume
Returns a PV definition based on the nfs server IP. If the PVC is not nil then the PV is defined with a ClaimRef which includes the PVC's namespace. If the PVC is nil then the PV is not defined with a ClaimRef. If no reclaimPolicy is assigned, assumes "Retain". Specs are expected to match the test's PVC. Note: the passed-in claim does not have a name until it is created and thus the PV's
ClaimRef cannot be completely filled-in in this func. Therefore, the ClaimRef's name is added later in CreatePVCPV.
func MakePersistentVolumeClaim ¶
func MakePersistentVolumeClaim(cfg PersistentVolumeClaimConfig, ns string) *v1.PersistentVolumeClaim
Returns a PVC definition based on the namespace. Note: if this PVC is intended to be pre-bound to a PV, whose name is not
known until the PV is instantiated, then the func CreatePVPVC will add pvc.Spec.VolumeName to this claim.
func MakePod ¶
func MakePod(ns string, nodeSelector map[string]string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string) *v1.Pod
Returns a pod definition based on the namespace. The pod references the PVC's name. A slice of BASH commands can be supplied as args to be run by the pod
func MakeSecPod ¶
func MakeSecPod(ns string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string, hostIPC bool, hostPID bool, seLinuxLabel *v1.SELinuxOptions, fsGroup *int64) *v1.Pod
Returns a pod definition based on the namespace. The pod references the PVC's name. A slice of BASH commands can be supplied as args to be run by the pod. SELinux testing requires to pass HostIPC and HostPID as booleansi arguments.
func MakeWritePod ¶
func MakeWritePod(ns string, pvc *v1.PersistentVolumeClaim) *v1.Pod
Returns a pod definition based on the namespace. The pod references the PVC's name.
func MasterOSDistroIs ¶
func MasterUpgrade ¶
func MasterUpgradeGCEWithKubeProxyDaemonSet ¶
TODO(mrhohn): Remove this function when kube-proxy is run as a DaemonSet by default.
func MigTemplate ¶
MigTemplate (GCE-only) returns the name of the MIG template that the nodes of the cluster use.
func NVIDIADevicePlugin ¶
NVIDIADevicePlugin returns the official Google Device Plugin pod for NVIDIA GPU in GKE
func NewDeployment ¶
func NewDeployment(deploymentName string, replicas int32, podLabels map[string]string, imageName, image string, strategyType apps.DeploymentStrategyType) *apps.Deployment
func NewE2ETestNodePreparer ¶
func NewE2ETestNodePreparer(client clientset.Interface, countToStrategy []testutils.CountToStrategy) testutils.TestNodePreparer
func NewExecPodSpec ¶
NewExecPodSpec returns the pod spec of hostexec pod
func NewKubectlCommand ¶
func NewKubectlCommand(args ...string) *kubectlBuilder
func NewReplicaSet ¶
func NewStatefulSet ¶
func NewStatefulSet(name, ns, governingSvcName string, replicas int32, statefulPodMounts []v1.VolumeMount, podMounts []v1.VolumeMount, labels map[string]string) *apps.StatefulSet
NewStatefulSet creates a new NGINX StatefulSet for testing. The StatefulSet is named name, is in namespace ns, statefulPodsMounts are the mounts that will be backed by PVs. podsMounts are the mounts that are mounted directly to the Pod. labels are the labels that will be usd for the StatefulSet selector.
func NewStatefulSetPVC ¶
func NewStatefulSetPVC(name string) v1.PersistentVolumeClaim
NewStatefulSetPVC returns a PersistentVolumeClaim named name, for testing StatefulSets.
func NewStatefulSetScale ¶
func NewStatefulSetScale(ss *apps.StatefulSet) *appsV1beta2.Scale
NewStatefulSetScale creates a new StatefulSet scale subresource and returns it
func NewTestJob ¶
func NewTestJob(behavior, name string, rPol v1.RestartPolicy, parallelism, completions int32, activeDeadlineSeconds *int64, backoffLimit int32) *batch.Job
NewTestJob returns a Job which does one of several testing behaviors. notTerminate starts a Job that will run effectively forever. fail starts a Job that will fail immediately. succeed starts a Job that will succeed immediately. randomlySucceedOrFail starts a Job that will succeed or fail randomly. failOnce fails the Job the first time it is run and succeeds subsequently. name is the Name of the Job. RestartPolicy indicates the restart policy of the containers in which the Pod is running. Parallelism is the Job's parallelism, and completions is the Job's required number of completions.
func NodeAddresses ¶
func NodeAddresses(nodelist *v1.NodeList, addrType v1.NodeAddressType) []string
NodeAddresses returns the first address of the given type of each node.
func NodeHasTaint ¶
func NodeOSDistroIs ¶
func NodeProxyRequest ¶
func NodeProxyRequest(c clientset.Interface, node, endpoint string, port int) (restclient.Result, error)
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. If it can't find any external IPs, it falls back to looking for internal IPs. If it can't find an internal IP for every node it returns an error, though it still returns all hosts that it found in that case.
func NodeUpgradeGCEWithKubeProxyDaemonSet ¶
func NodeUpgradeGCEWithKubeProxyDaemonSet(f *Framework, v string, img string, enableKubeProxyDaemonSet bool) error
TODO(mrhohn): Remove this function when kube-proxy is run as a DaemonSet by default.
func NumberOfNVIDIAGPUs ¶
TODO make this generic and not linked to COS only NumberOfGPUs returs the number of GPUs advertised by a node This is based on the Device Plugin system and expected to run on a COS based node After the NVIDIA drivers were installed
func NumberOfReadyNodes ¶
NumberOfReadyNodes returns number of ready Nodes excluding Master Node.
func NumberOfRegisteredNodes ¶
NumberOfRegisteredNodes returns number of registered Nodes excluding Master Node.
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 PVPVCCleanup ¶
func PVPVCCleanup(c clientset.Interface, ns string, pv *v1.PersistentVolume, pvc *v1.PersistentVolumeClaim) []error
Clean up a pv and pvc in a single pv/pvc test case. Note: delete errors are appended to []error so that we can attempt to delete both the pvc and pv.
func PVPVCMapCleanup ¶
Clean up pvs and pvcs in multi-pv-pvc test cases. Entries found in the pv and claim maps are deleted as long as the Delete api call succeeds. Note: delete errors are appended to []error so that as many pvcs and pvs as possible are deleted.
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 ¶
func PodProxyResponseChecker ¶
func PodStartupLatencyToPerfData ¶
func PodStartupLatencyToPerfData(latency *PodStartupLatency) *perftype.PerfData
PodStartupLatencyToPerfData transforms PodStartupLatency to PerfData.
func PodsCreated ¶
func PodsCreatedByLabel ¶
func PodsResponding ¶
func PollURL ¶
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 PrettyPrint ¶
func PrettyPrint(item interface{}) string
PrettyPrint returns a human-readable representation of an item.
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 PrintSummaries ¶
func PrintSummaries(summaries []TestDataSummary, testBaseName string)
func PrivilegedPSP ¶
func PrivilegedPSP(name string) *policy.PodSecurityPolicy
Creates a PodSecurityPolicy that allows everything.
func ProviderIs ¶
func RandomSuffix ¶
func RandomSuffix() string
randomSuffix provides a random string to append to pods,services,rcs. TODO: Allow service names to have the same form as names
for pods and replication controllers so we don't need to use such a function and can instead use the UUID utility function.
func RcByNameContainer ¶
func RcByNameContainer(name string, replicas int32, image string, labels map[string]string, c v1.Container, gracePeriod *int64) *v1.ReplicationController
RcByNameContainer returns a ReplicationController with specified name and container
func RcByNamePort ¶
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 RealVersion ¶
RealVersion turns a version constants into a version string deployable on GKE. See hack/get-build.sh for more information.
func RegisterClusterFlags ¶
func RegisterClusterFlags()
Register flags specific to the cluster e2e test suite.
func RegisterNodeFlags ¶
func RegisterNodeFlags()
Register flags specific to the node e2e test suite.
func RegisterProvider ¶
RegisterProvider is expected to be called during application init, typically by an init function in a provider package.
func RemoveAvoidPodsOffNode ¶
RemoveAnnotationOffNode removes AvoidPods annotations from the node. It does not fail if no such annotation exists.
func RemoveCleanupAction ¶
func RemoveCleanupAction(p CleanupActionHandle)
RemoveCleanupAction removes a function that was installed by AddCleanupAction.
func RemoveLabelOffNode ¶
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 ¶
func ResetMetrics ¶
Resets latency metrics in apiserver.
func ResetSchedulerMetrics ¶
func ResizeGroup ¶
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 ¶
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 RestartControllerManager ¶
func RestartControllerManager() error
func RestartKubeProxy ¶
func RestartKubelet ¶
func RestclientConfig ¶
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 ¶
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 RunHostCmdWithRetries ¶
RunHostCmdWithRetries calls RunHostCmd and retries all errors until it succeeds or the specified timeout expires. This can be used with idempotent commands to deflake transient Node issues.
func RunIfContainerRuntimeIs ¶
func RunIfContainerRuntimeIs(runtimes ...string)
func RunIfSystemSpecNameIs ¶
func RunIfSystemSpecNameIs(names ...string)
func RunKubectl ¶
RunKubectl is a convenience wrapper over kubectlBuilder
func RunKubectlInput ¶
RunKubectlInput is a convenience wrapper over kubectlBuilder that takes input to stdin
func RunKubectlOrDie ¶
RunKubectlOrDie is a convenience wrapper over kubectlBuilder
func RunKubectlOrDieInput ¶
RunKubectlOrDieInput is a convenience wrapper over kubectlBuilder that takes input to stdin
func RunKubemciCmd ¶
RunKubemciCmd is a convenience wrapper over kubectlBuilder to run kubemci. It assumes that kubemci exists in PATH.
func RunKubemciWithKubeconfig ¶
RunKubemciWithKubeconfig is a convenience wrapper over RunKubemciCmd
func RunReplicaSet ¶
func RunReplicaSet(config testutils.ReplicaSetConfig) error
func RunSSHCommandViaBastion ¶
func RunSSHCommandViaBastion(cmd, user, bastion, host string, signer ssh.Signer) (string, string, int, error)
RunSSHCommandViaBastion returns the stdout, stderr, and exit code from running cmd on host as specific user, along with any SSH-level error. It uses an SSH proxy to connect to bastion, then via that tunnel connects to the remote host. Similar to sshutil.RunSSHCommand but scoped to the needs of the test infrastructure.
func ScaleDeployment ¶
func ScaleDeployment(clientset clientset.Interface, scalesGetter scaleclient.ScalesGetter, ns, name string, size uint, wait bool) error
func ScaleRC ¶
func ScaleRC(clientset clientset.Interface, scalesGetter scaleclient.ScalesGetter, ns, name string, size uint, wait bool) error
func ScaleRCByLabels ¶
func ScaleRCByLabels(clientset clientset.Interface, scalesGetter scaleclient.ScalesGetter, 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 ¶
func ScaleResource( clientset clientset.Interface, scalesGetter scaleclient.ScalesGetter, ns, name string, size uint, wait bool, kind schema.GroupKind, gr schema.GroupResource, ) error
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 SkipIfContainerRuntimeIs ¶
func SkipIfContainerRuntimeIs(runtimes ...string)
func SkipIfMissingResource ¶
func SkipIfMissingResource(dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, namespace string)
func SkipIfMultizone ¶
func SkipIfProviderIs ¶
func SkipIfProviderIs(unsupportedProviders ...string)
func SkipUnlessAtLeast ¶
func SkipUnlessClusterMonitoringModeIs ¶
func SkipUnlessClusterMonitoringModeIs(supportedMonitoring ...string)
func SkipUnlessKubectlVersionGTE ¶
func SkipUnlessKubectlVersionGTE(v *utilversion.Version)
func SkipUnlessLocalEphemeralStorageEnabled ¶
func SkipUnlessLocalEphemeralStorageEnabled()
func SkipUnlessMasterOSDistroIs ¶
func SkipUnlessMasterOSDistroIs(supportedMasterOsDistros ...string)
func SkipUnlessMultizone ¶
func SkipUnlessNodeCountIsAtLeast ¶
func SkipUnlessNodeCountIsAtLeast(minNodeCount int)
func SkipUnlessNodeCountIsAtMost ¶
func SkipUnlessNodeCountIsAtMost(maxNodeCount int)
func SkipUnlessNodeOSDistroIs ¶
func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string)
func SkipUnlessPrometheusMonitoringIsEnabled ¶
func SkipUnlessPrometheusMonitoringIsEnabled(supportedMonitoring ...string)
func SkipUnlessProviderIs ¶
func SkipUnlessProviderIs(supportedProviders ...string)
func SkipUnlessSSHKeyPresent ¶
func SkipUnlessSSHKeyPresent()
func SkipUnlessServerVersionGTE ¶
func SkipUnlessServerVersionGTE(v *utilversion.Version, c discovery.ServerVersionInterface)
func SkipUnlessTaintBasedEvictionsEnabled ¶
func SkipUnlessTaintBasedEvictionsEnabled()
func StartCPUProfileGatherer ¶
func StartCPUProfileGatherer(componentName string, profileBaseName string, interval time.Duration) chan struct{}
StartCPUProfileGatherer performs polling-based gathering of the component's CPU profile. It takes the interval b/w consecutive gatherings as an argument and starts the gathering goroutine. To stop the gatherer, close the returned channel.
func StartCmdAndStreamOutput ¶
func StartCmdAndStreamOutput(cmd *exec.Cmd) (stdout, stderr io.ReadCloser, err error)
func StartServeHostnameService ¶
func StartServeHostnameService(c clientset.Interface, internalClient internalclientset.Interface, svc *v1.Service, ns string, replicas int) ([]string, string, error)
StartServeHostnameService creates a replication controller that serves its hostname and a service on top of it.
func StartVolumeServer ¶
func StartVolumeServer(client clientset.Interface, config VolumeTestConfig) *v1.Pod
Starts a container specified by config.serverImage and exports all config.serverPorts from it. The returned pod should be used to get the server IP address and create appropriate VolumeSource.
func TargetContainers ¶
func TargetContainers() []string
A list of containers for which we want to collect resource usage.
func TestHitNodesFromOutside ¶
func TestUnderTemporaryNetworkFailure ¶
func TestUnderTemporaryNetworkFailure(c clientset.Interface, ns string, node *v1.Node, testFunc func())
Blocks outgoing network traffic on 'node'. Then runs testFunc and returns its status. At the end (even in case of errors), the network traffic is brought back to normal. This function executes commands on a node so it will work only for some environments.
func TestVolumeClient ¶
func TestVolumeClient(client clientset.Interface, config VolumeTestConfig, fsGroup *int64, fsType string, tests []VolumeTest)
TestVolumeClient start a client pod using given VolumeSource (exported by startVolumeServer()) and check that the pod sees expected data, e.g. from the server pod. Multiple VolumeTests can be specified to mount multiple volumes to a single pod.
func UnblockNetwork ¶
func UpdateDeploymentWithRetries ¶
func UpdateDeploymentWithRetries(c clientset.Interface, namespace, name string, applyUpdate testutils.UpdateDeploymentFunc) (*apps.Deployment, error)
func UpdateJob ¶
UpdateJob uses c to updated job in namespace ns. If the returned error is nil, the returned Job is valid and has been updated.
func UpdateJobFunc ¶
UpdateJobFunc updates the job object. It retries if there is a conflict, throw out error if there is any other errors. name is the job name, updateFn is the function updating the job object.
func UpdateJobWithRetries ¶
func UpdatePodWithRetries ¶
func UpdateReplicaSetWithRetries ¶
func UpdateReplicaSetWithRetries(c clientset.Interface, namespace, name string, applyUpdate testutils.UpdateReplicaSetFunc) (*apps.ReplicaSet, error)
func UpdateService ¶
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 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 ¶
func ValidateEndpointsOrFail(c clientset.Interface, namespace, serviceName string, expectedEndpoints PortsByPodName)
func VerifyLatencyWithinThreshold ¶
func VerifyLatencyWithinThreshold(threshold, actual LatencyMetric, metricName string) error
Verifies whether 50, 90 and 99th percentiles of a latency metric are within the expected threshold.
func VerifyPods ¶
func VerifyPodsRunning ¶
func VerifyServeHostnameServiceUp ¶
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 VerifyThatTaintIsGone ¶
func VolumeTestCleanup ¶
func VolumeTestCleanup(f *Framework, config VolumeTestConfig)
Clean both server and client pods.
func WaitAndVerifyBinds ¶
func WaitAndVerifyBinds(c clientset.Interface, ns string, pvols PVMap, claims PVCMap, testExpected bool) error
Search for bound PVs and PVCs by examining pvols for non-nil claimRefs. NOTE: Each iteration waits for a maximum of 3 minutes per PV and, if the PV is bound,
up to 3 minutes for the PVC. When the number of PVs != number of PVCs, this can lead to situations where the maximum wait times are reached several times in succession, extending test time. Thus, it is recommended to keep the delta between PVs and PVCs small.
func WaitForAllJobPodsGone ¶
WaitForAllJobPodsRunning wait for all pods for the Job named jobName in namespace ns to be deleted.
func WaitForAllJobPodsRunning ¶
WaitForAllJobPodsRunning wait for all pods for the Job named JobName in namespace ns to become Running. Only use when pods will run for a long time, or it will be racy.
func WaitForAllNodesHealthy ¶
checks whether all registered nodes are ready and all required Pods are running on them.
func WaitForAllNodesSchedulable ¶
WaitForAllNodesSchedulable waits up to timeout for all (but TestContext.AllowedNotReadyNodes) to become scheduable.
func WaitForApiserverUp ¶
func WaitForAuthorizationUpdate ¶
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 WaitForControlledPods ¶
func WaitForControlledPods(c clientset.Interface, ns, name string, kind schema.GroupKind) (pods *v1.PodList, err error)
Wait up to PodListTimeout for getting pods of the specified controller name and return them.
func WaitForControlledPodsRunning ¶
func WaitForControlledPodsRunning(c clientset.Interface, ns, name string, kind schema.GroupKind) error
Wait up to 10 minutes for pods to become Running.
func WaitForControllerManagerUp ¶
func WaitForControllerManagerUp() error
func WaitForDaemonSets ¶
func WaitForDaemonSets(c clientset.Interface, ns string, allowedNotReadyNodes int32, timeout time.Duration) error
WaitForDaemonSets for all daemonsets in the given namespace to be ready (defined as all but 'allowedNotReadyNodes' pods associated with that daemonset are ready).
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 WaitForDeploymentComplete ¶
func WaitForDeploymentComplete(c clientset.Interface, d *apps.Deployment) error
Waits for the deployment to complete, and don't check if rolling update strategy is broken. Rolling update strategy is used only during a rolling update, and can be violated in other situations, such as shortly after a scaling event or the deployment is just created.
func WaitForDeploymentCompleteAndCheckRolling ¶
func WaitForDeploymentCompleteAndCheckRolling(c clientset.Interface, d *apps.Deployment) error
Waits for the deployment to complete, and check rolling update strategy isn't broken at any times. Rolling update strategy should not be broken during a rolling update.
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 most of the time, but an overwhelmed RS controller may result in taking longer to relabel a RS.
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 WaitForDeploymentUpdatedReplicasGTE ¶
func WaitForDeploymentUpdatedReplicasGTE(c clientset.Interface, ns, deploymentName string, minUpdatedReplicas int32, desiredGeneration int64) error
WaitForDeploymentUpdatedReplicasGTE waits for given deployment to be observed by the controller and has at least a number of updatedReplicas
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 WaitForGroupSize ¶
func WaitForJobComplete ¶
WaitForJobComplete uses c to wait for completions to complete for the Job jobName in namespace ns.
func WaitForJobDeleting ¶
WaitForJobDeleting uses c to wait for the Job jobName in namespace ns to have a non-nil deletionTimestamp (i.e. being deleted).
func WaitForJobFailure ¶
func WaitForJobFailure(c clientset.Interface, ns, jobName string, timeout time.Duration, reason string) error
WaitForJobFailure uses c to wait for up to timeout for the Job named jobName in namespace ns to fail.
func WaitForJobFinish ¶
WaitForJobFinish uses c to wait for the Job jobName in namespace ns to finish (either Failed or Complete).
func WaitForJobGone ¶
WaitForJobGone uses c to wait for up to timeout for the Job named jobName in namespace ns to be removed.
func WaitForKubeletUp ¶
func WaitForMasters ¶
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 WaitForNamedAuthorizationUpdate ¶
func WaitForNamedAuthorizationUpdate(c v1beta1authorization.SubjectAccessReviewsGetter, user, namespace, verb, resourceName string, resource schema.GroupResource, allowed bool) error
WaitForAuthorizationUpdate checks if the given user can perform the named verb and action on the named resource. If policyCachePollTimeout is reached without the expected condition matching, an error is returned
func WaitForNodeHasTaintOrNot ¶
func WaitForNodeHasTaintOrNot(c clientset.Interface, nodeName string, taint *v1.Taint, wantTrue bool, timeout time.Duration) error
WaitForNodeHasTaintOrNot waits for a taint to be added/removed from the node until timeout occurs, whichever comes first.
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 WaitForPVClaimBoundPhase ¶
func WaitForPVClaimBoundPhase(client clientset.Interface, pvclaims []*v1.PersistentVolumeClaim, timeout time.Duration) ([]*v1.PersistentVolume, error)
wait until all pvcs phase set to bound
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 WaitForPersistentVolumeClaimDeleted ¶
func WaitForPersistentVolumeClaimDeleted(c clientset.Interface, ns string, pvcName string, Poll, timeout time.Duration) error
WaitForPersistentVolumeClaimDeleted waits for a PersistentVolumeClaim to be removed from the system until timeout occurs, whichever comes first.
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 WaitForPersistentVolumeClaimsPhase ¶
func WaitForPersistentVolumeClaimsPhase(phase v1.PersistentVolumeClaimPhase, c clientset.Interface, ns string, pvcNames []string, Poll, timeout time.Duration, matchAny bool) error
WaitForPersistentVolumeClaimPhase waits for any (if matchAny is true) or all (if matchAny is false) PersistentVolumeClaims 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 ¶
func WaitForPodNameRunningInNamespace ¶
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 WaitForPodNameUnschedulableInNamespace ¶
WaitForPodNameUnschedulableInNamespace returns an error if it takes too long for the pod to become Pending and have condition Status equal to Unschedulable, if the pod Get api returns an error (IsNotFound or other), or if the pod failed with an unexpected reason. Typically called to test that the passed-in pod is Pending and Unschedulable.
func WaitForPodNoLongerRunningInNamespace ¶
Waits default amount of time (DefaultPodDeletionTimeout) 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, allowedNotReadyPods int32, timeout time.Duration, ignoreLabels map[string]string) 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. All pods that are in SUCCESS state are not counted.
If ignoreLabels is not empty, pods matching this selector are ignored.
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 ¶
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 WaitForReadyNodes ¶
WaitForReadyNodes waits up to timeout for cluster to has desired size and there is no not-ready nodes in it. By cluster size we mean number of Nodes excluding Master Node.
func WaitForReadyReplicaSet ¶
WaitForReadyReplicaSet waits until the replicaset has all of its replicas ready.
func WaitForReplicaSetDesiredReplicas ¶
func WaitForReplicaSetDesiredReplicas(rsClient appsclient.ReplicaSetsGetter, replicaSet *apps.ReplicaSet) error
WaitForReplicaSetDesiredReplicas waits until the replicaset has desired number of replicas.
func WaitForReplicaSetTargetAvailableReplicas ¶
func WaitForReplicaSetTargetAvailableReplicas(c clientset.Interface, replicaSet *apps.ReplicaSet, targetReplicaNum int32) error
WaitForReplicaSetTargetAvailableReplicas waits for .status.availableReplicas of a RS to equal targetReplicaNum
func WaitForReplicaSetTargetSpecReplicas ¶
func WaitForReplicaSetTargetSpecReplicas(c clientset.Interface, replicaSet *apps.ReplicaSet, targetReplicaNum int32) error
WaitForReplicaSetTargetSpecReplicas waits for .spec.replicas of a RS to equal targetReplicaNum
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 WaitForReplicationControllerwithSelector ¶
func WaitForReplicationControllerwithSelector(c clientset.Interface, namespace string, selector labels.Selector, exist bool, interval, timeout time.Duration) error
WaitForReplicationControllerwithSelector waits until any RC with given selector 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 WaitForServiceWithSelector ¶
func WaitForServiceWithSelector(c clientset.Interface, namespace string, selector labels.Selector, exist bool, interval, timeout time.Duration) error
WaitForServiceWithSelector waits until any service with given selector appears (exist == true), or disappears (exist == false)
func WaitForStableCluster ¶
WaitForStableCluster waits until all existing pods are scheduled and returns their amount.
func WaitForStatefulSetReplicasReady ¶
func WaitForStatefulSetReplicasReady(statefulSetName, ns string, c clientset.Interface, Poll, timeout time.Duration) error
WaitForStatefulSetReplicasReady waits for all replicas of a StatefulSet to become ready or until timeout occurs, whichever comes first.
func WaitOnPVandPVC ¶
func WaitOnPVandPVC(c clientset.Interface, ns string, pv *v1.PersistentVolume, pvc *v1.PersistentVolumeClaim) error
Wait for the pv and pvc to bind to each other.
func WaitTimeoutForPodEvent ¶
func WaitTimeoutForPodEvent(c clientset.Interface, podName, namespace, eventSelector, msg string, timeout time.Duration) error
WaitTimeoutForPodEvent waits for an event to occur for a pod
func WatchRecreateDeployment ¶
func WatchRecreateDeployment(c clientset.Interface, d *apps.Deployment) error
WatchRecreateDeployment watches Recreate deployments and ensures no new pods will run at the same time with old pods.
Types ¶
type APIResponsiveness ¶
type APIResponsiveness struct {
APICalls []APICall `json:"apicalls"`
}
func HighLatencyRequests ¶
Prints top five summary metrics for request types with latency and returns number of such request types above threshold. We use a higher threshold for list calls if nodeCount is above a given threshold (i.e. cluster is big).
func (*APIResponsiveness) Len ¶
func (a *APIResponsiveness) Len() int
func (*APIResponsiveness) Less ¶
func (a *APIResponsiveness) Less(i, j int) bool
func (*APIResponsiveness) PrintHumanReadable ¶
func (a *APIResponsiveness) PrintHumanReadable() string
func (*APIResponsiveness) PrintJSON ¶
func (a *APIResponsiveness) PrintJSON() string
func (*APIResponsiveness) SummaryKind ¶
func (a *APIResponsiveness) SummaryKind() string
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 CloudConfig struct { ApiEndpoint string ProjectID string Zone string // for multizone tests, arbitrarily chosen zone Region string MultiZone bool MultiMaster bool Cluster string MasterName string NodeInstanceGroup string // comma-delimited list of groups' names NumNodes int ClusterIPRange string ClusterTag string Network string ConfigFile string // for azure and openstack NodeTag string MasterTag string Provider ProviderInterface }
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 verify, 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 ContainerResourceGatherer ¶
type ContainerResourceGatherer struct {
// contains filtered or unexported fields
}
func NewResourceUsageGatherer ¶
func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOptions, pods *v1.PodList) (*ContainerResourceGatherer, error)
func (*ContainerResourceGatherer) StartGatheringData ¶
func (g *ContainerResourceGatherer) StartGatheringData()
StartGatheringData starts a stat gathering worker blocks for each node to track, and blocks until StopAndSummarize is called.
func (*ContainerResourceGatherer) StopAndSummarize ¶
func (g *ContainerResourceGatherer) StopAndSummarize(percentiles []int, constraints map[string]ResourceConstraint) (*ResourceUsageSummary, error)
StopAndSummarize stops stat gathering workers, processes the collected stats, generates resource summary for the passed-in percentiles, and returns the summary. It returns an error if the resource usage at any percentile is beyond the specified resource constraints.
type ContainerResourceUsage ¶
type ContainersCPUSummary ¶
ContainersCPUSummary is indexed by the container name with each entry a (percentile, value) map.
type CreateTestingNSFn ¶
type E2ETestNodePreparer ¶
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 ¶
func (p *E2ETestNodePreparer) CleanupNodes() error
func (*E2ETestNodePreparer) PrepareNodes ¶
func (p *E2ETestNodePreparer) PrepareNodes() error
type EtcdMetrics ¶
type EtcdMetrics struct { BackendCommitDuration HistogramVec `json:"backendCommitDuration"` SnapshotSaveTotalDuration HistogramVec `json:"snapshotSaveTotalDuration"` PeerRoundTripTime HistogramVec `json:"peerRoundTripTime"` WalFsyncDuration HistogramVec `json:"walFsyncDuration"` MaxDatabaseSize float64 `json:"maxDatabaseSize"` }
func (*EtcdMetrics) PrintHumanReadable ¶
func (l *EtcdMetrics) PrintHumanReadable() string
func (*EtcdMetrics) PrintJSON ¶
func (l *EtcdMetrics) PrintJSON() string
func (*EtcdMetrics) SummaryKind ¶
func (l *EtcdMetrics) SummaryKind() string
type EtcdMetricsCollector ¶
type EtcdMetricsCollector struct {
// contains filtered or unexported fields
}
func NewEtcdMetricsCollector ¶
func NewEtcdMetricsCollector() *EtcdMetricsCollector
func (*EtcdMetricsCollector) GetMetrics ¶
func (mc *EtcdMetricsCollector) GetMetrics() *EtcdMetrics
func (*EtcdMetricsCollector) StartCollecting ¶
func (mc *EtcdMetricsCollector) StartCollecting(interval time.Duration)
StartCollecting starts to collect etcd db size metric periodically and updates MaxDatabaseSize accordingly.
func (*EtcdMetricsCollector) StopAndSummarize ¶
func (mc *EtcdMetricsCollector) StopAndSummarize() error
type EventsLister ¶
type ExecOptions ¶
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 Factory ¶
type Factory func() (ProviderInterface, error)
type FlakeReport ¶
type FlakeReport struct { Flakes []string `json:"flakes"` FlakeCount int `json:"flakeCount"` // contains filtered or unexported fields }
func NewFlakeReport ¶
func NewFlakeReport() *FlakeReport
func (*FlakeReport) GetFlakeCount ¶
func (f *FlakeReport) GetFlakeCount() int
func (*FlakeReport) PrintHumanReadable ¶
func (f *FlakeReport) PrintHumanReadable() string
func (*FlakeReport) PrintJSON ¶
func (f *FlakeReport) PrintJSON() string
func (*FlakeReport) RecordFlakeIfError ¶
func (f *FlakeReport) RecordFlakeIfError(err error, optionalDescription ...interface{})
RecordFlakeIfError records the error (if non-nil) as a flake along with an optional description. This can be used as a replacement of framework.ExpectNoError() for non-critical errors that can be considered as 'flakes' to avoid causing failures in tests.
func (*FlakeReport) SummaryKind ¶
func (f *FlakeReport) SummaryKind() string
type Framework ¶
type Framework struct { BaseName string // Set together with creating the ClientSet and the namespace. // Guaranteed to be unique in the cluster even when running the same // test multiple times in parallel. UniqueName string ClientSet clientset.Interface KubemarkExternalClusterClientSet clientset.Interface InternalClientset *internalclientset.Clientset AggregatorClient *aggregatorclient.Clientset DynamicClient dynamic.Interface ScalesGetter scaleclient.ScalesGetter SkipNamespaceCreation bool // Whether to skip creating a namespace Namespace *v1.Namespace // Every test has at least one namespace unless creation is skipped NamespaceDeletionTimeout time.Duration SkipPrivilegedPSPBinding bool // Whether to skip creating a binding to the privileged PSP in the test namespace // Constraints that passed to a check which is executed after data is gathered to // see if 99% of results are within acceptable bounds. It has to be injected in the test, // as expectations vary greatly. Constraints are grouped by the container names. AddonResourceConstraints map[string]ResourceConstraint // configuration for framework's client Options FrameworkOptions // Place where various additional data is stored during test run to be printed to ReportDir, // or stdout if ReportDir is not set once test ends. TestSummaries []TestDataSummary // 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 NewFramework ¶
func NewFramework(baseName string, options FrameworkOptions, client clientset.Interface) *Framework
func (*Framework) AddNamespacesToDelete ¶
AddNamespacesToDelete adds one or more namespaces to be deleted when the test completes.
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 ¶
func (*Framework) CreateFromManifests ¶
func (f *Framework) CreateFromManifests(patch func(item interface{}) error, files ...string) (func(), error)
CreateFromManifests is a combination of LoadFromManifests, PatchItems, patching with an optional custom function, and CreateItems.
func (*Framework) CreateItems ¶
CreateItems creates the items. Each of them must be an API object of a type that is registered in Factory.
It returns either a cleanup function or an error, but never both.
Cleaning up after a test can be triggered in two ways:
- the test invokes the returned cleanup function, usually in an AfterEach
- the test suite terminates, potentially after skipping the test's AfterEach (https://github.com/onsi/ginkgo/issues/222)
PatchItems has the some limitations as LoadFromManifests: - only some common items are supported, unknown ones trigger an error - only the latest stable API version for each item is supported
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 ¶
ExecCommandInContainer executes a command in the specified container.
func (*Framework) ExecCommandInContainerWithFullOutput ¶
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 ¶
func (*Framework) ExecCommandInPodWithFullOutput ¶
func (*Framework) ExecShellInContainer ¶
func (*Framework) ExecShellInPod ¶
func (*Framework) ExecShellInPodWithFullOutput ¶
func (*Framework) ExecWithOptions ¶
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) LoadFromManifests ¶
LoadFromManifests loads .yaml or .json manifest files and returns all items that it finds in them. It supports all items for which there is a factory registered in Factories and .yaml files with multiple items separated by "---". Files are accessed via the "testfiles" package, which means they can come from a file system or be built into the binary.
LoadFromManifests has some limitations:
- aliases are not supported (i.e. use serviceAccountName instead of the deprecated serviceAccount, https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podspec-v1-core) and silently ignored
- the latest stable API version for each item is used, regardless of what is specified in the manifest files
func (*Framework) MatchContainerOutput ¶
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) NewTestPod ¶
func (f *Framework) NewTestPod(name string, requests v1.ResourceList, limits v1.ResourceList) *v1.Pod
NewTestPod returns a pod that has the specified requests and limits
func (*Framework) PatchItems ¶
PatchItems modifies the given items in place such that each test gets its own instances, to avoid conflicts between different tests and between tests and normal deployments.
This is done by: - creating namespaced items inside the test's namespace - changing the name of non-namespaced items like ClusterRole
PatchItems has some limitations: - only some common items are supported, unknown ones trigger an error - only the latest stable API version for each item is supported
func (*Framework) PatchName ¶
PatchName makes the name of some item unique by appending the generated unique name.
func (*Framework) PatchNamespace ¶
PatchNamespace moves the item into the test's namespace. Not all items can be namespaced. For those, the name also needs to be patched.
func (*Framework) PodClient ¶
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 ¶
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) RecordFlakeIfError ¶
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) WaitForPodNoLongerRunning ¶
WaitForPodNoLongerRunning waits for the pod to no longer be running in the namespace, for either success or failure.
func (*Framework) WaitForPodNotFound ¶
WaitForPodNotFound waits for the pod to be completely terminated (not "Get-able").
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 HTTPPokeParams ¶
type HTTPPokeResult ¶
type HTTPPokeResult struct { Status HTTPPokeStatus Code int // HTTP code: 0 if the connection was not made Error error // if there was any error Body []byte // if code != 0 }
func PokeHTTP ¶
func PokeHTTP(host string, port int, path string, params *HTTPPokeParams) HTTPPokeResult
PokeHTTP tries to connect to a host on a port for a given URL path. Callers can specify additional success parameters, if desired.
The result status will be characterized as precisely as possible, given the known users of this.
The result code will be zero in case of any failure to connect, or non-zero if the HTTP transaction completed (even if the other test params make this a failure).
The result error will be populated for any status other than Success.
The result body will be populated if the HTTP transaction was completed, even if the other test params make this a failure).
type HTTPPokeStatus ¶
type HTTPPokeStatus string
const ( HTTPSuccess HTTPPokeStatus = "Success" HTTPError HTTPPokeStatus = "UnknownError" // Any time we add new errors, we should audit all callers of this. HTTPTimeout HTTPPokeStatus = "TimedOut" HTTPRefused HTTPPokeStatus = "ConnectionRefused" HTTPRetryCode HTTPPokeStatus = "RetryCode" HTTPWrongCode HTTPPokeStatus = "WrongCode" HTTPBadResponse HTTPPokeStatus = "BadResponse" )
type HistogramVec ¶
type HistogramVec []Histogram
type InvariantFunc ¶
type ItemFactory ¶
type ItemFactory interface { // New returns a new empty item. New() runtime.Object // Create is responsible for creating the item. It returns an // error or a cleanup function for the created item. // If the item is of an unsupported type, it must return // an error that has ItemNotSupported as cause. Create(f *Framework, item interface{}) (func() error, error) }
ItemFactory provides support for creating one particular item. The type gets exported because other packages might want to extend the set of pre-defined factories.
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 ¶
func (kc *KubeConfig) FindCluster(name string) *KubeCluster
func (*KubeConfig) FindUser ¶
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 GetDefaultKubeletLatencyMetrics ¶
func GetDefaultKubeletLatencyMetrics(ms metrics.KubeletMetrics) KubeletLatencyMetrics
GetDefaultKubeletLatencyMetrics calls GetKubeletLatencyMetrics with a set of default metricNames identifying common latency metrics. Note that the KubeletMetrics passed in should not contain subsystem prefix.
func GetKubeletLatencyMetrics ¶
func GetKubeletLatencyMetrics(ms metrics.KubeletMetrics, filterMetricNames sets.String) KubeletLatencyMetrics
GetKubeletLatencyMetrics filters ms to include only those contained in the metricNames set, then constructs a KubeletLatencyMetrics list based on the samples associated with those metrics.
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 ¶
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
func (*LogsSizeDataSummary) SummaryKind ¶
func (s *LogsSizeDataSummary) SummaryKind() 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.Collection
func (*MetricsForE2E) PrintHumanReadable ¶
func (m *MetricsForE2E) PrintHumanReadable() string
func (*MetricsForE2E) PrintJSON ¶
func (m *MetricsForE2E) PrintJSON() string
func (*MetricsForE2E) SummaryKind ¶
func (m *MetricsForE2E) SummaryKind() string
type NetworkingTestConfig ¶
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 using the hostexec image. HostTestContainerPod *v1.Pod // if the HostTestContainerPod is running with HostNetwork=true. HostNetwork bool // 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 // SessionAffinityService is a Service with SessionAffinity=ClientIP // spanning over all endpointPods. SessionAffinityService *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 ¶
func NewCoreNetworkingTestConfig(f *Framework, hostNetwork bool) *NetworkingTestConfig
NewNetworkingTestNodeE2EConfig creates and sets up a new test config helper for Node E2E.
func NewNetworkingTestConfig ¶
func NewNetworkingTestConfig(f *Framework) *NetworkingTestConfig
NewNetworkingTestConfig creates and sets up a new test config helper.
func (*NetworkingTestConfig) DeleteNetProxyPod ¶
func (config *NetworkingTestConfig) DeleteNetProxyPod()
func (*NetworkingTestConfig) DeleteNodePortService ¶
func (config *NetworkingTestConfig) DeleteNodePortService()
func (*NetworkingTestConfig) DialFromContainer ¶
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 ¶
func (config *NetworkingTestConfig) DialFromEndpointContainer(protocol, targetIP string, targetPort, maxTries, minTries int, expectedEps sets.String)
func (*NetworkingTestConfig) DialFromNode ¶
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 ¶
func (config *NetworkingTestConfig) DialFromTestContainer(protocol, targetIP string, targetPort, maxTries, minTries int, expectedEps sets.String)
func (*NetworkingTestConfig) EndpointHostnames ¶
func (config *NetworkingTestConfig) EndpointHostnames() sets.String
EndpointHostnames returns a set of hostnames for existing endpoints.
func (*NetworkingTestConfig) GetEndpointsFromContainer ¶
func (config *NetworkingTestConfig) GetEndpointsFromContainer(protocol, containerIP, targetIP string, containerHttpPort, targetPort, tries int) (sets.String, error)
GetEndpointsFromContainer 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. It returns all different endpoints from multiple retries.
- tries is the number of curl attempts. If this many attempts pass and we don't see any endpoints, the test fails.
func (*NetworkingTestConfig) GetEndpointsFromTestContainer ¶
func (*NetworkingTestConfig) GetSelfURL ¶
func (config *NetworkingTestConfig) GetSelfURL(port int32, 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.
func (*NetworkingTestConfig) GetSelfURLStatusCode ¶
func (config *NetworkingTestConfig) GetSelfURLStatusCode(port int32, path string, expected string)
GetSelfStatusCode executes a curl against the given path via kubectl exec into a test container running with host networking, and fails if the returned status code doesn't match the expected string.
type NodeKiller ¶
type NodeKiller struct {
// contains filtered or unexported fields
}
NodeKiller is a utility to simulate node failures.
func NewNodeKiller ¶
func NewNodeKiller(config NodeKillerConfig, client clientset.Interface, provider string) *NodeKiller
NewNodeKiller creates new NodeKiller.
func (*NodeKiller) Run ¶
func (k *NodeKiller) Run(stopCh <-chan struct{})
Run starts NodeKiller until stopCh is closed.
type NodeKillerConfig ¶
type NodeKillerConfig struct { // Enabled determines whether NodeKill should do anything at all. // All other options below are ignored if Enabled = false. Enabled bool // FailureRatio is a percentage of all nodes that could fail simultinously. FailureRatio float64 // Interval is time between node failures. Interval time.Duration // JitterFactor is factor used to jitter node failures. // Node will be killed between [Interval, Interval + (1.0 + JitterFactor)]. JitterFactor float64 // SimulatedDowntime is a duration between node is killed and recreated. SimulatedDowntime time.Duration }
NodeKillerConfig describes configuration of NodeKiller -- a utility to simulate node failures.
type NodeRuntimeOperationErrorRate ¶
type NodeRuntimeOperationErrorRate map[string]*RuntimeOperationErrorRate
NodeRuntimeOperationErrorRate is the runtime operation error rate on one node.
type NodeTestContextType ¶
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 kubeletconfig.KubeletConfiguration // ImageDescription is the description of the image on which the test is running. ImageDescription string // SystemSpecName is the name of the system spec (e.g., gke) that's used in // the node e2e test. If empty, the default one (system.DefaultSpec) is // used. The system specs are in test/e2e_node/system/specs/. SystemSpecName string // ExtraEnvs is a map of environment names to values. ExtraEnvs map[string]string }
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 NullProvider ¶
type NullProvider struct{}
NullProvider is the default implementation of the ProviderInterface which doesn't do anything.
func (NullProvider) CleanupServiceResources ¶
func (n NullProvider) CleanupServiceResources(c clientset.Interface, loadBalancerName, region, zone string)
func (NullProvider) CreatePVSource ¶
func (n NullProvider) CreatePVSource(zone, diskName string) (*v1.PersistentVolumeSource, error)
func (NullProvider) DeleteNode ¶
func (n NullProvider) DeleteNode(node *v1.Node) error
func (NullProvider) DeletePD ¶
func (n NullProvider) DeletePD(pdName string) error
func (NullProvider) DeletePVSource ¶
func (n NullProvider) DeletePVSource(pvSource *v1.PersistentVolumeSource) error
func (NullProvider) EnableAndDisableInternalLB ¶
func (n NullProvider) EnableAndDisableInternalLB() (enable, disable func(svc *v1.Service))
func (NullProvider) EnsureLoadBalancerResourcesDeleted ¶
func (n NullProvider) EnsureLoadBalancerResourcesDeleted(ip, portRange string) error
func (NullProvider) FrameworkAfterEach ¶
func (n NullProvider) FrameworkAfterEach(f *Framework)
func (NullProvider) FrameworkBeforeEach ¶
func (n NullProvider) FrameworkBeforeEach(f *Framework)
func (NullProvider) GetGroupNodes ¶
func (n NullProvider) GetGroupNodes(group string) ([]string, error)
func (NullProvider) LoadBalancerSrcRanges ¶
func (n NullProvider) LoadBalancerSrcRanges() []string
func (NullProvider) ResizeGroup ¶
func (n NullProvider) ResizeGroup(string, int32) error
type PVCMap ¶
type PVCMap map[types.NamespacedName]pvcval
type PersistentVolumeClaimConfig ¶
type PersistentVolumeClaimConfig struct { AccessModes []v1.PersistentVolumeAccessMode Annotations map[string]string Selector *metav1.LabelSelector StorageClassName *string VolumeMode *v1.PersistentVolumeMode }
type PersistentVolumeConfig ¶
type PersistentVolumeConfig struct { PVSource v1.PersistentVolumeSource Prebind *v1.PersistentVolumeClaim ReclaimPolicy v1.PersistentVolumeReclaimPolicy NamePrefix string Labels labels.Set StorageClassName string NodeAffinity *v1.VolumeNodeAffinity VolumeMode *v1.PersistentVolumeMode }
PersistentVolumeConfig is consumed by MakePersistentVolume() to generate a PV object for varying storage options (NFS, ceph, glusterFS, etc.). (+optional) prebind holds a pre-bound PVC Example pvSource:
pvSource: api.PersistentVolumeSource{ NFS: &api.NFSVolumeSource{ ... }, }
type PingCommand ¶
type PingCommand string
const ( IPv4PingCommand PingCommand = "ping" IPv6PingCommand PingCommand = "ping6" )
type PodClient ¶
type PodClient struct { v1core.PodInterface // contains filtered or unexported fields }
func (*PodClient) Create ¶
Create creates a new pod according to the framework specifications (don't wait for it to start).
func (*PodClient) CreateBatch ¶
CreateBatch create a batch of pods. All pods are created before waiting.
func (*PodClient) CreateEventually ¶
CreateEventually retries pod creation for a while before failing the test with the most recent error. This mimicks the behavior of a controller (like the one for DaemonSet) and is necessary because pod creation can fail while its service account is still getting provisioned (https://github.com/kubernetes/kubernetes/issues/68776).
Both the timeout and polling interval are configurable as optional arguments: - The first optional argument is the timeout. - The second optional argument is the polling interval.
Both intervals can either be specified as time.Duration, parsable duration strings or as floats/integers. In the last case they are interpreted as seconds.
func (*PodClient) CreateSync ¶
CreateSync creates a new pod according to the framework specifications, and wait for it to start.
func (*PodClient) CreateSyncInNamespace ¶
CreateSync creates a new pod according to the framework specifications in the given namespace, and waits for it to start.
func (*PodClient) DeleteSync ¶
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) DeleteSyncInNamespace ¶
func (c *PodClient) DeleteSyncInNamespace(name string, namespace string, options *metav1.DeleteOptions, timeout time.Duration)
DeleteSyncInNamespace deletes the pod from the namespace 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 ¶
func (c *PodClient) MatchContainerOutput(name string, containerName string, expectedRegexp string) error
MatchContainerOutput gets output of a container and match expected regexp in the output.
func (*PodClient) PodIsReady ¶
func (*PodClient) Update ¶
Update updates the pod object. It retries if there is a conflict, throw out error if there is any other errors. name is the pod name, updateFn is the function updating the pod object.
func (*PodClient) WaitForErrorEventOrSuccess ¶
WaitForSuccess waits for pod to succeed or an error event for that pod.
func (*PodClient) WaitForFailure ¶
WaitForFailure waits for pod to fail.
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 PodNode ¶
type PodNode struct { // Pod represents pod name Pod string // Node represents node name Node string }
PodNode is a pod-node pair indicating which node a given pod is running on
type PodStartupLatency ¶
type PodStartupLatency struct { CreateToScheduleLatency LatencyMetric `json:"createToScheduleLatency"` ScheduleToRunLatency LatencyMetric `json:"scheduleToRunLatency"` RunToWatchLatency LatencyMetric `json:"runToWatchLatency"` ScheduleToWatchLatency LatencyMetric `json:"scheduleToWatchLatency"` E2ELatency LatencyMetric `json:"e2eLatency"` }
func (*PodStartupLatency) PrintHumanReadable ¶
func (l *PodStartupLatency) PrintHumanReadable() string
func (*PodStartupLatency) PrintJSON ¶
func (l *PodStartupLatency) PrintJSON() string
func (*PodStartupLatency) SummaryKind ¶
func (l *PodStartupLatency) SummaryKind() string
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 specifying 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 ¶
type PortsByPodUID ¶
func GetContainerPortsByPodUID ¶
func GetContainerPortsByPodUID(endpoints *v1.Endpoints) PortsByPodUID
type ProviderInterface ¶
type ProviderInterface interface { FrameworkBeforeEach(f *Framework) FrameworkAfterEach(f *Framework) ResizeGroup(group string, size int32) error GetGroupNodes(group string) ([]string, error) GroupSize(group string) (int, error) DeleteNode(node *v1.Node) error CreatePD(zone string) (string, error) DeletePD(pdName string) error CreatePVSource(zone, diskName string) (*v1.PersistentVolumeSource, error) DeletePVSource(pvSource *v1.PersistentVolumeSource) error CleanupServiceResources(c clientset.Interface, loadBalancerName, region, zone string) EnsureLoadBalancerResourcesDeleted(ip, portRange string) error LoadBalancerSrcRanges() []string EnableAndDisableInternalLB() (enable, disable func(svc *v1.Service)) }
ProviderInterface contains the implementation for certain provider-specific functionality.
func SetupProviderConfig ¶
func SetupProviderConfig(providerName string) (ProviderInterface, error)
SetupProviderConfig validates the chosen provider and creates an interface instance for it.
type ResourceConstraint ¶
type ResourceGathererOptions ¶
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
func (*ResourceUsageSummary) SummaryKind ¶
func (s *ResourceUsageSummary) SummaryKind() 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 ¶
type SaturationTime ¶
type SchedulingMetrics ¶
type SchedulingMetrics struct { PredicateEvaluationLatency LatencyMetric `json:"predicateEvaluationLatency"` PriorityEvaluationLatency LatencyMetric `json:"priorityEvaluationLatency"` PreemptionEvaluationLatency LatencyMetric `json:"preemptionEvaluationLatency"` BindingLatency LatencyMetric `json:"bindingLatency"` ThroughputAverage float64 `json:"throughputAverage"` ThroughputPerc50 float64 `json:"throughputPerc50"` ThroughputPerc90 float64 `json:"throughputPerc90"` ThroughputPerc99 float64 `json:"throughputPerc99"` }
func VerifySchedulerLatency ¶
func VerifySchedulerLatency(c clientset.Interface) (*SchedulingMetrics, error)
Verifies (currently just by logging them) the scheduling latencies.
func (*SchedulingMetrics) PrintHumanReadable ¶
func (l *SchedulingMetrics) PrintHumanReadable() string
func (*SchedulingMetrics) PrintJSON ¶
func (l *SchedulingMetrics) PrintJSON() string
func (*SchedulingMetrics) SummaryKind ¶
func (l *SchedulingMetrics) SummaryKind() string
type ServiceTestFixture ¶
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 ¶
func NewServerTest(client clientset.Interface, namespace string, serviceName string) *ServiceTestFixture
func (*ServiceTestFixture) BuildServiceSpec ¶
func (t *ServiceTestFixture) BuildServiceSpec() *v1.Service
Build default config for a service (which can then be changed)
func (*ServiceTestFixture) Cleanup ¶
func (t *ServiceTestFixture) Cleanup() []error
func (*ServiceTestFixture) CreateRC ¶
func (t *ServiceTestFixture) CreateRC(rc *v1.ReplicationController) (*v1.ReplicationController, error)
CreateRC creates a replication controller and records it for cleanup.
func (*ServiceTestFixture) CreateService ¶
Create a service, and record it for cleanup
func (*ServiceTestFixture) CreateWebserverRC ¶
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 ¶
func (t *ServiceTestFixture) DeleteService(serviceName string) error
Delete a service, and remove it from the cleanup list
type ServiceTestJig ¶
type ServiceTestJig struct { ID string Name string Client clientset.Interface Labels map[string]string }
A test jig to help service testing.
func NewServiceTestJig ¶
func NewServiceTestJig(client clientset.Interface, name string) *ServiceTestJig
NewServiceTestJig allocates and inits a new ServiceTestJig.
func (*ServiceTestJig) AddRCAntiAffinity ¶
func (j *ServiceTestJig) AddRCAntiAffinity(rc *v1.ReplicationController)
func (*ServiceTestJig) ChangeServiceNodePortOrFail ¶
func (j *ServiceTestJig) ChangeServiceNodePortOrFail(namespace, name string, initial int) *v1.Service
func (*ServiceTestJig) ChangeServiceType ¶
func (j *ServiceTestJig) ChangeServiceType(namespace, name string, newType v1.ServiceType, timeout time.Duration)
func (*ServiceTestJig) CreateExternalNameServiceOrFail ¶
func (j *ServiceTestJig) CreateExternalNameServiceOrFail(namespace string, tweak func(svc *v1.Service)) *v1.Service
CreateExternalNameServiceOrFail creates a new ExternalName type Service based on the jig's defaults. Callers can provide a function to tweak the Service object before it is created.
func (*ServiceTestJig) CreateLoadBalancerService ¶
func (j *ServiceTestJig) CreateLoadBalancerService(namespace, serviceName string, timeout time.Duration, tweak func(svc *v1.Service)) *v1.Service
CreateLoadBalancerService creates a loadbalancer service and waits for it to acquire an ingress IP.
func (*ServiceTestJig) CreateOnlyLocalLoadBalancerService ¶
func (j *ServiceTestJig) CreateOnlyLocalLoadBalancerService(namespace, serviceName string, timeout time.Duration, createPod bool, tweak func(svc *v1.Service)) *v1.Service
CreateOnlyLocalLoadBalancerService creates a loadbalancer service with ExternalTrafficPolicy set to Local 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 ¶
func (j *ServiceTestJig) CreateOnlyLocalNodePortService(namespace, serviceName string, createPod bool) *v1.Service
CreateOnlyLocalNodePortService creates a NodePort service with ExternalTrafficPolicy set to Local 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) CreatePDBOrFail ¶
func (j *ServiceTestJig) CreatePDBOrFail(namespace string, rc *v1.ReplicationController) *policyv1beta1.PodDisruptionBudget
func (*ServiceTestJig) CreateServiceWithServicePort ¶
func (j *ServiceTestJig) CreateServiceWithServicePort(labels map[string]string, namespace string, ports []v1.ServicePort) (*v1.Service, error)
CreateServiceWithServicePort creates a new Service with ServicePort.
func (*ServiceTestJig) CreateTCPServiceOrFail ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (*ServiceTestJig) GetNodes ¶
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 ¶
func (j *ServiceTestJig) GetNodesNames(maxNodesForTest int) []string
func (*ServiceTestJig) LaunchEchoserverPodOnNode ¶
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 ¶
func (j *ServiceTestJig) LaunchNetexecPodOnNode(f *Framework, nodeName, podName string, httpPort, udpPort int32, hostNetwork bool)
func (*ServiceTestJig) RunOrFail ¶
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 ¶
func (j *ServiceTestJig) SanityCheckService(svc *v1.Service, svcType v1.ServiceType)
func (*ServiceTestJig) Scale ¶
func (j *ServiceTestJig) Scale(namespace string, replicas int)
func (*ServiceTestJig) TestHTTPHealthCheckNodePort ¶
func (*ServiceTestJig) TestNotReachableHTTP ¶
func (j *ServiceTestJig) TestNotReachableHTTP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestNotReachableUDP ¶
func (j *ServiceTestJig) TestNotReachableUDP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestReachableHTTP ¶
func (j *ServiceTestJig) TestReachableHTTP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestReachableHTTPWithRetriableErrorCodes ¶
func (*ServiceTestJig) TestReachableUDP ¶
func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestRejectedHTTP ¶
func (j *ServiceTestJig) TestRejectedHTTP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestRejectedUDP ¶
func (j *ServiceTestJig) TestRejectedUDP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) UpdateService ¶
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 ¶
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 ¶
func (j *ServiceTestJig) WaitForEndpointOnNode(namespace, serviceName, nodeName string)
func (*ServiceTestJig) WaitForLoadBalancerDestroyOrFail ¶
func (*ServiceTestJig) WaitForLoadBalancerOrFail ¶
func (*ServiceTestJig) WaitForNewIngressIPOrFail ¶
type SingleContainerSummary ¶
type SingleLogSummary ¶
type StatefulSetTester ¶
type StatefulSetTester struct {
// contains filtered or unexported fields
}
StatefulSetTester is a struct that contains utility methods for testing StatefulSet related functionality. It uses a clientset.Interface to communicate with the API server.
func NewStatefulSetTester ¶
func NewStatefulSetTester(c clientset.Interface) *StatefulSetTester
NewStatefulSetTester creates a StatefulSetTester that uses c to interact with the API server.
func (*StatefulSetTester) BreakHttpProbe ¶
func (s *StatefulSetTester) BreakHttpProbe(ss *apps.StatefulSet) error
BreakHttpProbe breaks the readiness probe for Nginx StatefulSet containers in ss.
func (*StatefulSetTester) BreakPodHttpProbe ¶
func (s *StatefulSetTester) BreakPodHttpProbe(ss *apps.StatefulSet, pod *v1.Pod) error
BreakPodHttpProbe breaks the readiness probe for Nginx StatefulSet containers in one pod.
func (*StatefulSetTester) CheckHostname ¶
func (s *StatefulSetTester) CheckHostname(ss *apps.StatefulSet) error
CheckHostname verifies that all Pods in ss have the correct Hostname. If the returned error is not nil than verification failed.
func (*StatefulSetTester) CheckMount ¶
func (s *StatefulSetTester) CheckMount(ss *apps.StatefulSet, mountPath string) error
CheckMount checks that the mount at mountPath is valid for all Pods in ss.
func (*StatefulSetTester) CheckServiceName ¶
func (p *StatefulSetTester) CheckServiceName(ss *apps.StatefulSet, expectedServiceName string) error
CheckServiceName asserts that the ServiceName for ss is equivalent to expectedServiceName.
func (*StatefulSetTester) ConfirmStatefulPodCount ¶
func (s *StatefulSetTester) ConfirmStatefulPodCount(count int, ss *apps.StatefulSet, timeout time.Duration, hard bool)
ConfirmStatefulPodCount asserts that the current number of Pods in ss is count waiting up to timeout for ss to to scale to count.
func (*StatefulSetTester) CreateStatefulSet ¶
func (s *StatefulSetTester) CreateStatefulSet(manifestPath, ns string) *apps.StatefulSet
CreateStatefulSet creates a StatefulSet from the manifest at manifestPath in the Namespace ns using kubectl create.
func (*StatefulSetTester) DeleteStatefulPodAtIndex ¶
func (s *StatefulSetTester) DeleteStatefulPodAtIndex(index int, ss *apps.StatefulSet)
DeleteStatefulPodAtIndex deletes the Pod with ordinal index in ss.
func (*StatefulSetTester) ExecInStatefulPods ¶
func (s *StatefulSetTester) ExecInStatefulPods(ss *apps.StatefulSet, cmd string) error
ExecInStatefulPods executes cmd in all Pods in ss. If a error occurs it is returned and cmd is not execute in any subsequent Pods.
func (*StatefulSetTester) GetPodList ¶
func (s *StatefulSetTester) GetPodList(ss *apps.StatefulSet) *v1.PodList
GetPodList gets the current Pods in ss.
func (*StatefulSetTester) GetStatefulSet ¶
func (s *StatefulSetTester) GetStatefulSet(namespace, name string) *apps.StatefulSet
GetStatefulSet gets the StatefulSet named name in namespace.
func (*StatefulSetTester) PauseNewPods ¶
func (s *StatefulSetTester) PauseNewPods(ss *apps.StatefulSet)
PauseNewPods adds an always-failing ReadinessProbe to the StatefulSet PodTemplate. This causes all newly-created Pods to stay Unready until they are manually resumed with ResumeNextPod(). Note that this cannot be used together with SetHttpProbe().
func (*StatefulSetTester) Restart ¶
func (s *StatefulSetTester) Restart(ss *apps.StatefulSet)
Restart scales ss to 0 and then back to its previous number of replicas.
func (*StatefulSetTester) RestoreHttpProbe ¶
func (s *StatefulSetTester) RestoreHttpProbe(ss *apps.StatefulSet) error
RestoreHttpProbe restores the readiness probe for Nginx StatefulSet containers in ss.
func (*StatefulSetTester) RestorePodHttpProbe ¶
func (s *StatefulSetTester) RestorePodHttpProbe(ss *apps.StatefulSet, pod *v1.Pod) error
RestorePodHttpProbe restores the readiness probe for Nginx StatefulSet containers in pod.
func (*StatefulSetTester) ResumeNextPod ¶
func (s *StatefulSetTester) ResumeNextPod(ss *apps.StatefulSet)
ResumeNextPod allows the next Pod in the StatefulSet to continue by removing the ReadinessProbe added by PauseNewPods(), if it's still there. It fails the test if it finds any pods that are not in phase Running, or if it finds more than one paused Pod existing at the same time. This is a no-op if there are no paused pods.
func (*StatefulSetTester) Saturate ¶
func (s *StatefulSetTester) Saturate(ss *apps.StatefulSet)
Saturate waits for all Pods in ss to become Running and Ready.
func (*StatefulSetTester) Scale ¶
func (s *StatefulSetTester) Scale(ss *apps.StatefulSet, count int32) (*apps.StatefulSet, error)
Scale scales ss to count replicas.
func (*StatefulSetTester) SetHttpProbe ¶
func (s *StatefulSetTester) SetHttpProbe(ss *apps.StatefulSet)
SetHttpProbe sets the pod template's ReadinessProbe for Nginx StatefulSet containers. This probe can then be controlled with BreakHttpProbe() and RestoreHttpProbe(). Note that this cannot be used together with PauseNewPods().
func (*StatefulSetTester) SortStatefulPods ¶
func (s *StatefulSetTester) SortStatefulPods(pods *v1.PodList)
SortStatefulPods sorts pods by their ordinals
func (*StatefulSetTester) UpdateReplicas ¶
func (s *StatefulSetTester) UpdateReplicas(ss *apps.StatefulSet, count int32)
UpdateReplicas updates the replicas of ss to count.
func (*StatefulSetTester) VerifyPodAtIndex ¶
func (s *StatefulSetTester) VerifyPodAtIndex(index int, ss *apps.StatefulSet, verify VerifyStatefulPodFunc)
VerifyPodAtIndex applies a visitor patter to the Pod at index in ss. verify is applied to the Pod to "visit" it.
func (*StatefulSetTester) WaitForPartitionedRollingUpdate ¶
func (s *StatefulSetTester) WaitForPartitionedRollingUpdate(set *apps.StatefulSet) (*apps.StatefulSet, *v1.PodList)
WaitForPartitionedRollingUpdate waits for all Pods in set to exist and have the correct revision. set must have a RollingUpdateStatefulSetStrategyType with a non-nil RollingUpdate and Partition. All Pods with ordinals less than or equal to the Partition are expected to be at set's current revision. All other Pods are expected to be at its update revision.
func (*StatefulSetTester) WaitForPodNotReady ¶
func (s *StatefulSetTester) WaitForPodNotReady(set *apps.StatefulSet, podName string) (*apps.StatefulSet, *v1.PodList)
WaitForPodNotReady waist for the Pod named podName in set to exist and to not have a Ready condition.
func (*StatefulSetTester) WaitForPodReady ¶
func (s *StatefulSetTester) WaitForPodReady(set *apps.StatefulSet, podName string) (*apps.StatefulSet, *v1.PodList)
WaitForPodReady waits for the Pod named podName in set to exist and have a Ready condition.
func (*StatefulSetTester) WaitForRollingUpdate ¶
func (s *StatefulSetTester) WaitForRollingUpdate(set *apps.StatefulSet) (*apps.StatefulSet, *v1.PodList)
WaitForRollingUpdate waits for all Pods in set to exist and have the correct revision and for the RollingUpdate to complete. set must have a RollingUpdateStatefulSetStrategyType.
func (*StatefulSetTester) WaitForRunning ¶
func (s *StatefulSetTester) WaitForRunning(numPodsRunning, numPodsReady int32, ss *apps.StatefulSet)
WaitForRunning waits for numPodsRunning in ss to be Running and for the first numPodsReady ordinals to be Ready.
func (*StatefulSetTester) WaitForRunningAndNotReady ¶
func (s *StatefulSetTester) WaitForRunningAndNotReady(numStatefulPods int32, ss *apps.StatefulSet)
WaitForRunningAndReady waits for numStatefulPods in ss to be Running and not Ready.
func (*StatefulSetTester) WaitForRunningAndReady ¶
func (s *StatefulSetTester) WaitForRunningAndReady(numStatefulPods int32, ss *apps.StatefulSet)
WaitForRunningAndReady waits for numStatefulPods in ss to be Running and Ready.
func (*StatefulSetTester) WaitForState ¶
func (s *StatefulSetTester) WaitForState(ss *apps.StatefulSet, until func(*apps.StatefulSet, *v1.PodList) (bool, error))
WaitForState periodically polls for the ss and its pods until the until function returns either true or an error
func (*StatefulSetTester) WaitForStatus ¶
func (s *StatefulSetTester) WaitForStatus(set *apps.StatefulSet) *apps.StatefulSet
WaitForStatus waits for the StatefulSetStatus's ObservedGeneration to be greater than or equal to set's Generation. The returned StatefulSet contains such a StatefulSetStatus
func (*StatefulSetTester) WaitForStatusReadyReplicas ¶
func (s *StatefulSetTester) WaitForStatusReadyReplicas(ss *apps.StatefulSet, expectedReplicas int32)
WaitForStatusReadyReplicas waits for the ss.Status.ReadyReplicas to be equal to expectedReplicas
func (*StatefulSetTester) WaitForStatusReplicas ¶
func (s *StatefulSetTester) WaitForStatusReplicas(ss *apps.StatefulSet, expectedReplicas int32)
WaitForStatusReplicas waits for the ss.Status.Replicas to be equal to expectedReplicas
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 DockershimCheckpointDir string // ListImages will list off all images that are used then quit ListImages bool // Provider identifies the infrastructure provider (gce, gke, aws) Provider string // Tooling is the tooling in use (e.g. kops, gke). Provider is the cloud provider and might not uniquely identify the tooling. Tooling 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 EtcdUpgradeStorage string EtcdUpgradeVersion string IngressUpgradeImage string GCEUpgradeScript string ContainerRuntime string ContainerRuntimeEndpoint string ContainerRuntimeProcessName string ContainerRuntimePidFile string // SystemdServices are comma separated list of systemd services the test framework // will dump logs for. SystemdServices string // DumpSystemdJournal controls whether to dump the full systemd journal. DumpSystemdJournal bool ImageServiceEndpoint 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 string GatherSuiteMetricsAfterTest bool MaxNodesToGather int AllowGatheringProfiles bool // If set to 'true' framework will gather ClusterAutoscaler metrics when gathering them for other components. IncludeClusterAutoscalerMetrics 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 // SystemDaemonsetStartupTimeout is the timeout for waiting for all system daemonsets to be ready. SystemDaemonsetStartupTimeout 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 // Disables dumping cluster log from master and nodes after all tests. DisableLogDump bool // Path to the GCS artifacts directory to dump logs from nodes. Logexporter gets enabled if this is non-empty. LogexporterGCSPath string // featureGates is a map of feature names to bools that enable or disable alpha/experimental features. FeatureGates map[string]bool // Node e2e specific test context NodeTestContextType // Monitoring solution that is used in current cluster. ClusterMonitoringMode string // Separate Prometheus monitoring deployed in cluster EnablePrometheusMonitoring bool // Indicates what path the kubernetes-anywhere is installed on KubernetesAnywherePath string // The DNS Domain of the cluster. ClusterDNSDomain string // The configration of NodeKiller. NodeKiller NodeKillerConfig }
TestContextType contains test settings and global state. Due to historic reasons, it is a mixture of items managed by the test framework itself, cloud providers and individual tests. The goal is to move anything not required by the framework into the code which uses the settings.
The recommendation for those settings is:
- They are stored in their own context structure or local variables.
- The standard `flag` package is used to register them. The flag name should follow the pattern <part1>.<part2>....<partn> where the prefix is unlikely to conflict with other tests or standard packages and each part is in lower camel case. For example, test/e2e/storage/csi/context.go could define storage.csi.numIterations.
- framework/config can be used to simplify the registration of multiple options with a single function call: var storageCSI { NumIterations `default:"1" usage:"number of iterations"` } _ config.AddOptions(&storageCSI, "storage.csi")
- The direct use Viper in tests is possible, but discouraged because it only works in test suites which use Viper (which is not required) and the supported options cannot be discovered by a test suite user.
Test suite authors can use framework/viper to make all command line parameters also configurable via a configuration file.
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.
type UDPPokeParams ¶
type UDPPokeResult ¶
type UDPPokeResult struct { Status UDPPokeStatus Error error // if there was any error Response []byte // if code != 0 }
func PokeUDP ¶
func PokeUDP(host string, port int, request string, params *UDPPokeParams) UDPPokeResult
PokeUDP tries to connect to a host on a port and send the given request. Callers can specify additional success parameters, if desired.
The result status will be characterized as precisely as possible, given the known users of this.
The result error will be populated for any status other than Success.
The result response will be populated if the UDP transaction was completed, even if the other test params make this a failure).
type UDPPokeStatus ¶
type UDPPokeStatus string
const ( UDPSuccess UDPPokeStatus = "Success" UDPError UDPPokeStatus = "UnknownError" // Any time we add new errors, we should audit all callers of this. UDPTimeout UDPPokeStatus = "TimedOut" UDPRefused UDPPokeStatus = "ConnectionRefused" UDPBadResponse UDPPokeStatus = "BadResponse" )
type VerifyStatefulPodFunc ¶
VerifyStatefulPodFunc is a func that examines a StatefulSetPod.
type VolumeTest ¶
type VolumeTest struct { Volume v1.VolumeSource File string ExpectedContent string }
VolumeTest contains a volume to mount into a client pod and its expected content.
type VolumeTestConfig ¶
type VolumeTestConfig struct { Namespace string // Prefix of all pods. Typically the test name. Prefix string // Name of container image for the server pod. ServerImage string // Ports to export from the server pod. TCP only. ServerPorts []int // Commands to run in the container image. ServerCmds []string // Arguments to pass to the container image. ServerArgs []string // Volumes needed to be mounted to the server container from the host // map <host (source) path> -> <container (dst.) path> // if <host (source) path> is empty, mount a tmpfs emptydir ServerVolumes map[string]string // Message to wait for before starting clients ServerReadyMessage string // Wait for the pod to terminate successfully // False indicates that the pod is long running WaitForCompletion bool // ServerNodeName is the spec.nodeName to run server pod on. Default is any node. ServerNodeName string // ClientNodeName is the spec.nodeName to run client pod on. Default is any node. ClientNodeName string // NodeSelector to use in pod spec (server, client and injector pods). NodeSelector map[string]string }
Configuration of one tests. The test consist of: - server pod - runs serverImage, exports ports[] - client pod - does not need any special configuration
func NewGlusterfsServer ¶
func NewGlusterfsServer(cs clientset.Interface, namespace string) (config VolumeTestConfig, pod *v1.Pod, ip string)
GlusterFS-specific wrapper for CreateStorageServer. Also creates the gluster endpoints object.
func NewISCSIServer ¶
func NewISCSIServer(cs clientset.Interface, namespace string) (config VolumeTestConfig, pod *v1.Pod, ip string)
iSCSI-specific wrapper for CreateStorageServer.
func NewNFSServer ¶
func NewNFSServer(cs clientset.Interface, namespace string, args []string) (config VolumeTestConfig, pod *v1.Pod, ip string)
NFS-specific wrapper for CreateStorageServer.
type What ¶
type What struct {
Kind string `json:"kind"`
}
What is a subset of metav1.TypeMeta which (in contrast to metav1.TypeMeta itself) satisfies the runtime.Object interface.
func (*What) DeepCopyInto ¶
func (*What) DeepCopyObject ¶
func (*What) GetObjectKind ¶
func (in *What) GetObjectKind() schema.ObjectKind
Source Files ¶
- authorizer_util.go
- cleanup.go
- create.go
- deployment_util.go
- exec_util.go
- flake_reporting_util.go
- framework.go
- get-kubemark-resource-usage.go
- google_compute.go
- gpu_util.go
- jobs_util.go
- kubelet_stats.go
- log_size_monitoring.go
- metrics_util.go
- networking_utils.go
- nodes_util.go
- perf_util.go
- pods.go
- profile_gatherer.go
- provider.go
- psp_util.go
- pv_util.go
- rc_util.go
- resource_usage_gatherer.go
- rs_util.go
- service_util.go
- size.go
- ssh.go
- statefulset_utils.go
- test_context.go
- upgrade_util.go
- util.go
- volume_util.go
Directories ¶
Path | Synopsis |
---|---|
Package config simplifies the declaration of configuration options.
|
Package config simplifies the declaration of configuration options. |
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string.
|
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string. |
Package podlogs enables live capturing of all events and log messages for some or all pods in a namespace as they get generated.
|
Package podlogs enables live capturing of all events and log messages for some or all pods in a namespace as they get generated. |
providers
|
|
Package testfiles provides a wrapper around various optional ways of retrieving additional files needed during a test run: - builtin bindata - filesystem access
|
Package testfiles provides a wrapper around various optional ways of retrieving additional files needed during a test run: - builtin bindata - filesystem access |