Documentation
¶
Index ¶
- Constants
- func CheckEvictionSupport(clientSet kubernetes.Interface) (string, error)
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- type Client
- func (c *Client) Create(ctx context.Context, pod *v1.Pod) *Pod
- func (c *Client) Delete(ctx context.Context, pod *v1.Pod) *Pod
- func (c *Client) DeleteAll(ctx context.Context) error
- func (c *Client) DeleteOrEvictPods(ctx context.Context, nodeName string, gracePeriodSeconds int) error
- func (c *Client) EvictPod(ctx context.Context, pod corev1.Pod, policyGroupVersion string, ...) error
- func (c *Client) EvictPods(ctx context.Context, podList *v1.PodList, policyGroupVersion string, ...) error
- func (c *Client) Exec(ctx context.Context, pod *v1.Pod, command []string, stdout, stderr io.Writer, ...) error
- func (c *Client) IsOCP() (bool, error)
- func (c *Client) MakeEphemeralPod(config *Config) *v1.Pod
- func (c *Client) MakePod(config *Config) *v1.Pod
- func (c *Client) MakePodFromYaml(_ string) *v1.Pod
- func (c *Client) ReadyPodsCount(ctx context.Context) (int, error)
- func (c *Client) Update(_ *v1.Pod)
- func (c *Client) WaitForAllToBeReady(ctx context.Context) error
- type CommandExecutor
- type Config
- type DefaultRemoteExecutor
- type LocalExecutor
- type Pod
- type RemoteExecutor
Constants ¶
const ( // Poll is a poll interval for Pod Poll = 2 * time.Second // Timeout is a timeout for Pod operations Timeout = 1800 * time.Second // Block VolumeMode Block = "Block" // EvictionKind represents the kind of evictions object EvictionKind = "Eviction" // EvictionSubresource represents the kind of evictions object as pod's subresource EvictionSubresource = "pods/eviction" Policy = "policy" )
Variables ¶
This section is empty.
Functions ¶
func CheckEvictionSupport ¶ added in v1.8.0
func CheckEvictionSupport(clientSet kubernetes.Interface) (string, error)
func GetPodCondition ¶
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodCondition returns pod condition
func GetPodConditionFromList ¶
func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodConditionFromList returns pods and conditions
func GetPodReadyCondition ¶
func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
GetPodReadyCondition returns Pod status
func IsPodReadyConditionTrue ¶
IsPodReadyConditionTrue returns true if Pod is in Ready state
Types ¶
type Client ¶
type Client struct {
Interface v1core.PodInterface
ClientSet kubernetes.Interface
Config *restclient.Config
Namespace string
Timeout int
RemoteExecutor RemoteExecutor
LocalExecutor LocalExecutor
// contains filtered or unexported fields
}
Client contains node client information
func (*Client) DeleteOrEvictPods ¶
func (c *Client) DeleteOrEvictPods(ctx context.Context, nodeName string, gracePeriodSeconds int) error
DeleteOrEvictPods deletes or evicts pod from a node
func (*Client) EvictPod ¶
func (c *Client) EvictPod(ctx context.Context, pod corev1.Pod, policyGroupVersion string, gracePeriodSeconds int) error
EvictPod evicts pod from a node
func (*Client) Exec ¶
func (c *Client) Exec(ctx context.Context, pod *v1.Pod, command []string, stdout, stderr io.Writer, quiet bool) error
Exec runs the pod
func (*Client) MakeEphemeralPod ¶
MakeEphemeralPod creates an ephemeral pod
func (*Client) MakePodFromYaml ¶
MakePodFromYaml creates pod from yaml manifest
func (*Client) ReadyPodsCount ¶
ReadyPodsCount returns the number of Pods in Ready state
type CommandExecutor ¶ added in v1.8.0
type CommandExecutor struct{}
type Config ¶
type Config struct {
Name string
NamePrefix string
VolumeName string
VolumeMode string
MountPath string
ContainerName string
ContainerImage string
PvcNames []string
Command []string
Args []string
Capabilities []v1.Capability
Annotations map[string]string
EnvVars []v1.EnvVar
CSIVolumeSource v1.CSIVolumeSource
ReadOnlyFlag bool
}
Config contains volume configuration parameters
type DefaultRemoteExecutor ¶
type DefaultRemoteExecutor struct{}
DefaultRemoteExecutor represents default remote executor
func (*DefaultRemoteExecutor) Execute ¶
func (*DefaultRemoteExecutor) Execute(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool, terminalSizeQueue remotecommand.TerminalSizeQueue) error
Execute executes remote command
type LocalExecutor ¶ added in v1.8.0
type Pod ¶
type Pod struct {
Client *Client
Object *v1.Pod
Deleted bool
// contains filtered or unexported fields
}
Pod contains pod related information
func (*Pod) IsInPendingState ¶
IsInPendingState checks whether a pod is in Pending state
func (*Pod) WaitForRunning ¶
WaitForRunning stalls until pod is ready
type RemoteExecutor ¶ added in v1.8.0
type RemoteExecutor interface {
Execute(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool, terminalSizeQueue remotecommand.TerminalSizeQueue) error
}