kubernetes

package
v0.0.0-...-609212d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigFile

func DefaultConfigFile() string

DefaultConfigFile returns the default kubeconfig file path

func DefaultNamespace

func DefaultNamespace() string

DefaultNamespace returns the default namespace

func IsJobFinished

func IsJobFinished(job batchv1.Job) bool

IsJobFinished returns whether the given Job has finished or not

func IsPodFinished

func IsPodFinished(pod v1.Pod) bool

IsPodFinished returns whether the given Pod has finished or not

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents the wrapper of Kubernetes API client

func NewClient

func NewClient(kubeconfig, context string) (*Client, error)

NewClient creates Client object using local kubecfg

func NewClientInCluster

func NewClientInCluster() (*Client, error)

NewClientInCluster creates Client object in Kubernetes cluster

func (*Client) DeleteJob

func (c *Client) DeleteJob(job batchv1.Job) error

DeleteJob deletes the given Job

func (*Client) DeletePod

func (c *Client) DeletePod(pod v1.Pod) error

DeletePod deletes the given Pod

func (*Client) ListJobs

func (c *Client) ListJobs(namespace string) (*batchv1.JobList, error)

ListJobs returns the list of Jobs

func (*Client) ListPods

func (c *Client) ListPods(namespace string) (*v1.PodList, error)

ListPods returns the list of Pods

func (*Client) NamespaceInConfig

func (c *Client) NamespaceInConfig() (string, error)

NamespaceInConfig returns namespace set in kubeconfig

type Jobs

type Jobs []batchv1.Job

Jobs represents job list

func (Jobs) Len

func (j Jobs) Len() int

Len return the length of job list

func (Jobs) Less

func (j Jobs) Less(m, n int) bool

Less returns whether the former item is less than the latter item or not

func (Jobs) Swap

func (j Jobs) Swap(m, n int)

Swap swaps two items

type Pods

type Pods []v1.Pod

Jobs represents job list

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL