Documentation ¶
Index ¶
- Constants
- Variables
- func CreateAppArmorTestPod(f *framework.Framework, runOnce bool) *api.Pod
- func CreateCPUHorizontalPodAutoscaler(rc *ResourceConsumer, cpu, minReplicas, maxRepl int32) *autoscalingv1.HorizontalPodAutoscaler
- func DeleteHorizontalPodAutoscaler(rc *ResourceConsumer, autoscalerName string)
- func GetResourceConsumerImage() string
- func LoadAppArmorProfiles(f *framework.Framework)
- func NewRCByName(c clientset.Interface, ns, name string, replicas int32, gracePeriod *int64) (*v1.ReplicationController, error)
- func NewSVCByName(c clientset.Interface, ns, name string) error
- func ObserveEventAfterAction(f *framework.Framework, eventPredicate func(*v1.Event) bool, action Action) (bool, error)
- func ObserveNodeUpdateAfterAction(f *framework.Framework, nodeName string, nodePredicate func(*v1.Node) bool, ...) (bool, error)
- func RestartNodes(c clientset.Interface, nodeNames []string) error
- func SkipIfAppArmorNotSupported()
- type Action
- type KubeletManagedHostConfig
- type PrivilegedPodTestConfig
- type ResourceConsumer
- func (rc *ResourceConsumer) CleanUp()
- func (rc *ResourceConsumer) ConsumeCPU(millicores int)
- func (rc *ResourceConsumer) ConsumeCustomMetric(amount int)
- func (rc *ResourceConsumer) ConsumeMem(megabytes int)
- func (rc *ResourceConsumer) EnsureDesiredReplicas(desiredReplicas int, duration time.Duration)
- func (rc *ResourceConsumer) GetReplicas() int
- func (rc *ResourceConsumer) Pause()
- func (rc *ResourceConsumer) Resume()
- func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int, duration time.Duration)
- type Suite
Constants ¶
const ( KindRC = "ReplicationController" KindDeployment = "Deployment" KindReplicaSet = "ReplicaSet" )
Variables ¶
var AppArmorDistros = []string{"gci", "ubuntu"}
AppArmorDistros are distros with AppArmor support
var CommonImageWhiteList = sets.NewString(
"gcr.io/google_containers/busybox:1.24",
"gcr.io/google_containers/eptest:0.1",
"gcr.io/google_containers/liveness:e2e",
"gcr.io/google_containers/mounttest:0.8",
"gcr.io/google_containers/mounttest-user:0.5",
"gcr.io/google_containers/netexec:1.4",
"gcr.io/google_containers/netexec:1.5",
"gcr.io/google_containers/nginx-slim:0.7",
"gcr.io/google_containers/serve_hostname:v1.4",
"gcr.io/google_containers/test-webserver:e2e",
"gcr.io/google_containers/hostexec:1.2",
"gcr.io/google_containers/volume-nfs:0.8",
"gcr.io/google_containers/volume-gluster:0.2",
"gcr.io/google_containers/e2e-net-amd64:1.0",
)
CommonImageWhiteList is the list of images used in common test. These images should be prepulled before a tests starts, so that the tests won't fail due image pulling flakes. Currently, this is only used by node e2e test. TODO(random-liu): Change the image puller pod to use similar mechanism.
Functions ¶
func CreateAppArmorTestPod ¶
CreateAppArmorTestPod creates a pod that tests apparmor profile enforcement. The pod exits with an error code if the profile is incorrectly enforced. If runOnce is true the pod will exit after a single test, otherwise it will repeat the test every 1 second until failure.
func CreateCPUHorizontalPodAutoscaler ¶
func CreateCPUHorizontalPodAutoscaler(rc *ResourceConsumer, cpu, minReplicas, maxRepl int32) *autoscalingv1.HorizontalPodAutoscaler
func DeleteHorizontalPodAutoscaler ¶
func DeleteHorizontalPodAutoscaler(rc *ResourceConsumer, autoscalerName string)
func GetResourceConsumerImage ¶
func GetResourceConsumerImage() string
func LoadAppArmorProfiles ¶
func NewRCByName ¶
func NewRCByName(c clientset.Interface, ns, name string, replicas int32, gracePeriod *int64) (*v1.ReplicationController, error)
NewRCByName creates a replication controller with a selector by name of name.
func ObserveEventAfterAction ¶
func ObserveEventAfterAction(f *framework.Framework, eventPredicate func(*v1.Event) bool, action Action) (bool, error)
Returns true if an event matching the predicate was emitted from the system after performing the supplied action.
func ObserveNodeUpdateAfterAction ¶
func ObserveNodeUpdateAfterAction(f *framework.Framework, nodeName string, nodePredicate func(*v1.Node) bool, action Action) (bool, error)
Returns true if a node update matching the predicate was emitted from the system after performing the supplied action.
func SkipIfAppArmorNotSupported ¶
func SkipIfAppArmorNotSupported()
Types ¶
type KubeletManagedHostConfig ¶
type KubeletManagedHostConfig struct {
// contains filtered or unexported fields
}
type PrivilegedPodTestConfig ¶
type PrivilegedPodTestConfig struct {
// contains filtered or unexported fields
}
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 NewStaticResourceConsumer ¶
func NewStaticResourceConsumer(name string, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuLimit, memLimit int64, f *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, duration time.Duration)
func (*ResourceConsumer) GetReplicas ¶
func (rc *ResourceConsumer) GetReplicas() int
func (*ResourceConsumer) Pause ¶
func (rc *ResourceConsumer) Pause()
Pause stops background goroutines responsible for consuming resources.
func (*ResourceConsumer) Resume ¶
func (rc *ResourceConsumer) Resume()
Pause starts background goroutines responsible for consuming resources.
func (*ResourceConsumer) WaitForReplicas ¶
func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int, duration time.Duration)
Source Files ¶
- apparmor.go
- autoscaling_utils.go
- configmap.go
- container_probe.go
- docker_containers.go
- downward_api.go
- downwardapi_volume.go
- empty_dir.go
- events.go
- expansion.go
- host_path.go
- init_container.go
- kubelet_etc_hosts.go
- networking.go
- pods.go
- privileged.go
- projected.go
- secrets.go
- sysctl.go
- util.go
- volumes.go