cluster

package
v3.9.0-alpha.4+incompa... Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfigmaps

func CreateConfigmaps(oc *exutil.CLI, c kclientset.Interface, nsName string, configmaps map[string]interface{}) error

CreateConfigmaps creates config maps from files in user defined namespaces.

func CreatePods

func CreatePods(c kclientset.Interface, appName string, ns string, labels map[string]string, spec kapiv1.PodSpec, maxCount int, tuning *TuningSetType, sync *SyncObjectType) error

CreatePods creates pods in user defined namespaces with user configurable tuning sets

func CreateSecrets

func CreateSecrets(oc *exutil.CLI, c kclientset.Interface, nsName string, secrets map[string]interface{}) error

CreateSecrets creates secrets from files in user defined namespaces.

func CreateTemplates

func CreateTemplates(oc *exutil.CLI, c kclientset.Interface, nsName string, template ClusterLoaderObjectType, templateCount int, tuning *TuningSetType) error

CreateTemplates creates templates in user defined namespaces with user configurable tuning sets.

func InjectConfigMap

func InjectConfigMap(c kclientset.Interface, ns string, vars map[string]interface{}, config kapiv1.Pod) string

InjectConfigMap modifies the pod struct and replaces the environment variables.

func ParseConfig

func ParseConfig(config string, isFixture bool) error

ParseConfig will complete flag parsing as well as viper tasks

func ParsePods

func ParsePods(jsonFile string) (configStruct kapiv1.Pod)

ParsePods unmarshalls the json file defined in the CL config into a struct

func Server

func Server(c *PodCount, port int, awaitShutdown bool) error

Server is the webservice that will synchronize the start and stop of Pods

func SyncPods

func SyncPods(c kclientset.Interface, ns string, selectors map[string]string, timeout time.Duration, state kapiv1.PodPhase) (err error)

SyncPods waits for pods to enter a state

func SyncRunningPods

func SyncRunningPods(c kclientset.Interface, ns string, selectors map[string]string, timeout time.Duration) (err error)

SyncRunningPods waits for pods to enter Running state

func SyncSucceededPods

func SyncSucceededPods(c kclientset.Interface, ns string, selectors map[string]string, timeout time.Duration) (err error)

SyncSucceededPods waits for pods to enter Completed state

Types

type ClusterLoaderObjectType

type ClusterLoaderObjectType struct {
	Total      int
	Number     int `mapstructure:"num"`
	Image      string
	Basename   string
	File       string
	Sync       SyncObjectType
	Parameters map[string]interface{}
}

ClusterLoaderObjectType is nested object type for cluster loader struct

type ClusterLoaderType

type ClusterLoaderType struct {
	Number     int `mapstructure:"num"`
	Basename   string
	Tuning     string
	Configmaps map[string]interface{}
	Secrets    map[string]interface{}
	Pods       []ClusterLoaderObjectType
	Templates  []ClusterLoaderObjectType
}

ClusterLoaderType struct only used for Cluster Loader test config

type ContextType

type ContextType struct {
	ClusterLoader struct {
		Cleanup    bool
		Projects   []ClusterLoaderType
		Sync       SyncObjectType
		TuningSets []TuningSetType
	}
}

ContextType is the root config struct

var ConfigContext ContextType

ConfigContext variable of type ContextType

type PodCount

type PodCount struct {
	Started  int
	Stopped  int
	Shutdown chan bool
}

PodCount struct keeps HTTP requst counts and state

type ServiceInfo

type ServiceInfo struct {
	Name string
	IP   string
	Port int32
}

ServiceInfo struct to bundle env data

type SyncObjectType

type SyncObjectType struct {
	Server struct {
		Enabled bool
		Port    int
	}
	Running   bool
	Succeeded bool
	Selectors map[string]string
	Timeout   string
}

SyncObjectType is nested object type for cluster loader synchronisation functionality

type TestResult

type TestResult struct {
	Time time.Duration `json:"time"`
}

TestResult struct contains result data to be saved at end of run

type TuningSetObjectType

type TuningSetObjectType struct {
	Stepping struct {
		StepSize int
		Pause    time.Duration
		Timeout  time.Duration
	}
	RateLimit struct {
		Delay time.Duration
	}
}

TuningSetObjectType is shared struct for Pods & Templates

type TuningSetType

type TuningSetType struct {
	Name      string
	Pods      TuningSetObjectType
	Templates TuningSetObjectType
}

TuningSetType is nested type for controlling Cluster Loader deployment pattern

func GetTuningSet

func GetTuningSet(tuningSets []TuningSetType, podTuning string) (tuning *TuningSetType)

GetTuningSet matches the name of the tuning set defined in the project and returns a pointer to the set

Jump to

Keyboard shortcuts

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