Documentation ¶
Index ¶
- Constants
- Variables
- func CreateAppArmorTestPod(f *framework.Framework, unconfined bool, runOnce bool) *api.Pod
- func CreateCPUHorizontalPodAutoscaler(rc *ResourceConsumer, cpu, minReplicas, maxRepl int32) *autoscalingv1.HorizontalPodAutoscaler
- func DeleteHorizontalPodAutoscaler(rc *ResourceConsumer, autoscalerName string)
- func GetResourceConsumerImage() string
- func IsAppArmorSupported() bool
- 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, nodes []v1.Node) error
- func SkipIfAppArmorNotSupported()
- func SubstituteImageName(content string) string
- type Action
- type ConformanceContainer
- func (cc *ConformanceContainer) Create()
- func (cc *ConformanceContainer) Delete() error
- func (cc *ConformanceContainer) GetPhase() (v1.PodPhase, error)
- func (cc *ConformanceContainer) GetStatus() (v1.ContainerStatus, error)
- func (cc *ConformanceContainer) IsReady() (bool, error)
- func (cc *ConformanceContainer) Present() (bool, error)
- type ContainerState
- type KubeletManagedHostConfig
- type PrivilegedPodTestConfig
- type ResourceConsumer
- func NewDynamicResourceConsumer(name, nsName string, kind schema.GroupVersionKind, ...) *ResourceConsumer
- func NewMetricExporter(name, nsName string, podAnnotations, serviceAnnotations map[string]string, ...) *ResourceConsumer
- func NewStaticResourceConsumer(name, nsName string, ...) *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, hpaName string)
- func (rc *ResourceConsumer) EnsureDesiredReplicasInRange(minDesiredReplicas, maxDesiredReplicas int, duration time.Duration, ...)
- func (rc *ResourceConsumer) GetHpa(name string) (*autoscalingv1.HorizontalPodAutoscaler, error)
- 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 ( ContainerStatusRetryTimeout = time.Minute * 5 ContainerStatusPollInterval = time.Second * 1 )
Variables ¶
var ( KindRC = schema.GroupVersionKind{Version: "v1", Kind: "ReplicationController"} KindDeployment = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "Deployment"} KindReplicaSet = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "ReplicaSet"} )
var AppArmorDistros = []string{"gci", "ubuntu"}
AppArmorDistros are distros with AppArmor support
var CommonImageWhiteList = sets.NewString( imageutils.GetE2EImage(imageutils.BusyBox), imageutils.GetE2EImage(imageutils.EntrypointTester), imageutils.GetE2EImage(imageutils.IpcUtils), imageutils.GetE2EImage(imageutils.Liveness), imageutils.GetE2EImage(imageutils.Mounttest), imageutils.GetE2EImage(imageutils.MounttestUser), imageutils.GetE2EImage(imageutils.Netexec), imageutils.GetE2EImage(imageutils.Nginx), imageutils.GetE2EImage(imageutils.ServeHostname), imageutils.GetE2EImage(imageutils.TestWebserver), imageutils.GetE2EImage(imageutils.Hostexec), imageutils.GetE2EImage(imageutils.VolumeNFSServer), imageutils.GetE2EImage(imageutils.VolumeGlusterServer), imageutils.GetE2EImage(imageutils.Net), )
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 ¶ added in v1.6.0
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 ¶ added in v1.6.0
func CreateCPUHorizontalPodAutoscaler(rc *ResourceConsumer, cpu, minReplicas, maxRepl int32) *autoscalingv1.HorizontalPodAutoscaler
func DeleteHorizontalPodAutoscaler ¶ added in v1.7.0
func DeleteHorizontalPodAutoscaler(rc *ResourceConsumer, autoscalerName string)
func GetResourceConsumerImage ¶ added in v1.6.0
func GetResourceConsumerImage() string
func IsAppArmorSupported ¶ added in v1.8.3
func IsAppArmorSupported() bool
func LoadAppArmorProfiles ¶ added in v1.6.0
func NewRCByName ¶ added in v1.8.0
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 ¶ added in v1.6.0
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 ¶ added in v1.6.0
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 ¶ added in v1.6.0
func SkipIfAppArmorNotSupported()
func SubstituteImageName ¶ added in v1.14.0
Types ¶
type ConformanceContainer ¶ added in v1.12.0
type ConformanceContainer struct { Container v1.Container RestartPolicy v1.RestartPolicy Volumes []v1.Volume ImagePullSecrets []string PodClient *framework.PodClient PodSecurityContext *v1.PodSecurityContext // contains filtered or unexported fields }
One pod one container
func (*ConformanceContainer) Create ¶ added in v1.12.0
func (cc *ConformanceContainer) Create()
func (*ConformanceContainer) Delete ¶ added in v1.12.0
func (cc *ConformanceContainer) Delete() error
func (*ConformanceContainer) GetPhase ¶ added in v1.12.0
func (cc *ConformanceContainer) GetPhase() (v1.PodPhase, error)
func (*ConformanceContainer) GetStatus ¶ added in v1.12.0
func (cc *ConformanceContainer) GetStatus() (v1.ContainerStatus, error)
func (*ConformanceContainer) IsReady ¶ added in v1.12.0
func (cc *ConformanceContainer) IsReady() (bool, error)
func (*ConformanceContainer) Present ¶ added in v1.12.0
func (cc *ConformanceContainer) Present() (bool, error)
type ContainerState ¶ added in v1.12.0
type ContainerState string
const ( ContainerStateWaiting ContainerState = "Waiting" ContainerStateRunning ContainerState = "Running" ContainerStateTerminated ContainerState = "Terminated" ContainerStateUnknown ContainerState = "Unknown" )
func GetContainerState ¶ added in v1.12.0
func GetContainerState(state v1.ContainerState) ContainerState
type KubeletManagedHostConfig ¶
type KubeletManagedHostConfig struct {
// contains filtered or unexported fields
}
type PrivilegedPodTestConfig ¶
type PrivilegedPodTestConfig struct {
// contains filtered or unexported fields
}
type ResourceConsumer ¶ added in v1.6.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.6.0
func NewDynamicResourceConsumer(name, nsName string, kind schema.GroupVersionKind, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuLimit, memLimit int64, clientset clientset.Interface, internalClientset *internalclientset.Clientset, scaleClient scaleclient.ScalesGetter) *ResourceConsumer
func NewMetricExporter ¶ added in v1.11.2
func NewMetricExporter(name, nsName string, podAnnotations, serviceAnnotations map[string]string, metricValue int, clientset clientset.Interface, internalClientset *internalclientset.Clientset, scaleClient scaleclient.ScalesGetter) *ResourceConsumer
func NewStaticResourceConsumer ¶ added in v1.6.0
func NewStaticResourceConsumer(name, nsName string, replicas, initCPUTotal, initMemoryTotal, initCustomMetric int, cpuLimit, memLimit int64, clientset clientset.Interface, internalClientset *internalclientset.Clientset, scaleClient scaleclient.ScalesGetter) *ResourceConsumer
TODO this still defaults to replication controller
func (*ResourceConsumer) CleanUp ¶ added in v1.6.0
func (rc *ResourceConsumer) CleanUp()
func (*ResourceConsumer) ConsumeCPU ¶ added in v1.6.0
func (rc *ResourceConsumer) ConsumeCPU(millicores int)
ConsumeCPU consumes given number of CPU
func (*ResourceConsumer) ConsumeCustomMetric ¶ added in v1.6.0
func (rc *ResourceConsumer) ConsumeCustomMetric(amount int)
ConsumeMem consumes given number of custom metric
func (*ResourceConsumer) ConsumeMem ¶ added in v1.6.0
func (rc *ResourceConsumer) ConsumeMem(megabytes int)
ConsumeMem consumes given number of Mem
func (*ResourceConsumer) EnsureDesiredReplicas ¶ added in v1.6.0
func (rc *ResourceConsumer) EnsureDesiredReplicas(desiredReplicas int, duration time.Duration, hpaName string)
func (*ResourceConsumer) EnsureDesiredReplicasInRange ¶ added in v1.11.6
func (rc *ResourceConsumer) EnsureDesiredReplicasInRange(minDesiredReplicas, maxDesiredReplicas int, duration time.Duration, hpaName string)
func (*ResourceConsumer) GetHpa ¶ added in v1.11.6
func (rc *ResourceConsumer) GetHpa(name string) (*autoscalingv1.HorizontalPodAutoscaler, error)
func (*ResourceConsumer) GetReplicas ¶ added in v1.6.0
func (rc *ResourceConsumer) GetReplicas() int
func (*ResourceConsumer) Pause ¶ added in v1.6.0
func (rc *ResourceConsumer) Pause()
Pause stops background goroutines responsible for consuming resources.
func (*ResourceConsumer) Resume ¶ added in v1.6.0
func (rc *ResourceConsumer) Resume()
Pause starts background goroutines responsible for consuming resources.
func (*ResourceConsumer) WaitForReplicas ¶ added in v1.6.0
func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int, duration time.Duration)
Source Files ¶
- apparmor.go
- autoscaling_utils.go
- configmap.go
- configmap_volume.go
- container.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.go
- kubelet_etc_hosts.go
- lifecycle_hook.go
- networking.go
- node_lease.go
- pods.go
- privileged.go
- projected_combined.go
- projected_configmap.go
- projected_downwardapi.go
- projected_secret.go
- runtime.go
- secrets.go
- secrets_volume.go
- security_context.go
- sysctl.go
- util.go
- volumes.go