Documentation ¶
Index ¶
- type Client
- func (k *Client) CopyFromPod(podName, podFilePath, localFilePath string) error
- func (k *Client) CopyToPod(localFilePath, podName, podFilePath string) error
- func (k *Client) DeleteJob(name string) error
- func (k *Client) GetPodInfo(name string) (*PodInfo, error)
- func (k *Client) ReadPodLogs(podName, containerName string) (io.ReadCloser, error)
- func (k *Client) RunJob(spec *JobRunSpec) error
- func (k *Client) WaitPod(labelSelector map[string]string) (*PodInfo, error)
- type ContainerConfigInfo
- type ContainerInfo
- type ContainerMount
- type JobRunSpec
- func (j *JobRunSpec) Build(namespace string) *batch.Job
- func (j *JobRunSpec) WithContainerFSVolume(container *ContainerInfo) *JobRunSpec
- func (j *JobRunSpec) WithContainerMountsVolume(container *ContainerInfo) *JobRunSpec
- func (j *JobRunSpec) WithHostProcVolume() *JobRunSpec
- func (j *JobRunSpec) WithHostTmpVolume(path string) *JobRunSpec
- func (j *JobRunSpec) WithPrivilegedOptions() *JobRunSpec
- type JobVolume
- type PodInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Namespace string *kubernetes.Clientset *rest.Config }
Client is kubernetes client set wrapper
func NewClient ¶
func NewClient(clientGetter genericclioptions.RESTClientGetter) (*Client, error)
NewClient return new kubernetes client
func (*Client) CopyFromPod ¶ added in v0.3.0
CopyFromPod - copy file from pod to local file
func (*Client) GetPodInfo ¶
GetPodInfo get info about pod by name
func (*Client) ReadPodLogs ¶
func (k *Client) ReadPodLogs(podName, containerName string) (io.ReadCloser, error)
ReadPodLogs stream logs from pod
func (*Client) RunJob ¶
func (k *Client) RunJob(spec *JobRunSpec) error
RunJob will run job with specified parameters
type ContainerConfigInfo ¶ added in v0.7.0
type ContainerConfigInfo struct { ID string HostProcessID int Mounts []ContainerMount RootFS string Runtime string }
ContainerConfigInfo is an information about container state located at node
func NewContainerConfigInfo ¶ added in v0.7.0
func NewContainerConfigInfo(runtime, id string) (*ContainerConfigInfo, error)
NewContainerConfigInfo returns container configuration state
func (*ContainerConfigInfo) GetTmpSource ¶ added in v0.7.0
func (c *ContainerConfigInfo) GetTmpSource() string
GetTmpSource returns mount point for /tmp folder, depending upon container runtime and existing mounts If container contains mounts to /tmp folder, this mount source path will be used, otherwise – container rootfs
type ContainerInfo ¶
ContainerInfo is an information about container struct
func NewContainerInfo ¶ added in v0.6.0
func NewContainerInfo(cs *core.ContainerStatus) *ContainerInfo
NewContainerInfo returns container info mapped from core.ContainerStatus
func (*ContainerInfo) GetContainerFSVolume ¶ added in v0.6.0
func (c *ContainerInfo) GetContainerFSVolume() JobVolume
GetContainerFSVolume returns JobVolume (mounted from host) that contains container definitions, depending upon container runtime
func (*ContainerInfo) GetContainerSharedVolumes ¶ added in v0.6.0
func (c *ContainerInfo) GetContainerSharedVolumes() JobVolume
GetContainerSharedVolumes returns JobVolume (mounted from host) that contains container additional mounts, depending upon container runtime
type ContainerMount ¶ added in v0.7.0
ContainerMount is an information about available container mounts
type JobRunSpec ¶ added in v0.6.0
type JobRunSpec struct { Args []string Image string Name string Node string Privileged bool Selectors map[string]string Volumes []JobVolume }
JobRunSpec is helper struct to describe job spec customization
func NewJobRunSpec ¶ added in v0.6.0
func NewJobRunSpec(args []string, image string, pod *PodInfo) *JobRunSpec
NewJobRunSpec returns JobRunSpec constructed from specified args, image, pod and container
func (*JobRunSpec) Build ¶ added in v0.7.0
func (j *JobRunSpec) Build(namespace string) *batch.Job
Build returns resulted batch.Job spec from JobRunSpec options
func (*JobRunSpec) WithContainerFSVolume ¶ added in v0.6.0
func (j *JobRunSpec) WithContainerFSVolume(container *ContainerInfo) *JobRunSpec
WithContainerFSVolume add host volume that used to store container file system volumes
func (*JobRunSpec) WithContainerMountsVolume ¶ added in v0.6.0
func (j *JobRunSpec) WithContainerMountsVolume(container *ContainerInfo) *JobRunSpec
WithContainerMountsVolume add host volume that used to store container additional volumes
func (*JobRunSpec) WithHostProcVolume ¶ added in v0.7.0
func (j *JobRunSpec) WithHostProcVolume() *JobRunSpec
WithHostProcVolume adds host volume that used to locate target process memory sections
func (*JobRunSpec) WithHostTmpVolume ¶ added in v0.6.0
func (j *JobRunSpec) WithHostTmpVolume(path string) *JobRunSpec
WithHostTmpVolume add host /tmp volume that used to store output
func (*JobRunSpec) WithPrivilegedOptions ¶ added in v0.7.0
func (j *JobRunSpec) WithPrivilegedOptions() *JobRunSpec
WithPrivilegedOptions adds core.SecurityContext to with SYS_PTRACE capability to core.JobSpec
type PodInfo ¶ added in v0.6.0
type PodInfo struct { Annotations map[string]string Name string Namespace string Node string // contains filtered or unexported fields }
func NewPodInfo ¶ added in v0.6.0
NewPodInfo returns PodInfo generated from core.Pod spec
func (*PodInfo) ContainsMountedTmp ¶ added in v0.6.0
ContainsMountedTmp returns true if container has /tmp folder mounted from host or shared with other container
func (*PodInfo) FindContainerInfo ¶ added in v0.6.0
func (p *PodInfo) FindContainerInfo(container string) (*ContainerInfo, error)
FindContainerInfo returns container info with specified name or error
func (*PodInfo) GetContainerNames ¶ added in v0.6.0
GetContainerNames returns container names associated with pod