v1alpha1

package
v0.0.0-...-a88c85e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Builder

func Builder() *builder

Builder returns a new instance of builder

func New

func New(opts ...OptionFunc) corev1.Toleration

New returns a new kubernetes toleration

func NoScheduleOnMaster

func NoScheduleOnMaster() corev1.Toleration

NoScheduleOnMaster returns a kubernetes toleration that disables scheduling of Pods on master kubernetes nodes

Types

type OptionFunc

type OptionFunc func(*toleration)

OptionFunc is a typed function that abstracts anykind of operation against the provided toleration instance

This is the basic building block to create functional operations against the toleration instance

func NoSchedule

func NoSchedule() OptionFunc

NoSchedule sets NoSchedule effect to the toleration

func WithEffect

func WithEffect(e corev1.TaintEffect) OptionFunc

WithEffect sets the effect of the toleration

func WithKey

func WithKey(k string) OptionFunc

WithKey sets the key of the toleration

func WithOperator

func WithOperator(o corev1.TolerationOperator) OptionFunc

WithOperator sets the operator of the toleration

func WithTolerationSeconds

func WithTolerationSeconds(sec *int64) OptionFunc

WithTolerationSeconds sets the toleration seconds of the toleration

func WithValue

func WithValue(val string) OptionFunc

WithValue sets the value of the toleration

type Predicate

type Predicate func(*toleration) (message string, ok bool)

Predicate abstracts conditional logic w.r.t toleration instance

NOTE: Predicate is a functional approach versus traditional approach to mix conditions such as *if-else* within blocks of business logic

NOTE: Predicate approach enables clear separation of conditionals from imperatives i.e. actions that form the business logic

type TolerationKey

type TolerationKey string

TolerationKey identifies keys associated with toleration; where a key can be present in labels or in annotations

const (
	// MasterNodeTolerationKey determines the master node via this toleration key
	MasterNodeTolerationKey TolerationKey = "node-role.kubernetes.io/master"
)

Jump to

Keyboard shortcuts

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