Documentation
¶
Index ¶
- func AddLabelsToNode(c clientset.Interface, nodeName string, labels map[string]string) error
- func DoCleanupNode(client clientset.Interface, nodeName string, strategy PrepareNodeStrategy) error
- func DoPrepareNode(client clientset.Interface, node *v1.Node, strategy PrepareNodeStrategy) error
- func FailedContainers(pod *v1.Pod) map[string]ContainerFailures
- func LogPodsOfDeployment(c clientset.Interface, deployment *extensions.Deployment, ...)
- func LogReplicaSetsOfDeployment(deployment *extensions.Deployment, allOldRSs []*extensions.ReplicaSet, ...)
- func MakePodSpec() v1.PodSpec
- func MakeTempDirOrDie(prefix string, baseDir string) string
- func PodNotReady(p *v1.Pod) (bool, error)
- func PodReady(pod *v1.Pod) bool
- func PodRunningReady(p *v1.Pod) (bool, error)
- func PodRunningReadyOrSucceeded(p *v1.Pod) (bool, error)
- func RemoveLabelOffNode(c clientset.Interface, nodeName string, labelKeys []string) error
- func RunDeployment(config DeploymentConfig) error
- func RunJob(config JobConfig) error
- func RunPodAndGetNodeName(c clientset.Interface, pod *v1.Pod, timeout time.Duration) (string, error)
- func RunRC(config RCConfig) error
- func RunReplicaSet(config ReplicaSetConfig) error
- func StartPods(c clientset.Interface, replicas int, namespace string, podNamePrefix string, ...) error
- func TerminatedContainers(pod *v1.Pod) map[string]string
- func VerifyLabelsRemoved(c clientset.Interface, nodeName string, labelKeys []string) error
- func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName string, revision, image string, ...) error
- func WaitForDeploymentStatusValid(c clientset.Interface, d *extensions.Deployment, logf LogfFn, ...) error
- func WaitForPodsWithLabelRunning(c clientset.Interface, ns string, label labels.Selector) error
- func WaitUntilPodIsScheduled(c clientset.Interface, name, namespace string, timeout time.Duration) (*v1.Pod, error)
- type ContainerFailures
- type CountToPodStrategy
- type CountToStrategy
- type DaemonConfig
- type DeploymentConfig
- type JobConfig
- type LabelNodePrepareStrategy
- type LogfFn
- type PodDiff
- type PodStore
- type PrepareNodeStrategy
- type RCConfig
- func (config *RCConfig) GetClient() clientset.Interface
- func (config *RCConfig) GetInternalClient() internalclientset.Interface
- func (config *RCConfig) GetKind() schema.GroupKind
- func (config *RCConfig) GetName() string
- func (config *RCConfig) GetNamespace() string
- func (config *RCConfig) GetReplicas() int
- func (rc *RCConfig) RCConfigLog(fmt string, args ...interface{})
- func (config *RCConfig) Run() error
- func (config *RCConfig) SetClient(c clientset.Interface)
- func (config *RCConfig) SetInternalClient(c internalclientset.Interface)
- type RCStartupStatus
- type ReplicaSetConfig
- type RunObjectConfig
- type SecretConfig
- type TestNodePreparer
- type TestPodCreateStrategy
- type TestPodCreator
- type TestPodCreatorConfig
- type TrivialNodePrepareStrategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLabelsToNode ¶ added in v1.5.0
func DoCleanupNode ¶ added in v1.5.0
func DoCleanupNode(client clientset.Interface, nodeName string, strategy PrepareNodeStrategy) error
func DoPrepareNode ¶ added in v1.5.0
func FailedContainers ¶ added in v1.4.6
func FailedContainers(pod *v1.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 LogPodsOfDeployment ¶ added in v1.7.0
func LogPodsOfDeployment(c clientset.Interface, deployment *extensions.Deployment, rsList []*extensions.ReplicaSet, logf LogfFn)
func LogReplicaSetsOfDeployment ¶ added in v1.7.0
func LogReplicaSetsOfDeployment(deployment *extensions.Deployment, allOldRSs []*extensions.ReplicaSet, newRS *extensions.ReplicaSet, logf LogfFn)
func MakePodSpec ¶ added in v1.5.0
func MakeTempDirOrDie ¶
func PodNotReady ¶ added in v1.4.6
PodNotReady checks whether pod p's has a ready condition of status false.
func PodReady ¶ added in v1.4.6
podReady returns whether pod has a condition of Ready with a status of true. TODO: should be replaced with podutil.IsPodReady
func PodRunningReady ¶ added in v1.4.6
PodRunningReady checks whether pod p's phase is running and it has a ready condition of status true.
func PodRunningReadyOrSucceeded ¶ added in v1.4.6
func RemoveLabelOffNode ¶ added in v1.5.0
RemoveLabelOffNode is for cleaning up labels temporarily added to node, won't fail if target label doesn't exist or has been removed.
func RunDeployment ¶ added in v1.5.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 RunJob ¶ added in v1.6.0
RunJob baunches (and verifies correctness) of a Job 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 RunPodAndGetNodeName ¶ added in v1.6.0
func RunRC ¶ added in v1.5.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 RunReplicaSet ¶ added in v1.5.0
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 StartPods ¶ added in v1.5.0
func StartPods(c clientset.Interface, replicas int, namespace string, podNamePrefix string, pod v1.Pod, waitForRunning bool, logFunc func(fmt string, args ...interface{})) error
Simplified version of RunRC, that does not create RC, but creates plain Pods. Optionally waits for pods to start running (if waitForRunning == true). The number of replicas must be non-zero.
func TerminatedContainers ¶ added in v1.4.6
TerminatedContainers inspects all containers in a pod and returns a map of "container name: termination reason", for all currently terminated containers.
func VerifyLabelsRemoved ¶ added in v1.5.0
VerifyLabelsRemoved checks if Node for given nodeName does not have any of labels from labelKeys. Return non-nil error if it does.
func WaitForDeploymentRevisionAndImage ¶ added in v1.7.0
func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName string, revision, image string, logf LogfFn, pollInterval, pollTimeout time.Duration) error
WaitForDeploymentRevisionAndImage waits for the deployment's and its new RS's revision and container image to match the given revision and image. Note that deployment revision and its new RS revision should be updated shortly, so we only wait for 1 minute here to fail early.
func WaitForDeploymentStatusValid ¶ added in v1.7.0
func WaitForDeploymentStatusValid(c clientset.Interface, d *extensions.Deployment, logf LogfFn, pollInterval, pollTimeout time.Duration) error
Waits for the deployment status to become valid (i.e. max unavailable and max surge aren't violated anymore). Note that the status should stay valid at all times unless shortly after a scaling event or the deployment is just created. To verify that the deployment status is valid and wait for the rollout to finish, use WaitForDeploymentStatus instead.
func WaitForPodsWithLabelRunning ¶ added in v1.5.0
Wait up to 10 minutes for all matching pods to become Running and at least one matching pod exists.
Types ¶
type ContainerFailures ¶ added in v1.4.6
type ContainerFailures struct { Restarts int // contains filtered or unexported fields }
type CountToPodStrategy ¶ added in v1.5.0
type CountToPodStrategy struct { Count int Strategy TestPodCreateStrategy }
type CountToStrategy ¶ added in v1.5.0
type CountToStrategy struct { Count int Strategy PrepareNodeStrategy }
type DaemonConfig ¶ added in v1.6.0
type DaemonConfig struct { Client clientset.Interface Name string Namespace string Image string // If set this function will be used to print log lines instead of glog. LogFunc func(fmt string, args ...interface{}) // How long we wait for DaemonSet to become running. Timeout time.Duration }
func (*DaemonConfig) Run ¶ added in v1.6.0
func (config *DaemonConfig) Run() error
type DeploymentConfig ¶ added in v1.5.0
type DeploymentConfig struct {
RCConfig
}
func (*DeploymentConfig) GetKind ¶ added in v1.6.0
func (config *DeploymentConfig) GetKind() schema.GroupKind
func (*DeploymentConfig) Run ¶ added in v1.6.0
func (config *DeploymentConfig) Run() error
type LabelNodePrepareStrategy ¶ added in v1.5.0
type LabelNodePrepareStrategy struct {
// contains filtered or unexported fields
}
func NewLabelNodePrepareStrategy ¶ added in v1.5.0
func NewLabelNodePrepareStrategy(labelKey string, labelValue string) *LabelNodePrepareStrategy
func (*LabelNodePrepareStrategy) CleanupNode ¶ added in v1.5.0
func (s *LabelNodePrepareStrategy) CleanupNode(node *v1.Node) *v1.Node
func (*LabelNodePrepareStrategy) PreparePatch ¶ added in v1.5.0
func (s *LabelNodePrepareStrategy) PreparePatch(*v1.Node) []byte
type PodDiff ¶ added in v1.5.0
type PodDiff map[string]*podInfo
PodDiff is a map of pod name to podInfos
type PodStore ¶ added in v1.5.0
type PodStore struct { cache.Store Reflector *cache.Reflector // contains filtered or unexported fields }
Convenient wrapper around cache.Store that returns list of v1.Pod instead of interface{}.
func NewPodStore ¶ added in v1.5.0
type PrepareNodeStrategy ¶ added in v1.5.0
type RCConfig ¶ added in v1.5.0
type RCConfig struct { Client clientset.Interface InternalClient internalclientset.Interface 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 *v1.Probe DNSPolicy *v1.DNSPolicy // Env vars, set the same for every pod. Env map[string]string // Extra labels added to every pod. Labels map[string]string // Node selector for pods in the RC. NodeSelector 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 []v1.Volume VolumeMounts []v1.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 *[]*v1.Pod // Maximum allowable container failures. If exceeded, RunRC returns an error. // Defaults to replicas*0.1 if unspecified. MaxContainerFailures *int // If set to false starting RC will print progress, otherwise only errors will be printed. Silent bool // If set this function will be used to print log lines instead of glog. LogFunc func(fmt string, args ...interface{}) // If set those functions will be used to gather data from Nodes - in integration tests where no // kubelets are running those variables should be nil. NodeDumpFunc func(c clientset.Interface, nodeNames []string, logFunc func(fmt string, args ...interface{})) ContainerDumpFunc func(c clientset.Interface, ns string, logFunc func(ftm string, args ...interface{})) // Names of the secrets to mount SecretNames []string }
func (*RCConfig) GetInternalClient ¶ added in v1.6.0
func (config *RCConfig) GetInternalClient() internalclientset.Interface
func (*RCConfig) GetNamespace ¶ added in v1.6.0
func (*RCConfig) GetReplicas ¶ added in v1.6.0
func (*RCConfig) RCConfigLog ¶ added in v1.5.0
func (*RCConfig) SetInternalClient ¶ added in v1.6.0
func (config *RCConfig) SetInternalClient(c internalclientset.Interface)
type RCStartupStatus ¶ added in v1.5.0
type RCStartupStatus struct { Expected int Terminating int Running int RunningButNotReady int Waiting int Pending int Unknown int Inactive int FailedContainers int Created []*v1.Pod ContainerRestartNodes sets.String }
func ComputeRCStartupStatus ¶ added in v1.5.0
func ComputeRCStartupStatus(pods []*v1.Pod, expected int) RCStartupStatus
func (*RCStartupStatus) String ¶ added in v1.5.0
func (s *RCStartupStatus) String(name string) string
type ReplicaSetConfig ¶ added in v1.5.0
type ReplicaSetConfig struct {
RCConfig
}
func (*ReplicaSetConfig) GetKind ¶ added in v1.6.0
func (config *ReplicaSetConfig) GetKind() schema.GroupKind
func (*ReplicaSetConfig) Run ¶ added in v1.6.0
func (config *ReplicaSetConfig) Run() error
type RunObjectConfig ¶ added in v1.6.0
type SecretConfig ¶ added in v1.6.0
type SecretConfig struct { Content map[string]string Client clientset.Interface Name string Namespace string // If set this function will be used to print log lines instead of glog. LogFunc func(fmt string, args ...interface{}) }
func (*SecretConfig) Run ¶ added in v1.6.0
func (config *SecretConfig) Run() error
func (*SecretConfig) Stop ¶ added in v1.6.0
func (config *SecretConfig) Stop() error
type TestNodePreparer ¶ added in v1.5.0
type TestPodCreateStrategy ¶ added in v1.5.0
func NewCustomCreatePodStrategy ¶ added in v1.5.0
func NewCustomCreatePodStrategy(podTemplate *v1.Pod) TestPodCreateStrategy
func NewSimpleCreatePodStrategy ¶ added in v1.5.0
func NewSimpleCreatePodStrategy() TestPodCreateStrategy
func NewSimpleWithControllerCreatePodStrategy ¶ added in v1.5.0
func NewSimpleWithControllerCreatePodStrategy(controllerName string) TestPodCreateStrategy
type TestPodCreator ¶ added in v1.5.0
type TestPodCreator struct { Client clientset.Interface // namespace -> count -> strategy Config *TestPodCreatorConfig }
func NewTestPodCreator ¶ added in v1.5.0
func NewTestPodCreator(client clientset.Interface, config *TestPodCreatorConfig) *TestPodCreator
func (*TestPodCreator) CreatePods ¶ added in v1.5.0
func (c *TestPodCreator) CreatePods() error
type TestPodCreatorConfig ¶ added in v1.5.0
type TestPodCreatorConfig map[string][]CountToPodStrategy
func NewTestPodCreatorConfig ¶ added in v1.5.0
func NewTestPodCreatorConfig() *TestPodCreatorConfig
func (*TestPodCreatorConfig) AddStrategy ¶ added in v1.5.0
func (c *TestPodCreatorConfig) AddStrategy( namespace string, podCount int, strategy TestPodCreateStrategy)
type TrivialNodePrepareStrategy ¶ added in v1.5.0
type TrivialNodePrepareStrategy struct{}
func (*TrivialNodePrepareStrategy) CleanupNode ¶ added in v1.5.0
func (*TrivialNodePrepareStrategy) CleanupNode(node *v1.Node) *v1.Node
func (*TrivialNodePrepareStrategy) PreparePatch ¶ added in v1.5.0
func (*TrivialNodePrepareStrategy) PreparePatch(*v1.Node) []byte