kubernetes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2017 License: MIT Imports: 8 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

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) NamespaceInConfig

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

NamespaceInConfig returns namespace set in kubeconfig

func (*Client) WatchPodEvents

func (c *Client) WatchPodEvents(ctx context.Context, namespace, labels string, notifySuccess, notifyFail bool, succeededFunc, failedFunc NotifyFunc) error

WatchPodEvents watches Pod events

type NotifyFunc

type NotifyFunc func(event *PodEvent) error

NotifyFunc represents callback function for Pod event

type PodEvent

type PodEvent struct {
	Namespace  string
	PodName    string
	StartedAt  time.Time
	FinishedAt time.Time
	ExitCode   int
	Reason     string
	Message    string
}

PodEvent represents Pod termination event

Jump to

Keyboard shortcuts

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