pluton

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

README

pluton

Pluton represents a tool to enable testing of kubernetes clusters build upon the kola testing primitives. Each test in pluton recieves a working kubernets cluster to test against rather then a kola.TestCluster. The spawn package is the glue that utilizes the platform package to build a kubernetes cluster from a tool. Right now, Bootkube on gce is the primarily supported kubernets platform.

Roadmap

  • Directly use new harness pkg such that a pluton.Cluster is passed to every test function
  • Begin to build out the ability of tests to register options in the test structure that customize use of the spawn package
  • build a subcommand that looks like pluton daemon [options] ./custom_script in which the custom script is passed the location of a temporary kubeconfig. This will enable use of pluton in other repositories that just rely on a kubeconfig and a single cluster and don't wish to integrate and register tests in to the harness directly
  • Research allowing different implementations of the spawn package.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Masters []platform.Machine
	Workers []platform.Machine
	// contains filtered or unexported fields
}

Cluster represents an interface to test kubernetes clusters The creation is usually implemented by a function that builds the Cluster from a kola TestCluster from the 'spawn' subpackage. Tests may be aware of the implementor function since not all clusters are expected to have the same components nor properties.

func NewCluster

func NewCluster(m Manager, masters, workers []platform.Machine) *Cluster

func (*Cluster) AddMasters

func (c *Cluster) AddMasters(n int) error

AddMasters creates new master nodes for a Cluster and blocks until ready.

func (*Cluster) Kubectl

func (c *Cluster) Kubectl(cmd string) (string, error)

Kubectl will run kubectl from /home/core on the Master Machine

func (*Cluster) Ready

func (c *Cluster) Ready() error

Ready blocks until a Cluster is considered available. The current implementation only checks that all nodes are Registered. TODO: Use the manager interface to allow the implementor to determine when a Cluster is considered available either by exposing enough information for this function to check that certain pods are running or implementing its own `Ready() error` function that gets called to after the nodeCheck in this function.

func (*Cluster) SSH

func (c *Cluster) SSH(cmd string) (stdout, stderr []byte, err error)

SSH is just a convenience function for running SSH commands when you don't care which machine the command runs on. The current implementation chooses the first master node. The signature is slightly different then the machine SSH command and doesn't automatically print stderr. I expect in the future that this will be more unified with the Machine.SSH signature, but for now this is useful to silence all the retry loops from clogging up the test results while giving the option to deal with stderr.

type Manager

type Manager interface {
	AddMasters(n int) ([]platform.Machine, error)
	AddWorkers(n int) ([]platform.Machine, error)
}

A Manager provides higher level management of the underlying Cluster platform.

Directories

Path Synopsis
tests

Jump to

Keyboard shortcuts

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