Documentation

Overview

    This is a utility for prometheus pushing functionality.

    Index

    Constants

    View Source
    const (
    	ADD    = "ADD"
    	DEL    = "DEL"
    	UPDATE = "UPDATE"
    )
    View Source
    const (
    	NodeStartupThreshold       = 4 * time.Second
    	MinSaturationThreshold     = 2 * time.Minute
    	MinPodsPerSecondThroughput = 8
    )

      NodeStartupThreshold is a rough estimate of the time allocated for a pod to start on a node.

      Variables

      View Source
      var InterestingApiServerMetrics = []string{
      	"apiserver_request_count",
      	"apiserver_request_latencies_summary",
      	"etcd_helper_cache_entry_count",
      	"etcd_helper_cache_hit_count",
      	"etcd_helper_cache_miss_count",
      	"etcd_request_cache_add_latencies_summary",
      	"etcd_request_cache_get_latencies_summary",
      	"etcd_request_latencies_summary",
      }
      View Source
      var InterestingKubeletMetrics = []string{
      	"kubelet_container_manager_latency_microseconds",
      	"kubelet_docker_errors",
      	"kubelet_docker_operations_latency_microseconds",
      	"kubelet_generate_pod_status_latency_microseconds",
      	"kubelet_pod_start_latency_microseconds",
      	"kubelet_pod_worker_latency_microseconds",
      	"kubelet_pod_worker_start_latency_microseconds",
      	"kubelet_sync_pods_latency_microseconds",
      }
      View Source
      var MaxContainerFailures = 0

        Maximum container failures this test tolerates before failing.

        View Source
        var ServiceNodePortRange = utilnet.PortRange{Base: 30000, Size: 2768}

          This should match whatever the default/configured range is

          Functions

          func BadEvents

          func BadEvents(events []*api.Event) int

            Prints the histogram of the events and returns the number of bad events.

            func CheckCadvisorHealthOnAllNodes

            func CheckCadvisorHealthOnAllNodes(c *client.Client, timeout time.Duration)

            func CheckConnectivityToHost

            func CheckConnectivityToHost(f *Framework, nodeName, podName, host string) error

              CheckConnectivityToHost launches a pod running wget on the specified node to test connectivity to the specified host. An error will be returned if the host is not reachable from the pod.

              func ClusterLevelLoggingWithElasticsearch

              func ClusterLevelLoggingWithElasticsearch(f *Framework)

                ClusterLevelLoggingWithElasticsearch is an end to end test for cluster level logging.

                func ClusterLevelLoggingWithKibana

                func ClusterLevelLoggingWithKibana(f *Framework)

                  ClusterLevelLoggingWithKibana is an end to end test that checks to see if Kibana is alive.

                  func CoreDump

                  func CoreDump(dir string)

                    CoreDump SSHs to the master and all nodes and dumps their logs into dir. It shells out to cluster/log-dump.sh to accomplish this.

                    func CreateTestingNS

                    func CreateTestingNS(baseName string, c *client.Client, labels map[string]string) (*api.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 DeleteRC

                      func DeleteRC(c *client.Client, ns, name string) error

                        Delete a Replication Controller and all pods it spawned

                        func DeleteReplicaSet

                        func DeleteReplicaSet(c *client.Client, ns, name string) error

                          Delete a ReplicaSet and all pods it spawned

                          func EnsureLoadBalancerResourcesDeleted

                          func EnsureLoadBalancerResourcesDeleted(ip, portRange string) error

                            EnsureLoadBalancerResourcesDeleted ensures that cloud load balancer resources that were created are actually cleaned up. Currently only implemented for GCE/GKE.

                            func FailedContainers

                            func FailedContainers(pod *api.Pod) map[string]ContainerFailures

                              FailedContainers inspects all containers in a pod and returns failure information for containers that have failed or been restarted. A map is returned where the key is the containerID and the value is a struct containing the restart and failure information

                              func Failf

                              func Failf(format string, args ...interface{})

                              func GetKubeletPods

                              func GetKubeletPods(c *client.Client, node string) (*api.PodList, error)

                                GetKubeletPods 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 GetReadyNodes

                                func GetReadyNodes(f *Framework) (nodes *api.NodeList, err error)

                                  GetReadyNodes retrieves a list of schedulable nodes whose condition is Ready. An error will be returned if no such nodes are found.

                                  func GetServicesProxyRequest

                                  func GetServicesProxyRequest(c *client.Client, request *restclient.Request) (*restclient.Request, error)

                                  func HighLatencyRequests

                                  func HighLatencyRequests(c *client.Client) (int, error)

                                    Prints top five summary metrics for request types with latency and returns number of such request types above threshold.

                                    func LaunchHostExecPod

                                    func LaunchHostExecPod(client *client.Client, ns, name string) *api.Pod

                                      LaunchHostExecPod launches a hostexec pod in the given namespace and waits until it's Running

                                      func LaunchNetTestPodPerNode

                                      func LaunchNetTestPodPerNode(f *Framework, nodes *api.NodeList, name, version string) []string

                                      func LaunchWebserverPod

                                      func LaunchWebserverPod(f *Framework, podName, nodeName string) (ip string)

                                        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 ListSchedulableNodesOrDie

                                        func ListSchedulableNodesOrDie(c *client.Client) *api.NodeList

                                          Convenient wrapper around listing nodes supporting retries.

                                          func LogSSHResult

                                          func LogSSHResult(result SSHResult)

                                          func Logf

                                          func Logf(format string, args ...interface{})

                                          func NewHostExecPodSpec

                                          func NewHostExecPodSpec(ns, name string) *api.Pod

                                            NewHostExecPodSpec returns the pod spec of hostexec pod

                                            func NewResourceUsageGatherer

                                            func NewResourceUsageGatherer(c *client.Client) (*containerResourceGatherer, error)

                                            func NewRestartConfig

                                            func NewRestartConfig(nodeName, daemonName string, healthzPort int, pollInterval, pollTimeout time.Duration) *restartDaemonConfig

                                              NewRestartConfig creates a restartDaemonConfig for the given node and daemon.

                                              func NodeAddresses

                                              func NodeAddresses(nodelist *api.NodeList, addrType api.NodeAddressType) []string

                                                NodeAddresses returns the first address of the given type of each node.

                                                func NodeSSHHosts

                                                func NodeSSHHosts(c *client.Client) ([]string, error)

                                                  NodeSSHHosts returns SSH-able host names for all schedulable nodes - this excludes master node. It returns an error if it can't find an external IP for every node, though it still returns all hosts that it found in that case.

                                                  func OpenWebSocketForURL

                                                  func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []string) (*websocket.Conn, error)

                                                    OpenWebSocketForURL constructs a websocket connection to the provided URL, using the client config, with the specified protocols.

                                                    func PrintAllKubeletPods

                                                    func PrintAllKubeletPods(c *client.Client, nodeName string)

                                                    func Query

                                                    func Query(c *client.Client, query string) (*influxdb.Response, error)

                                                      Query sends a command to the server and returns the Response

                                                      func RegisterFlags

                                                      func RegisterFlags()

                                                      func RemoveCleanupAction

                                                      func RemoveCleanupAction(p CleanupActionHandle)

                                                        RemoveCleanupAction removes a function that was installed by AddCleanupAction.

                                                        func ReplicaSetServeImageOrFail

                                                        func ReplicaSetServeImageOrFail(f *Framework, test string, image string)

                                                          A basic test to check the deployment of an image using a ReplicaSet. The image serves its hostname which is checked for each replica.

                                                          func ReserveCpu

                                                          func ReserveCpu(f *Framework, id string, millicores int)

                                                          func ReserveMemory

                                                          func ReserveMemory(f *Framework, id string, megabytes int)

                                                          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 RunDeployment

                                                            func RunDeployment(config DeploymentConfig) error

                                                              RunDeployment Launches (and verifies correctness) of a Deployment and will wait for all pods it spawns to become "Running". It's the caller's responsibility to clean up externally (i.e. use the namespace lifecycle for handling cleanup).

                                                              func RunE2ETests

                                                              func RunE2ETests(t *testing.T)

                                                                TestE2E checks configuration parameters (specified through flags) and then runs E2E tests using the Ginkgo runner. If a "report directory" is specified, one or more JUnit test reports will be generated in this directory, and cluster logs will also be saved. This function is called on each Ginkgo node in parallel mode.

                                                                func RunHostCmd

                                                                func RunHostCmd(ns, name, cmd string) (string, error)

                                                                  RunHostCmd runs the given cmd in the context of the given pod using `kubectl exec` inside of a shell.

                                                                  func RunHostCmdOrDie

                                                                  func RunHostCmdOrDie(ns, name, cmd string) string

                                                                    RunHostCmdOrDie calls RunHostCmd and dies on error.

                                                                    func RunRC

                                                                    func RunRC(config RCConfig) error

                                                                      RunRC Launches (and verifies correctness) of a Replication Controller and will wait for all pods it spawns to become "Running". It's the caller's responsibility to clean up externally (i.e. use the namespace lifecycle for handling cleanup).

                                                                      func RunReplicaSet

                                                                      func RunReplicaSet(config ReplicaSetConfig) error

                                                                        RunReplicaSet launches (and verifies correctness) of a ReplicaSet and waits until all the pods it launches to reach the "Running" state. It's the caller's responsibility to clean up externally (i.e. use the namespace lifecycle for handling cleanup).

                                                                        func ScaleRC

                                                                        func ScaleRC(c *client.Client, ns, name string, size uint, wait bool) error

                                                                        func ServeImageOrFail

                                                                        func ServeImageOrFail(f *Framework, test string, image string)

                                                                          A basic test to check the deployment of an image using a replication controller. The image serves its hostname which is checked for each replica.

                                                                          func SetTestContext

                                                                          func SetTestContext(t TestContextType)

                                                                          func SkipIfProviderIs

                                                                          func SkipIfProviderIs(unsupportedProviders ...string)

                                                                          func SkipUnlessAtLeast

                                                                          func SkipUnlessAtLeast(value int, minValue int, message string)

                                                                          func SkipUnlessNodeCountIsAtLeast

                                                                          func SkipUnlessNodeCountIsAtLeast(minNodeCount int)

                                                                          func SkipUnlessProviderIs

                                                                          func SkipUnlessProviderIs(supportedProviders ...string)

                                                                          func SkipUnlessServerVersionGTE

                                                                          func SkipUnlessServerVersionGTE(v semver.Version, c discovery.ServerVersionInterface)

                                                                          func Skipf

                                                                          func Skipf(format string, args ...interface{})

                                                                          func SpreadRCOrFail

                                                                          func SpreadRCOrFail(f *Framework, replicaCount int, image string)

                                                                            Check that the pods comprising a replication controller get spread evenly across available zones

                                                                            func SpreadServiceOrFail

                                                                            func SpreadServiceOrFail(f *Framework, replicaCount int, image string)

                                                                              Check that the pods comprising a service get spread evenly across available zones

                                                                              func VerifyPodStartupLatency

                                                                              func VerifyPodStartupLatency(latency PodStartupLatency) error

                                                                                Verifies whether 50, 90 and 99th percentiles of PodStartupLatency are within the threshold.

                                                                                func VerifySchedulerLatency

                                                                                func VerifySchedulerLatency(c *client.Client) error

                                                                                  Verifies (currently just by logging them) the scheduling latencies.

                                                                                  Types

                                                                                  type APICall

                                                                                  type APICall struct {
                                                                                  	Resource string        `json:"resource"`
                                                                                  	Verb     string        `json:"verb"`
                                                                                  	Latency  LatencyMetric `json:"latency"`
                                                                                  }

                                                                                  type APIResponsiveness

                                                                                  type APIResponsiveness struct {
                                                                                  	APICalls []APICall `json:"apicalls"`
                                                                                  }

                                                                                  func (APIResponsiveness) Len

                                                                                  func (a APIResponsiveness) Len() int

                                                                                  func (APIResponsiveness) Less

                                                                                  func (a APIResponsiveness) Less(i, j int) bool

                                                                                  func (APIResponsiveness) Swap

                                                                                  func (a APIResponsiveness) Swap(i, j int)

                                                                                  type CleanupActionHandle

                                                                                  type CleanupActionHandle *int

                                                                                  func AddCleanupAction

                                                                                  func AddCleanupAction(fn func()) CleanupActionHandle

                                                                                    AddCleanupAction installs a function that will be called in the event of the whole test being terminated. This allows arbitrary pieces of the overall test to hook into SynchronizedAfterSuite().

                                                                                    type CloudConfig

                                                                                    type CloudConfig struct {
                                                                                    	ProjectID         string
                                                                                    	Zone              string
                                                                                    	Cluster           string
                                                                                    	MasterName        string
                                                                                    	NodeInstanceGroup string
                                                                                    	NumNodes          int
                                                                                    	ClusterTag        string
                                                                                    	ServiceAccount    string
                                                                                    
                                                                                    	Provider cloudprovider.Interface
                                                                                    }

                                                                                    type ContainerFailures

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

                                                                                    type CreateTestingNSFn

                                                                                    type CreateTestingNSFn func(baseName string, c *client.Client, labels map[string]string) (*api.Namespace, error)

                                                                                    type DeploymentConfig

                                                                                    type DeploymentConfig struct {
                                                                                    	RCConfig
                                                                                    }

                                                                                    type Framework

                                                                                    type Framework struct {
                                                                                    	BaseName string
                                                                                    
                                                                                    	Client        *client.Client
                                                                                    	Clientset_1_2 *release_1_2.Clientset
                                                                                    
                                                                                    	Namespace *api.Namespace // Every test has at least one namespace
                                                                                    
                                                                                    	NamespaceDeletionTimeout time.Duration
                                                                                    	// 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

                                                                                      func NewDefaultFramework(baseName string) *Framework

                                                                                        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) *Framework

                                                                                        func (*Framework) CreateNamespace

                                                                                        func (f *Framework) CreateNamespace(baseName string, labels map[string]string) (*api.Namespace, error)

                                                                                        func (*Framework) ReadFileViaContainer

                                                                                        func (f *Framework) ReadFileViaContainer(podName, containerName string, path string) (string, error)

                                                                                          Read a file using kubectl exec cat <path>

                                                                                          func (*Framework) TestContainerOutput

                                                                                          func (f *Framework) TestContainerOutput(scenarioName string, pod *api.Pod, containerIndex int, expectedOutput []string)

                                                                                            Runs the given pod and verifies that the output of exact container matches the desired output.

                                                                                            func (*Framework) TestContainerOutputRegexp

                                                                                            func (f *Framework) TestContainerOutputRegexp(scenarioName string, pod *api.Pod, containerIndex int, expectedOutput []string)

                                                                                              Runs the given pod and verifies that the output of exact container matches the desired regexps.

                                                                                              func (*Framework) WaitForAnEndpoint

                                                                                              func (f *Framework) WaitForAnEndpoint(serviceName string) error

                                                                                                WaitForAnEndpoint waits for at least one endpoint to become available in the service's corresponding endpoints object.

                                                                                                func (*Framework) WaitForPodNoLongerRunning

                                                                                                func (f *Framework) WaitForPodNoLongerRunning(podName string) error

                                                                                                  WaitForPodNoLongerRunning waits for the pod to no longer be running in the namespace, for either success or failure.

                                                                                                  func (*Framework) WaitForPodReady

                                                                                                  func (f *Framework) WaitForPodReady(podName string) error

                                                                                                    WaitForPodReady waits for the pod to flip to ready in the namespace.

                                                                                                    func (*Framework) WaitForPodRunning

                                                                                                    func (f *Framework) WaitForPodRunning(podName string) error

                                                                                                      WaitForPodRunning waits for the pod to run in the namespace.

                                                                                                      func (*Framework) WaitForPodRunningSlow

                                                                                                      func (f *Framework) WaitForPodRunningSlow(podName string) error

                                                                                                        WaitForPodRunningSlow waits for the pod to run in the namespace. It has a longer timeout then WaitForPodRunning (util.slowPodStartTimeout).

                                                                                                        func (*Framework) WaitForPodTerminated

                                                                                                        func (f *Framework) WaitForPodTerminated(podName, reason string) error

                                                                                                          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 {
                                                                                                            	// contains filtered or unexported fields
                                                                                                            }

                                                                                                            type HPAScaleTest

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

                                                                                                              HPAScaleTest struct is used by the scale(...) function.

                                                                                                              type IngressController

                                                                                                              type IngressController struct {
                                                                                                              	UID     string
                                                                                                              	Project string
                                                                                                              	// contains filtered or unexported fields
                                                                                                              }

                                                                                                              func (*IngressController) Cleanup

                                                                                                              func (cont *IngressController) Cleanup(del bool) error

                                                                                                              type KubeProxyTestConfig

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

                                                                                                              type KubeletManagedHostConfig

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

                                                                                                              type KubeletMetric

                                                                                                              type KubeletMetric 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

                                                                                                                func HighLatencyKubeletOperations

                                                                                                                func HighLatencyKubeletOperations(c *client.Client, threshold time.Duration, nodeName string) ([]KubeletMetric, error)

                                                                                                                  HighLatencyKubeletOperations logs and counts the high latency metrics exported by the kubelet server via /metrics.

                                                                                                                  func ParseKubeletMetrics

                                                                                                                  func ParseKubeletMetrics(metricsBlob string) ([]KubeletMetric, error)

                                                                                                                    ParseKubeletMetrics reads metrics from the kubelet server running on the given node

                                                                                                                    type KubeletMetricByLatency

                                                                                                                    type KubeletMetricByLatency []KubeletMetric

                                                                                                                      KubeletMetricByLatency implements sort.Interface for []KubeletMetric based on the latency field.

                                                                                                                      func (KubeletMetricByLatency) Len

                                                                                                                      func (a KubeletMetricByLatency) Len() int

                                                                                                                      func (KubeletMetricByLatency) Less

                                                                                                                      func (a KubeletMetricByLatency) Less(i, j int) bool

                                                                                                                      func (KubeletMetricByLatency) Swap

                                                                                                                      func (a KubeletMetricByLatency) Swap(i, j int)

                                                                                                                      type LBCTester

                                                                                                                      type LBCTester interface {
                                                                                                                      	// contains filtered or unexported methods
                                                                                                                      }

                                                                                                                        LBCTester is an interface used to test loadbalancer controllers.

                                                                                                                        type LatencyMetric

                                                                                                                        type LatencyMetric struct {
                                                                                                                        	Perc50 time.Duration `json:"Perc50"`
                                                                                                                        	Perc90 time.Duration `json:"Perc90"`
                                                                                                                        	Perc99 time.Duration `json:"Perc99"`
                                                                                                                        }

                                                                                                                          Dashboard metrics

                                                                                                                          type LogSizeDataTimeseries

                                                                                                                          type LogSizeDataTimeseries map[string]map[string][]TimestampedSize

                                                                                                                          type LogSizeGatherer

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

                                                                                                                            LogSizeGatherer is a worker which grabs a WorkItem from the channel and does assigned work.

                                                                                                                            func (*LogSizeGatherer) Run

                                                                                                                            func (g *LogSizeGatherer) Run()

                                                                                                                            func (*LogSizeGatherer) Work

                                                                                                                            func (g *LogSizeGatherer) Work() bool

                                                                                                                              Work does a single unit of work: tries to take out a WorkItem from the queue, ssh-es into a given machine, gathers data, writes it to the shared <data> map, and creates a gorouting which reinserts work item into the queue with a <pollingPeriod> delay. Returns false if worker should exit.

                                                                                                                              type LogsSizeData

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

                                                                                                                              func (*LogsSizeData) AddNewData

                                                                                                                              func (d *LogsSizeData) AddNewData(ip, path string, timestamp time.Time, size int)

                                                                                                                              type LogsSizeDataSummary

                                                                                                                              type LogsSizeDataSummary map[string]map[string]SingleLogSummary

                                                                                                                                node -> file -> data

                                                                                                                                func (*LogsSizeDataSummary) PrintHumanReadable

                                                                                                                                func (s *LogsSizeDataSummary) PrintHumanReadable() string

                                                                                                                                  TODO: make sure that we don't need locking here

                                                                                                                                  func (*LogsSizeDataSummary) PrintJSON

                                                                                                                                  func (s *LogsSizeDataSummary) PrintJSON() string

                                                                                                                                  type LogsSizeVerifier

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

                                                                                                                                    LogsSizeVerifier gathers data about log files sizes from master and node machines. It oversees a <workersNo> workers which do the gathering.

                                                                                                                                    func NewLogsVerifier

                                                                                                                                    func NewLogsVerifier(c *client.Client, stopChannel chan bool) *LogsSizeVerifier

                                                                                                                                      NewLogsVerifier creates a new LogsSizeVerifier which will stop when stopChannel is closed

                                                                                                                                      func (*LogsSizeVerifier) GetSummary

                                                                                                                                      func (s *LogsSizeVerifier) GetSummary() *LogsSizeDataSummary

                                                                                                                                        GetSummary returns a summary (average generation rate and number of probes) of the data gathered by LogSizeVerifier

                                                                                                                                        func (*LogsSizeVerifier) Run

                                                                                                                                        func (v *LogsSizeVerifier) Run()

                                                                                                                                          Run starts log size gathering. It starts a gorouting for every worker and then blocks until stopChannel is closed

                                                                                                                                          type MetricsForE2E

                                                                                                                                          type MetricsForE2E metrics.MetricsCollection

                                                                                                                                          func (*MetricsForE2E) PrintHumanReadable

                                                                                                                                          func (m *MetricsForE2E) PrintHumanReadable() string

                                                                                                                                          func (*MetricsForE2E) PrintJSON

                                                                                                                                          func (m *MetricsForE2E) PrintJSON() string

                                                                                                                                          type PodDiff

                                                                                                                                          type PodDiff map[string]*podInfo

                                                                                                                                            PodDiff is a map of pod name to podInfos

                                                                                                                                            func Diff

                                                                                                                                            func Diff(oldPods []*api.Pod, curPods []*api.Pod) PodDiff

                                                                                                                                              Diff computes a PodDiff given 2 lists of pods.

                                                                                                                                              func (PodDiff) Print

                                                                                                                                              func (p PodDiff) Print(ignorePhases sets.String)

                                                                                                                                                Print formats and prints the give PodDiff.

                                                                                                                                                type PodStartupLatency

                                                                                                                                                type PodStartupLatency struct {
                                                                                                                                                	Latency LatencyMetric `json:"latency"`
                                                                                                                                                }

                                                                                                                                                type PortsByPodName

                                                                                                                                                type PortsByPodName map[string][]int

                                                                                                                                                type PortsByPodUID

                                                                                                                                                type PortsByPodUID map[types.UID][]int

                                                                                                                                                type PrivilegedPodTestConfig

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

                                                                                                                                                type RCConfig

                                                                                                                                                type RCConfig struct {
                                                                                                                                                	Client         *client.Client
                                                                                                                                                	Image          string
                                                                                                                                                	Command        []string
                                                                                                                                                	Name           string
                                                                                                                                                	Namespace      string
                                                                                                                                                	PollInterval   time.Duration
                                                                                                                                                	Timeout        time.Duration
                                                                                                                                                	PodStatusFile  *os.File
                                                                                                                                                	Replicas       int
                                                                                                                                                	CpuRequest     int64 // millicores
                                                                                                                                                	CpuLimit       int64 // millicores
                                                                                                                                                	MemRequest     int64 // bytes
                                                                                                                                                	MemLimit       int64 // bytes
                                                                                                                                                	ReadinessProbe *api.Probe
                                                                                                                                                
                                                                                                                                                	// Env vars, set the same for every pod.
                                                                                                                                                	Env map[string]string
                                                                                                                                                
                                                                                                                                                	// Extra labels added to every pod.
                                                                                                                                                	Labels map[string]string
                                                                                                                                                
                                                                                                                                                	// Ports to declare in the container (map of name to containerPort).
                                                                                                                                                	Ports map[string]int
                                                                                                                                                	// Ports to declare in the container as host and container ports.
                                                                                                                                                	HostPorts map[string]int
                                                                                                                                                
                                                                                                                                                	Volumes      []api.Volume
                                                                                                                                                	VolumeMounts []api.VolumeMount
                                                                                                                                                
                                                                                                                                                	// Pointer to a list of pods; if non-nil, will be set to a list of pods
                                                                                                                                                	// created by this RC by RunRC.
                                                                                                                                                	CreatedPods *[]*api.Pod
                                                                                                                                                
                                                                                                                                                	// Maximum allowable container failures. If exceeded, RunRC returns an error.
                                                                                                                                                	// Defaults to replicas*0.1 if unspecified.
                                                                                                                                                	MaxContainerFailures *int
                                                                                                                                                }

                                                                                                                                                type ReplicaSetConfig

                                                                                                                                                type ReplicaSetConfig struct {
                                                                                                                                                	RCConfig
                                                                                                                                                }

                                                                                                                                                type ResourceConsumer

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

                                                                                                                                                  ResourceConsumer is a tool for testing. It helps create specified usage of CPU or memory (Warning: memory not supported) typical use case: rc.ConsumeCPU(600) // ... check your assumption here rc.ConsumeCPU(300) // ... check your assumption here

                                                                                                                                                  func NewDynamicResourceConsumer

                                                                                                                                                  func NewDynamicResourceConsumer(name, kind string, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuLimit, memLimit int64, framework *Framework) *ResourceConsumer

                                                                                                                                                  func NewStaticResourceConsumer

                                                                                                                                                  func NewStaticResourceConsumer(name string, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuLimit, memLimit int64, framework *Framework) *ResourceConsumer

                                                                                                                                                    TODO this still defaults to replication controller

                                                                                                                                                    func (*ResourceConsumer) CleanUp

                                                                                                                                                    func (rc *ResourceConsumer) CleanUp()

                                                                                                                                                    func (*ResourceConsumer) ConsumeCPU

                                                                                                                                                    func (rc *ResourceConsumer) ConsumeCPU(millicores int)

                                                                                                                                                      ConsumeCPU consumes given number of CPU

                                                                                                                                                      func (*ResourceConsumer) ConsumeCustomMetric

                                                                                                                                                      func (rc *ResourceConsumer) ConsumeCustomMetric(amount int)

                                                                                                                                                        ConsumeMem consumes given number of custom metric

                                                                                                                                                        func (*ResourceConsumer) ConsumeMem

                                                                                                                                                        func (rc *ResourceConsumer) ConsumeMem(megabytes int)

                                                                                                                                                          ConsumeMem consumes given number of Mem

                                                                                                                                                          func (*ResourceConsumer) EnsureDesiredReplicas

                                                                                                                                                          func (rc *ResourceConsumer) EnsureDesiredReplicas(desiredReplicas int, timeout time.Duration)

                                                                                                                                                          func (*ResourceConsumer) GetReplicas

                                                                                                                                                          func (rc *ResourceConsumer) GetReplicas() int

                                                                                                                                                          func (*ResourceConsumer) WaitForReplicas

                                                                                                                                                          func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int)

                                                                                                                                                          type ResourceUsageSummary

                                                                                                                                                          type ResourceUsageSummary map[string][]SingleContainerSummary

                                                                                                                                                            we can't have int here, as JSON does not accept integer keys.

                                                                                                                                                            func (*ResourceUsageSummary) PrintHumanReadable

                                                                                                                                                            func (s *ResourceUsageSummary) PrintHumanReadable() string

                                                                                                                                                            func (*ResourceUsageSummary) PrintJSON

                                                                                                                                                            func (s *ResourceUsageSummary) PrintJSON() string

                                                                                                                                                            type SSHResult

                                                                                                                                                            type SSHResult struct {
                                                                                                                                                            	User   string
                                                                                                                                                            	Host   string
                                                                                                                                                            	Cmd    string
                                                                                                                                                            	Stdout string
                                                                                                                                                            	Stderr string
                                                                                                                                                            	Code   int
                                                                                                                                                            }

                                                                                                                                                            func SSH

                                                                                                                                                            func SSH(cmd, host, provider string) (SSHResult, error)

                                                                                                                                                              SSH synchronously SSHs to a node running on provider and runs cmd. If there is no error performing the SSH, the stdout, stderr, and exit code are returned.

                                                                                                                                                              type SaturationTime

                                                                                                                                                              type SaturationTime struct {
                                                                                                                                                              	TimeToSaturate time.Duration `json:"timeToStaturate"`
                                                                                                                                                              	NumberOfNodes  int           `json:"numberOfNodes"`
                                                                                                                                                              	NumberOfPods   int           `json:"numberOfPods"`
                                                                                                                                                              	Throughput     float32       `json:"throughput"`
                                                                                                                                                              }

                                                                                                                                                              type SchedulingLatency

                                                                                                                                                              type SchedulingLatency struct {
                                                                                                                                                              	Scheduling LatencyMetric `json:"scheduling"`
                                                                                                                                                              	Binding    LatencyMetric `json:"binding"`
                                                                                                                                                              	Total      LatencyMetric `json:"total"`
                                                                                                                                                              }

                                                                                                                                                              type ServiceTestFixture

                                                                                                                                                              type ServiceTestFixture struct {
                                                                                                                                                              	ServiceName string
                                                                                                                                                              	Namespace   string
                                                                                                                                                              	Client      *client.Client
                                                                                                                                                              
                                                                                                                                                              	TestId string
                                                                                                                                                              	Labels map[string]string
                                                                                                                                                              	// contains filtered or unexported fields
                                                                                                                                                              }

                                                                                                                                                                Simple helper class to avoid too much boilerplate in tests

                                                                                                                                                                func NewServerTest

                                                                                                                                                                func NewServerTest(client *client.Client, namespace string, serviceName string) *ServiceTestFixture

                                                                                                                                                                func (*ServiceTestFixture) BuildServiceSpec

                                                                                                                                                                func (t *ServiceTestFixture) BuildServiceSpec() *api.Service

                                                                                                                                                                  Build default config for a service (which can then be changed)

                                                                                                                                                                  func (*ServiceTestFixture) Cleanup

                                                                                                                                                                  func (t *ServiceTestFixture) Cleanup() []error

                                                                                                                                                                  func (*ServiceTestFixture) CreateService

                                                                                                                                                                  func (t *ServiceTestFixture) CreateService(service *api.Service) (*api.Service, error)

                                                                                                                                                                    Create a service, and record it for cleanup

                                                                                                                                                                    func (*ServiceTestFixture) CreateWebserverRC

                                                                                                                                                                    func (t *ServiceTestFixture) CreateWebserverRC(replicas int) *api.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 *client.Client
                                                                                                                                                                        	Labels map[string]string
                                                                                                                                                                        }

                                                                                                                                                                          A test jig to help testing.

                                                                                                                                                                          func NewServiceTestJig

                                                                                                                                                                          func NewServiceTestJig(client *client.Client, name string) *ServiceTestJig

                                                                                                                                                                            NewServiceTestJig allocates and inits a new ServiceTestJig.

                                                                                                                                                                            func (*ServiceTestJig) ChangeServiceNodePortOrFail

                                                                                                                                                                            func (j *ServiceTestJig) ChangeServiceNodePortOrFail(namespace, name string, initial int) *api.Service

                                                                                                                                                                            func (*ServiceTestJig) CreateTCPServiceOrFail

                                                                                                                                                                            func (j *ServiceTestJig) CreateTCPServiceOrFail(namespace string, tweak func(svc *api.Service)) *api.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) CreateUDPServiceOrFail

                                                                                                                                                                              func (j *ServiceTestJig) CreateUDPServiceOrFail(namespace string, tweak func(svc *api.Service)) *api.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) RunOrFail

                                                                                                                                                                                func (j *ServiceTestJig) RunOrFail(namespace string, tweak func(rc *api.ReplicationController)) *api.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 *api.Service, svcType api.ServiceType)

                                                                                                                                                                                  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) TestReachableUDP

                                                                                                                                                                                  func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration)

                                                                                                                                                                                  func (*ServiceTestJig) UpdateService

                                                                                                                                                                                  func (j *ServiceTestJig) UpdateService(namespace, name string, update func(*api.Service)) (*api.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(*api.Service)) *api.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) WaitForLoadBalancerDestroyOrFail

                                                                                                                                                                                      func (j *ServiceTestJig) WaitForLoadBalancerDestroyOrFail(namespace, name string, ip string, port int) *api.Service

                                                                                                                                                                                      func (*ServiceTestJig) WaitForLoadBalancerOrFail

                                                                                                                                                                                      func (j *ServiceTestJig) WaitForLoadBalancerOrFail(namespace, name string) *api.Service

                                                                                                                                                                                      type SingleContainerSummary

                                                                                                                                                                                      type SingleContainerSummary struct {
                                                                                                                                                                                      	Name string
                                                                                                                                                                                      	Cpu  float64
                                                                                                                                                                                      	Mem  uint64
                                                                                                                                                                                      }

                                                                                                                                                                                      type SingleLogSummary

                                                                                                                                                                                      type SingleLogSummary struct {
                                                                                                                                                                                      	AverageGenerationRate int
                                                                                                                                                                                      	NumberOfProbes        int
                                                                                                                                                                                      }

                                                                                                                                                                                      type State

                                                                                                                                                                                      type State struct {
                                                                                                                                                                                      	Received map[string]int
                                                                                                                                                                                      }

                                                                                                                                                                                        partially cloned from webserver.go

                                                                                                                                                                                        type TestContextType

                                                                                                                                                                                        type TestContextType struct {
                                                                                                                                                                                        	KubeConfig    string
                                                                                                                                                                                        	KubeContext   string
                                                                                                                                                                                        	KubeVolumeDir string
                                                                                                                                                                                        	CertDir       string
                                                                                                                                                                                        	Host          string
                                                                                                                                                                                        	RepoRoot      string
                                                                                                                                                                                        	Provider      string
                                                                                                                                                                                        	CloudConfig   CloudConfig
                                                                                                                                                                                        	KubectlPath   string
                                                                                                                                                                                        	OutputDir     string
                                                                                                                                                                                        	ReportDir     string
                                                                                                                                                                                        	ReportPrefix  string
                                                                                                                                                                                        
                                                                                                                                                                                        	MinStartupPods        int
                                                                                                                                                                                        	UpgradeTarget         string
                                                                                                                                                                                        	PrometheusPushGateway string
                                                                                                                                                                                        	OSDistro              string
                                                                                                                                                                                        	VerifyServiceAccount  bool
                                                                                                                                                                                        	DeleteNamespace       bool
                                                                                                                                                                                        	CleanStart            bool
                                                                                                                                                                                        	// If set to true 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.
                                                                                                                                                                                        	GatherKubeSystemResourceUsageData bool
                                                                                                                                                                                        	GatherLogsSizes                   bool
                                                                                                                                                                                        	GatherMetricsAfterTest            bool
                                                                                                                                                                                        	// Currently supported values are 'hr' for human-readable and 'json'. It's a comma separated list.
                                                                                                                                                                                        	OutputPrintType string
                                                                                                                                                                                        	// 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
                                                                                                                                                                                        	// contains filtered or unexported fields
                                                                                                                                                                                        }

                                                                                                                                                                                        type TestDataSummary

                                                                                                                                                                                        type TestDataSummary interface {
                                                                                                                                                                                        	PrintHumanReadable() string
                                                                                                                                                                                        	PrintJSON() string
                                                                                                                                                                                        }

                                                                                                                                                                                        type TimestampedSize

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

                                                                                                                                                                                          TimestampedSize contains a size together with a time of measurement.

                                                                                                                                                                                          type VolumeTestConfig

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

                                                                                                                                                                                            Configuration of one tests. The test consist of: - server pod - runs serverImage, exports ports[] - client pod - does not need any special configuration

                                                                                                                                                                                            type WorkItem

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

                                                                                                                                                                                              WorkItem is a command for a worker that contains an IP of machine from which we want to gather data and paths to all files we're interested in.

                                                                                                                                                                                              Directories

                                                                                                                                                                                              Path Synopsis