Documentation ¶
Overview ¶
This is a utility for prometheus pushing functionality.
Index ¶
- Constants
- Variables
- func BadEvents(events []*api.Event) int
- func CheckCadvisorHealthOnAllNodes(c *client.Client, timeout time.Duration)
- func ClusterLevelLoggingWithElasticsearch(f *Framework)
- func ClusterLevelLoggingWithKibana(f *Framework)
- func CoreDump(dir string)
- func DeleteRC(c *client.Client, ns, name string) error
- func DeleteReplicaSet(c *client.Client, ns, name string) error
- func EnsureLoadBalancerResourcesDeleted(ip, portRange string) error
- func FailedContainers(pod *api.Pod) map[string]ContainerFailures
- func Failf(format string, args ...interface{})
- func GetKubeletPods(c *client.Client, node string) (*api.PodList, error)
- func HighLatencyRequests(c *client.Client) (int, error)
- func LaunchHostExecPod(client *client.Client, ns, name string) *api.Pod
- func LaunchNetTestPodPerNode(f *Framework, nodes *api.NodeList, name, version string) []string
- func ListSchedulableNodesOrDie(c *client.Client) *api.NodeList
- func LogSSHResult(result SSHResult)
- func Logf(format string, args ...interface{})
- func NewHostExecPodSpec(ns, name string) *api.Pod
- func NewRestartConfig(nodeName, daemonName string, healthzPort int, ...) *restartDaemonConfig
- func NodeAddresses(nodelist *api.NodeList, addrType api.NodeAddressType) []string
- func NodeSSHHosts(c *client.Client) ([]string, error)
- func OpenWebSocketForURL(url *url.URL, config *client.Config, protocols []string) (*websocket.Conn, error)
- func Query(c *client.Client, query string) (*influxdb.Response, error)
- func RegisterFlags()
- func ReplicaSetServeImageOrFail(f *Framework, test string, image string)
- func ReserveCpu(f *Framework, id string, millicores int)
- func ReserveMemory(f *Framework, id string, megabytes int)
- func RunDeployment(config DeploymentConfig) error
- func RunE2ETests(t *testing.T)
- func RunHostCmd(ns, name, cmd string) (string, error)
- func RunHostCmdOrDie(ns, name, cmd string) string
- func RunRC(config RCConfig) error
- func ScaleRC(c *client.Client, ns, name string, size uint, wait bool) error
- func ServeImageOrFail(f *Framework, test string, image string)
- func SetTestContext(t TestContextType)
- func SkipIfProviderIs(unsupportedProviders ...string)
- func SkipUnlessNodeCountIsAtLeast(minNodeCount int)
- func SkipUnlessProviderIs(supportedProviders ...string)
- func SkipUnlessServerVersionGTE(v semver.Version, c client.ServerVersionInterface)
- func Skipf(format string, args ...interface{})
- func VerifyPodStartupLatency(latency PodStartupLatency) error
- func VerifySchedulerLatency(c *client.Client) error
- type APICall
- type APIResponsiveness
- type CloudConfig
- type ContainerFailures
- type DeploymentConfig
- type Framework
- func (f *Framework) ReadFileViaContainer(podName, containerName string, path string) (string, error)
- func (f *Framework) TestContainerOutput(scenarioName string, pod *api.Pod, containerIndex int, expectedOutput []string)
- func (f *Framework) TestContainerOutputRegexp(scenarioName string, pod *api.Pod, containerIndex int, expectedOutput []string)
- func (f *Framework) WaitForAnEndpoint(serviceName string) error
- func (f *Framework) WaitForPodRunning(podName string) error
- func (f *Framework) WaitForPodRunningSlow(podName string) error
- func (f *Framework) WaitForPodTerminated(podName, reason string) error
- func (f *Framework) WriteFileViaContainer(podName, containerName string, path string, contents string) error
- type HPAScaleTest
- type IngressController
- type KubeProxyTestConfig
- type KubeletManagedHostConfig
- type KubeletMetric
- type KubeletMetricByLatency
- type LBCTester
- type LatencyMetric
- type LogSizeDataTimeseries
- type LogSizeGatherer
- type LogsSizeData
- type LogsSizeDataSummary
- type LogsSizeVerifier
- type MetricsForE2E
- type PodDiff
- type PodStartupLatency
- type PortsByPodName
- type PortsByPodUID
- type PrivilegedPodTestConfig
- type RCConfig
- type ResourceConsumer
- func (rc *ResourceConsumer) CleanUp()
- func (rc *ResourceConsumer) ConsumeCPU(millicores int)
- func (rc *ResourceConsumer) ConsumeMem(megabytes int)
- func (rc *ResourceConsumer) EnsureDesiredReplicas(desiredReplicas int, timeout time.Duration)
- func (rc *ResourceConsumer) GetReplicas() int
- func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int)
- type ResourceUsageSummary
- type SSHResult
- type SchedulingLatency
- type ServiceTestFixture
- func (t *ServiceTestFixture) BuildServiceSpec() *api.Service
- func (t *ServiceTestFixture) Cleanup() []error
- func (t *ServiceTestFixture) CreateService(service *api.Service) (*api.Service, error)
- func (t *ServiceTestFixture) CreateWebserverRC(replicas int) *api.ReplicationController
- func (t *ServiceTestFixture) DeleteService(serviceName string) error
- type ServiceTestJig
- func (j *ServiceTestJig) ChangeServiceNodePortOrFail(namespace, name string, initial int) *api.Service
- func (j *ServiceTestJig) CreateTCPServiceOrFail(namespace string, tweak func(svc *api.Service)) *api.Service
- func (j *ServiceTestJig) CreateUDPServiceOrFail(namespace string, tweak func(svc *api.Service)) *api.Service
- func (j *ServiceTestJig) RunOrFail(namespace string, tweak func(rc *api.ReplicationController)) *api.ReplicationController
- func (j *ServiceTestJig) SanityCheckService(svc *api.Service, svcType api.ServiceType)
- func (j *ServiceTestJig) TestNotReachableHTTP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestNotReachableUDP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestReachableHTTP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration)
- func (j *ServiceTestJig) UpdateService(namespace, name string, update func(*api.Service)) (*api.Service, error)
- func (j *ServiceTestJig) UpdateServiceOrFail(namespace, name string, update func(*api.Service)) *api.Service
- func (j *ServiceTestJig) WaitForLoadBalancerDestroyOrFail(namespace, name string, ip string, port int) *api.Service
- func (j *ServiceTestJig) WaitForLoadBalancerOrFail(namespace, name string) *api.Service
- type SingleContainerSummary
- type SingleLogSummary
- type State
- type TestContextType
- type TestDataSummary
- type TimestampedSize
- type VolumeTestConfig
- type WorkItem
Constants ¶
const ( ADD = "ADD" DEL = "DEL" UPDATE = "UPDATE" )
const NodeStartupThreshold = 4 * time.Second
NodeStartupThreshold is a rough estimate of the time allocated for a pod to start on a node.
Variables ¶
var InterestingApiServerMetrics = []string{
"apiserver_request_count",
"apiserver_request_latencies_summary",
"etcd_helper_cache_entry_count",
"etcd_helper_cache_hit_count",
"etcd_helper_cache_miss_count",
"etcd_request_cache_add_latencies_summary",
"etcd_request_cache_get_latencies_summary",
"etcd_request_latencies_summary",
}
var InterestingKubeletMetrics = []string{
"kubelet_container_manager_latency_microseconds",
"kubelet_docker_errors",
"kubelet_docker_operations_latency_microseconds",
"kubelet_generate_pod_status_latency_microseconds",
"kubelet_pod_start_latency_microseconds",
"kubelet_pod_worker_latency_microseconds",
"kubelet_pod_worker_start_latency_microseconds",
"kubelet_sync_pods_latency_microseconds",
}
var MaxContainerFailures = 0
Maximum container failures this test tolerates before failing.
var ServiceNodePortRange = utilnet.PortRange{Base: 30000, Size: 2768}
This should match whatever the default/configured range is
Functions ¶
func BadEvents ¶ added in v0.16.0
Prints the histogram of the events and returns the number of bad events.
func CheckCadvisorHealthOnAllNodes ¶ added in v0.11.0
func ClusterLevelLoggingWithElasticsearch ¶ added in v0.14.0
func ClusterLevelLoggingWithElasticsearch(f *Framework)
ClusterLevelLoggingWithElasticsearch is an end to end test for cluster level logging.
func ClusterLevelLoggingWithKibana ¶ added in v1.0.0
func ClusterLevelLoggingWithKibana(f *Framework)
ClusterLevelLoggingWithKibana is an end to end test that checks to see if Kibana is alive.
func DeleteReplicaSet ¶ added in v1.2.0
Delete a ReplicaSet and all pods it spawned
func EnsureLoadBalancerResourcesDeleted ¶ added in v1.2.0
EnsureLoadBalancerResourcesDeleted ensures that cloud load balancer resources that were created are actually cleaned up. Currently only implemented for GCE/GKE.
func FailedContainers ¶ added in v0.18.0
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 GetKubeletPods ¶ added in v0.21.0
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 HighLatencyRequests ¶ added in v0.17.0
Prints top five summary metrics for request types with latency and returns number of such request types above threshold.
func LaunchHostExecPod ¶ added in v1.2.0
LaunchHostExecPod launches a hostexec pod in the given namespace and waits until it's Running
func LaunchNetTestPodPerNode ¶ added in v0.15.0
func ListSchedulableNodesOrDie ¶ added in v1.2.0
Convenient wrapper around listing nodes supporting retries.
func LogSSHResult ¶ added in v1.2.0
func LogSSHResult(result SSHResult)
func NewHostExecPodSpec ¶ added in v1.2.0
NewHostExecPodSpec returns the pod spec of hostexec pod
func NewRestartConfig ¶ added in v1.1.0
func NewRestartConfig(nodeName, daemonName string, healthzPort int, pollInterval, pollTimeout time.Duration) *restartDaemonConfig
NewRestartConfig creates a restartDaemonConfig for the given node and daemon.
func NodeAddresses ¶ added in v1.2.0
func NodeAddresses(nodelist *api.NodeList, addrType api.NodeAddressType) []string
NodeAddresses returns the first address of the given type of each node.
func NodeSSHHosts ¶ added in v0.18.0
NodeSSHHosts returns SSH-able host names for all nodes. 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 ¶ added in v1.1.1
func OpenWebSocketForURL(url *url.URL, config *client.Config, protocols []string) (*websocket.Conn, error)
OpenWebSocketForURL constructs a websocket connection to the provided URL, using the client config, with the specified protocols.
func RegisterFlags ¶ added in v1.2.0
func RegisterFlags()
func ReplicaSetServeImageOrFail ¶ added in v1.2.0
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 ¶ added in v1.1.0
func ReserveMemory ¶ added in v1.1.0
func RunDeployment ¶ added in v1.2.0
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 ¶
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 ¶ added in v1.2.0
RunHostCmd runs the given cmd in the context of the given pod using `kubectl exec` inside of a shell.
func RunHostCmdOrDie ¶ added in v1.2.0
RunHostCmdOrDie calls RunHostCmd and dies on error.
func RunRC ¶ added in v0.13.0
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 ServeImageOrFail ¶ added in v0.11.0
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 ¶ added in v1.1.0
func SetTestContext(t TestContextType)
func SkipIfProviderIs ¶ added in v0.21.0
func SkipIfProviderIs(unsupportedProviders ...string)
func SkipUnlessNodeCountIsAtLeast ¶ added in v0.21.0
func SkipUnlessNodeCountIsAtLeast(minNodeCount int)
func SkipUnlessProviderIs ¶ added in v0.21.0
func SkipUnlessProviderIs(supportedProviders ...string)
func SkipUnlessServerVersionGTE ¶ added in v1.2.0
func SkipUnlessServerVersionGTE(v semver.Version, c client.ServerVersionInterface)
func VerifyPodStartupLatency ¶ added in v1.1.1
func VerifyPodStartupLatency(latency PodStartupLatency) error
Verifies whether 50, 90 and 99th percentiles of PodStartupLatency are within the threshold.
func VerifySchedulerLatency ¶ added in v1.2.0
Verifies (currently just by logging them) the scheduling latencies.
Types ¶
type APICall ¶ added in v1.1.1
type APICall struct { Resource string `json:"resource"` Verb string `json:"verb"` Latency LatencyMetric `json:"latency"` }
type APIResponsiveness ¶ added in v1.1.1
type APIResponsiveness struct {
APICalls []APICall `json:"apicalls"`
}
func (APIResponsiveness) Len ¶ added in v1.1.1
func (a APIResponsiveness) Len() int
func (APIResponsiveness) Less ¶ added in v1.1.1
func (a APIResponsiveness) Less(i, j int) bool
func (APIResponsiveness) Swap ¶ added in v1.1.1
func (a APIResponsiveness) Swap(i, j int)
type CloudConfig ¶ added in v0.15.0
type ContainerFailures ¶ added in v0.18.0
type ContainerFailures struct {
// contains filtered or unexported fields
}
type DeploymentConfig ¶ added in v1.2.0
type DeploymentConfig struct {
RCConfig
}
type Framework ¶ added in v0.18.0
type Framework struct { BaseName string Namespace *api.Namespace Client *client.Client Clientset_1_2 *release_1_2.Clientset 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 InitializeFramework ¶
func InitializeFramework(baseName string, nsCreateFunc func(string, *client.Client, map[string]string) (*api.Namespace, error)) *Framework
InitializeFramework initialize the framework by allowing to pass a custom namespace creation function.
func NewFramework ¶ added in v0.18.0
NewFramework makes a new framework and sets up a BeforeEach/AfterEach for you (you can write additional before/after each functions).
func (*Framework) ReadFileViaContainer ¶ added in v1.0.2
func (f *Framework) ReadFileViaContainer(podName, containerName string, path string) (string, error)
Read a file using kubectl exec cat <path>
func (*Framework) TestContainerOutput ¶ added in v0.18.0
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 ¶ added in v1.2.0
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 ¶ added in v0.20.0
WaitForAnEndpoint waits for at least one endpoint to become available in the service's corresponding endpoints object.
func (*Framework) WaitForPodRunning ¶ added in v0.18.0
WaitForPodRunning waits for the pod to run in the namespace.
func (*Framework) WaitForPodRunningSlow ¶ added in v1.1.1
WaitForPodRunningSlow waits for the pod to run in the namespace. It has a longer timeout then WaitForPodRunning (util.slowPodStartTimeout).
func (*Framework) WaitForPodTerminated ¶ added in v1.2.0
WaitForPodTerminated waits for the pod to be terminated with the given reason.
func (*Framework) WriteFileViaContainer ¶ added in v1.0.2
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 HPAScaleTest ¶ added in v1.2.0
type HPAScaleTest struct {
// contains filtered or unexported fields
}
HPAScaleTest struct is used by the scale(...) function.
type IngressController ¶ added in v1.2.0
type IngressController struct { UID string Project string // contains filtered or unexported fields }
func (*IngressController) Cleanup ¶ added in v1.2.0
func (cont *IngressController) Cleanup(del bool) error
type KubeProxyTestConfig ¶ added in v1.1.0
type KubeProxyTestConfig struct {
// contains filtered or unexported fields
}
type KubeletManagedHostConfig ¶ added in v1.1.1
type KubeletManagedHostConfig struct {
// contains filtered or unexported fields
}
type KubeletMetric ¶ added in v0.20.0
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 ¶ added in v0.20.0
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 ¶ added in v0.21.0
func ParseKubeletMetrics(metricsBlob string) ([]KubeletMetric, error)
ParseKubeletMetrics reads metrics from the kubelet server running on the given node
type KubeletMetricByLatency ¶ added in v0.20.0
type KubeletMetricByLatency []KubeletMetric
KubeletMetricByLatency implements sort.Interface for []KubeletMetric based on the latency field.
func (KubeletMetricByLatency) Len ¶ added in v0.20.0
func (a KubeletMetricByLatency) Len() int
func (KubeletMetricByLatency) Less ¶ added in v0.20.0
func (a KubeletMetricByLatency) Less(i, j int) bool
func (KubeletMetricByLatency) Swap ¶ added in v0.20.0
func (a KubeletMetricByLatency) Swap(i, j int)
type LBCTester ¶ added in v1.1.1
type LBCTester interface {
// contains filtered or unexported methods
}
LBCTester is an interface used to test loadbalancer controllers.
type LatencyMetric ¶ added in v0.17.0
type LatencyMetric struct { Perc50 time.Duration `json:"Perc50"` Perc90 time.Duration `json:"Perc90"` Perc99 time.Duration `json:"Perc99"` }
Dashboard metrics
type LogSizeDataTimeseries ¶ added in v1.2.0
type LogSizeDataTimeseries map[string]map[string][]TimestampedSize
type LogSizeGatherer ¶ added in v1.2.0
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 ¶ added in v1.2.0
func (g *LogSizeGatherer) Run()
func (*LogSizeGatherer) Work ¶ added in v1.2.0
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 ¶ added in v1.2.0
type LogsSizeData struct {
// contains filtered or unexported fields
}
func (*LogsSizeData) AddNewData ¶ added in v1.2.0
func (d *LogsSizeData) AddNewData(ip, path string, timestamp time.Time, size int)
type LogsSizeDataSummary ¶ added in v1.2.0
type LogsSizeDataSummary map[string]map[string]SingleLogSummary
node -> file -> data
func (*LogsSizeDataSummary) PrintHumanReadable ¶ added in v1.2.0
func (s *LogsSizeDataSummary) PrintHumanReadable() string
TODO: make sure that we don't need locking here
func (*LogsSizeDataSummary) PrintJSON ¶ added in v1.2.0
func (s *LogsSizeDataSummary) PrintJSON() string
type LogsSizeVerifier ¶ added in v1.2.0
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 ¶ added in v1.2.0
func NewLogsVerifier(c *client.Client, stopChannel chan bool) *LogsSizeVerifier
NewLogsVerifier creates a new LogsSizeVerifier which will stop when stopChannel is closed
func (*LogsSizeVerifier) GetSummary ¶ added in v1.2.0
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 ¶ added in v1.2.0
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 ¶ added in v1.2.0
type MetricsForE2E metrics.MetricsCollection
func (*MetricsForE2E) PrintHumanReadable ¶ added in v1.2.0
func (m *MetricsForE2E) PrintHumanReadable() string
func (*MetricsForE2E) PrintJSON ¶ added in v1.2.0
func (m *MetricsForE2E) PrintJSON() string
type PodDiff ¶ added in v0.18.0
type PodDiff map[string]*podInfo
PodDiff is a map of pod name to podInfos
type PodStartupLatency ¶ added in v1.1.1
type PodStartupLatency struct {
Latency LatencyMetric `json:"latency"`
}
type PortsByPodName ¶ added in v1.1.0
type PortsByPodUID ¶ added in v1.1.0
type PrivilegedPodTestConfig ¶ added in v1.1.0
type PrivilegedPodTestConfig struct {
// contains filtered or unexported fields
}
type RCConfig ¶ added in v0.19.0
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 // 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 // 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 ResourceConsumer ¶ added in v1.1.0
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 ¶ added in v1.1.0
func NewDynamicResourceConsumer(name, kind string, replicas, initCPUTotal, initMemoryTotal int, cpuLimit, memLimit int64, framework *Framework) *ResourceConsumer
func NewStaticResourceConsumer ¶ added in v1.1.0
func NewStaticResourceConsumer(name string, replicas, initCPUTotal, initMemoryTotal int, cpuLimit, memLimit int64, framework *Framework) *ResourceConsumer
TODO this still defaults to replication controller
func (*ResourceConsumer) CleanUp ¶ added in v1.1.0
func (rc *ResourceConsumer) CleanUp()
func (*ResourceConsumer) ConsumeCPU ¶ added in v1.1.0
func (rc *ResourceConsumer) ConsumeCPU(millicores int)
ConsumeCPU consumes given number of CPU
func (*ResourceConsumer) ConsumeMem ¶ added in v1.1.0
func (rc *ResourceConsumer) ConsumeMem(megabytes int)
ConsumeMem consumes given number of Mem
func (*ResourceConsumer) EnsureDesiredReplicas ¶ added in v1.2.0
func (rc *ResourceConsumer) EnsureDesiredReplicas(desiredReplicas int, timeout time.Duration)
func (*ResourceConsumer) GetReplicas ¶ added in v1.1.0
func (rc *ResourceConsumer) GetReplicas() int
func (*ResourceConsumer) WaitForReplicas ¶ added in v1.1.0
func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int)
type ResourceUsageSummary ¶ added in v1.2.0
type ResourceUsageSummary map[string][]SingleContainerSummary
we can't have int here, as JSON does not accept integer keys.
func (*ResourceUsageSummary) PrintHumanReadable ¶ added in v1.2.0
func (s *ResourceUsageSummary) PrintHumanReadable() string
func (*ResourceUsageSummary) PrintJSON ¶ added in v1.2.0
func (s *ResourceUsageSummary) PrintJSON() string
type SchedulingLatency ¶ added in v1.2.0
type SchedulingLatency struct { Scheduling LatencyMetric `json:"scheduling:` Binding LatencyMetric `json:"binding"` Total LatencyMetric `json:"total"` }
type ServiceTestFixture ¶ added in v1.2.0
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 ¶ added in v1.2.0
func NewServerTest(client *client.Client, namespace string, serviceName string) *ServiceTestFixture
func (*ServiceTestFixture) BuildServiceSpec ¶ added in v1.2.0
func (t *ServiceTestFixture) BuildServiceSpec() *api.Service
Build default config for a service (which can then be changed)
func (*ServiceTestFixture) Cleanup ¶ added in v1.2.0
func (t *ServiceTestFixture) Cleanup() []error
func (*ServiceTestFixture) CreateService ¶ added in v1.2.0
Create a service, and record it for cleanup
func (*ServiceTestFixture) CreateWebserverRC ¶ added in v1.2.0
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 ¶ added in v1.2.0
func (t *ServiceTestFixture) DeleteService(serviceName string) error
Delete a service, and remove it from the cleanup list
type ServiceTestJig ¶ added in v1.2.0
A test jig to help testing.
func NewServiceTestJig ¶ added in v1.2.0
func NewServiceTestJig(client *client.Client, name string) *ServiceTestJig
NewServiceTestJig allocates and inits a new ServiceTestJig.
func (*ServiceTestJig) ChangeServiceNodePortOrFail ¶ added in v1.2.0
func (j *ServiceTestJig) ChangeServiceNodePortOrFail(namespace, name string, initial int) *api.Service
func (*ServiceTestJig) CreateTCPServiceOrFail ¶ added in v1.2.0
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 ¶ added in v1.2.0
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 ¶ added in v1.2.0
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 ¶ added in v1.2.0
func (j *ServiceTestJig) SanityCheckService(svc *api.Service, svcType api.ServiceType)
func (*ServiceTestJig) TestNotReachableHTTP ¶ added in v1.2.0
func (j *ServiceTestJig) TestNotReachableHTTP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestNotReachableUDP ¶ added in v1.2.0
func (j *ServiceTestJig) TestNotReachableUDP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestReachableHTTP ¶ added in v1.2.0
func (j *ServiceTestJig) TestReachableHTTP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) TestReachableUDP ¶ added in v1.2.0
func (j *ServiceTestJig) TestReachableUDP(host string, port int, timeout time.Duration)
func (*ServiceTestJig) UpdateService ¶ added in v1.2.0
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 ¶ added in v1.2.0
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 ¶ added in v1.2.0
func (*ServiceTestJig) WaitForLoadBalancerOrFail ¶ added in v1.2.0
func (j *ServiceTestJig) WaitForLoadBalancerOrFail(namespace, name string) *api.Service
type SingleContainerSummary ¶ added in v1.2.0
type SingleLogSummary ¶ added in v1.2.0
type TestContextType ¶ added in v0.15.0
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 MinStartupPods int UpgradeTarget string PrometheusPushGateway 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 // contains filtered or unexported fields }
type TestDataSummary ¶ added in v1.2.0
type TimestampedSize ¶ added in v1.2.0
type TimestampedSize struct {
// contains filtered or unexported fields
}
TimestampedSize contains a size together with a time of measurement.
type VolumeTestConfig ¶ added in v0.18.0
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
Source Files ¶
- addon_update.go
- autoscaling_utils.go
- cadvisor.go
- cluster_size_autoscaling.go
- cluster_upgrade.go
- configmap.go
- container_probe.go
- core.go
- daemon_restart.go
- daemon_set.go
- dashboard.go
- density.go
- deployment.go
- dns.go
- docker_containers.go
- downward_api.go
- downwardapi_volume.go
- e2e.go
- empty_dir.go
- empty_dir_wrapper.go
- es_cluster_logging.go
- etcd_failure.go
- events.go
- example_cluster_dns.go
- example_k8petstore.go
- examples.go
- expansion.go
- framework.go
- garbage_collector.go
- generated_clientset.go
- google_compute.go
- horizontal_pod_autoscaling.go
- host_path.go
- ingress.go
- initial_resources.go
- job.go
- kibana_logging.go
- kubectl.go
- kubelet.go
- kubelet_etc_hosts.go
- kubelet_perf.go
- kubelet_stats.go
- kubeproxy.go
- limit_range.go
- load.go
- log_size_monitoring.go
- mesos.go
- metrics_util.go
- monitoring.go
- namespace.go
- networking.go
- nodeoutofdisk.go
- pd.go
- persistent_volumes.go
- pods.go
- portforward.go
- pre_stop.go
- privileged.go
- prompush.go
- proxy.go
- rc.go
- reboot.go
- replica_set.go
- resize_nodes.go
- resource_usage_gatherer.go
- restart.go
- scheduler_predicates.go
- secrets.go
- security_context.go
- service.go
- service_accounts.go
- service_latency.go
- serviceloadbalancers.go
- ssh.go
- util.go
- volumes.go