Documentation
¶
Overview ¶
Package pods provides implementation of Pod resources for Kubernetes
Index ¶
- Constants
- type ContainerOptions
- type EphemeralContainerOptions
- type ExecOptions
- type ExecResult
- type PodOptions
- type Pods
- func (obj *Pods) AddEphemeralContainer(name, namespace string, options EphemeralContainerOptions) error
- func (obj *Pods) Create(options PodOptions) (k8sTypes.Pod, error)
- func (obj *Pods) Delete(name, namespace string, opts metav1.DeleteOptions) error
- func (obj *Pods) Exec(options ExecOptions) (*ExecResult, error)
- func (obj *Pods) Get(name, namespace string) (k8sTypes.Pod, error)
- func (obj *Pods) IsTerminating(name, namespace string) (bool, error)
- func (obj *Pods) Kill(name, namespace string, opts metav1.DeleteOptions) error
- func (obj *Pods) List(namespace string) ([]k8sTypes.Pod, error)
- func (obj *Pods) Wait(options WaitOptions) (bool, error)
- type WaitOptions
Constants ¶
const ( Running string = "Running" Succeeded string = "Succeeded" )
ValidPod status
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerOptions ¶
type ContainerOptions struct { Name string // name of the container Image string // image to be attached PullPolicy k8sTypes.PullPolicy Command []string // command to be executed by the container Capabilities []string // capabilities to be added to the container's security context }
ContainerOptions describes a container to be started in a pod
type EphemeralContainerOptions ¶
type EphemeralContainerOptions struct { ContainerOptions Wait string }
EphemeralContainerOptions describes the options for creating an ephemeral container in a pod
type ExecOptions ¶
type ExecOptions struct { Namespace string // namespace where the pod is running Pod string // name of the Pod to execute the command in Container string // name of the container to execute the command in Command []string // command to be executed with its parameters Stdin []byte // stdin to be supplied to the command }
ExecOptions describe the command to be executed and the target container
type ExecResult ¶
ExecResult contains the output obtained from the execution of a command
type PodOptions ¶
type PodOptions struct { Namespace string // namespace where the pod will be executed Name string // name of the pod Image string // image to be executed by the pod's container PullPolicy k8sTypes.PullPolicy Command []string // command to be executed by the pod's container and its arguments RestartPolicy k8sTypes.RestartPolicy // policy for restarting containers in the pod [Always|OnFailure|Never] Wait string // timeout for waiting until the pod is running }
PodOptions describe a Pod to be executed
type Pods ¶
type Pods struct {
// contains filtered or unexported fields
}
Pods provides API for manipulating Pod resources within a Kubernetes cluster
func New ¶
func New(ctx context.Context, client kubernetes.Interface, config *rest.Config, metaOptions metav1.ListOptions) *Pods
New creates a new instance backed by the provided client
func (*Pods) AddEphemeralContainer ¶
func (obj *Pods) AddEphemeralContainer(name, namespace string, options EphemeralContainerOptions) error
AddEphemeralContainer adds an ephemeral container to a running pod. The Pod is identified by name and namespace. The container is described by options
func (*Pods) Create ¶
func (obj *Pods) Create(options PodOptions) (k8sTypes.Pod, error)
Create runs a pod specified by the options
func (*Pods) Delete ¶
func (obj *Pods) Delete(name, namespace string, opts metav1.DeleteOptions) error
Delete removes the named Pod from the namespace
func (*Pods) Exec ¶
func (obj *Pods) Exec(options ExecOptions) (*ExecResult, error)
Exec executes a non-interactive command described in options and returns the stdout and stderr outputs
func (*Pods) IsTerminating ¶
IsTerminating returns if the state of the named pod is currently terminating
func (*Pods) Kill ¶
func (obj *Pods) Kill(name, namespace string, opts metav1.DeleteOptions) error
Kill removes the named Pod from the namespace Deprecated: Use Delete instead.
type WaitOptions ¶
type WaitOptions struct { Name string // Pod name Namespace string // Namespace where the pod is running Status string // Wait until pod reaches the specified status. Must be one of "Running" or "Succeeded". Timeout string // Timeout for waiting condition to be true }
WaitOptions for waiting for a Pod status