node

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ServerVersion is used to parse out the version of the API running
	ServerVersion = `(Server Version:\s)+(.*)`
)

Variables

This section is empty.

Functions

func AreAllReady

func AreAllReady(nodeCount int) bool

AreAllReady returns a bool depending on cluster state

func Version

func Version() (string, error)

Version get the version of the server

func WaitOnReady

func WaitOnReady(nodeCount int, sleep, duration time.Duration) bool

WaitOnReady will block until all nodes are in ready state

Types

type Address

type Address struct {
	Address string `json:"address"`
	Type    string `json:"type"`
}

Address contains an address and a type

type Condition

type Condition struct {
	LastHeartbeatTime  time.Time `json:"lastHeartbeatTime"`
	LastTransitionTime time.Time `json:"lastTransitionTime"`
	Message            string    `json:"message"`
	Reason             string    `json:"reason"`
	Status             string    `json:"status"`
	Type               string    `json:"type"`
}

Condition contains various status information

type Info

type Info struct {
	ContainerRuntimeVersion string `json:"containerRuntimeVersion"`
	KubeProxyVersion        string `json:"kubeProxyVersion"`
	KubeletProxyVersion     string `json:"kubeletVersion"`
	OperatingSystem         string `json:"operatingSystem"`
}

Info contains information like what version the kubelet is running

type List

type List struct {
	Nodes []Node `json:"items"`
}

List is used to parse out Nodes from a list

func Get

func Get() (*List, error)

Get returns the current nodes for a given kubeconfig

type Metadata

type Metadata struct {
	Name        string            `json:"name"`
	CreatedAt   time.Time         `json:"creationTimestamp"`
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
}

Metadata contains things like name and created at

type Node

type Node struct {
	Status   Status   `json:"status"`
	Metadata Metadata `json:"metadata"`
}

Node represents the kubernetes Node Resource

func GetByPrefix added in v0.9.0

func GetByPrefix(prefix string) ([]Node, error)

GetByPrefix will return a []Node of all nodes that have a name that match the prefix

type Status

type Status struct {
	Info          Info        `json:"Info"`
	NodeAddresses []Address   `json:"addresses"`
	Conditions    []Condition `json:"conditions"`
}

Status parses information from the status key

func (*Status) GetAddressByType

func (ns *Status) GetAddressByType(t string) *Address

GetAddressByType will return the Address object for a given Kubernetes node

Jump to

Keyboard shortcuts

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