cluster

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// List of master nodes.
	Masters []*v1.Node
	// List of worker nodes.
	Workers []*v1.Node
	// MaxDisruption defines the max no. of nodes that will be rebooted in parallel.
	// Accepts int eg. '3' for no. of nodes, and string '30%' for percent.
	// Defaults to 100%.
	MaxDisruption intstr.IntOrString
	// contains filtered or unexported fields
}

Cluster is a simple abstraction that stores cluster nodes. It allows rebooting the entire cluster / nodes.

func New

func New(client kubernetes.Interface, opts ...Options) (*Cluster, error)

New creates a new Cluster with the given options.

func (*Cluster) RebootAll

func (cl *Cluster) RebootAll(rebootDuration time.Duration) error

RebootAll reboots all the nodes that are accessible ie. have ExternalIP.

func (*Cluster) RebootMasters

func (cl *Cluster) RebootMasters(rebootDuration time.Duration) error

RebootMasters reboots all the master nodes that are accessible ie. have ExternalIP.

func (*Cluster) RebootNode

func (cl *Cluster) RebootNode(host string, rebootDuration time.Duration) error

RebootNode reboots a node addressable with `host`. Uses *Cluster sshClient.

func (*Cluster) RebootWorkers

func (cl *Cluster) RebootWorkers(rebootDuration time.Duration) error

RebootWorkers reboots all the worker nodes that are accessible ie. have ExternalIP.

type Options

type Options func(c *Cluster)

Options sets Cluster object options.

func WithMaxDisruption

func WithMaxDisruption(d interface{}) Options

WithMaxDisruption defines the no. of parallel nodes rebooting.

func WithSSHIdentityKeyFile

func WithSSHIdentityKeyFile(path string) Options

WithSSHIdentityKeyFile defines the path of the key to be used for ssh.

func WithSSHPort

func WithSSHPort(p int32) Options

WithSSHPort defines the port to be used for ssh.

func WithSSHUser

func WithSSHUser(u string) Options

WithSSHUser defines the user to be used for ssh.

Jump to

Keyboard shortcuts

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