kubernetes

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Overview

Package kubernetes handles all interactions with the Kubernetes client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API holds an interface for talking to Kubernetes.

func New

func New() (*API, error)

New creates a client for interacting with kubernetes.

func NewFake

func NewFake(objects ...runtime.Object) *API

NewFake creates a fake Kubernetes client for running tests.

func (API) CreateJob

func (k API) CreateJob(name, registryLink string) (*batchv1.Job, error)

CreateJob creates a new job in the Kubernetes cluster.

func (API) DeleteJob

func (k API) DeleteJob(name string) error

DeleteJob deletes the Kubernetes job with the given name

func (API) GetJobLogs

func (k API) GetJobLogs(job string, crashesOnly bool, tailLines int) ([]string, error)

GetJobLogs retrieves the logs from all pods belonging to a given job. If crashesOnly is true, only returns logs from pods that found a crash. If tailLines <= 0, returns the entire log.

func (API) GetJobStatus

func (k API) GetJobStatus(job string) (map[types.PodStatus]int, error)

GetJobStatus retrieves the status of all pods belonging to a given job.

func (API) GetPodLogs

func (k API) GetPodLogs(podName string, tailLines int) (string, error)

GetPodLogs retrieves the last tailLines lines of logs from a pod. If tailLines <= 0, returns the entire log.

func (API) GetPods

func (k API) GetPods(job string) (*corev1.PodList, error)

GetPods retrieves all pods belonging to a job

func (API) ListJobs

func (k API) ListJobs() ([]string, error)

ListJobs lists all jobs on the cluster

Jump to

Keyboard shortcuts

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