k8s

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client provides convenient API for interacting with k8s core API.

func NewClient

func NewClient() (*Client, error)

NewClient fetches k8s config and initializes core client based on it.

func (*Client) AddNodeLabels

func (c *Client) AddNodeLabels(nodeName string, labels map[string]string) error

AddNodeLabels adds passed labels to node labels.

func (*Client) AddNodeResources

func (c *Client) AddNodeResources(nodeName string, resources map[string]int) error

AddNodeResources adds passed resources to node capacity.

func (*Client) RemoveNodeLabels

func (c *Client) RemoveNodeLabels(nodeName string, labels map[string]string) error

RemoveNodeLabels removes nodes labels from node

func (*Client) RemoveNodeResources

func (c *Client) RemoveNodeResources(nodeName string, resources map[string]int) error

RemoveNodeResources removes passed resources from node capacity

type Patch

type Patch struct {
	NodeLabels    map[string]string `yaml:"labels"`
	NodeResources map[string]int    `yaml:"resources"`
}

Patch represents changes that need to be applied to the node.

type WatchDog

type WatchDog struct {
	NodeName       string
	NodeConfigPath string
	Client         *Client
	DefaultLabels  map[string]string
	// contains filtered or unexported fields
}

WatchDog is used to perform node patch and cleanup.

func (*WatchDog) CleanNode

func (w *WatchDog) CleanNode()

CleanNode reverts changes introduced with the latest PatchNode call.

func (*WatchDog) PatchNode

func (w *WatchDog) PatchNode(patch *Patch) error

PatchNode applies passed patch to the node WatchDog is configured to work with. PatchNode cleans up any patch applied before.

Jump to

Keyboard shortcuts

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