Documentation ¶
Index ¶
- Constants
- func CreateTestingNamespace(baseName string, apiserver *httptest.Server, t *testing.T) *api.Namespace
- func DeleteTestingNamespace(ns *api.Namespace, apiserver *httptest.Server, t *testing.T)
- func GetEtcdURLFromEnv() string
- func NewEtcdClient() etcd.Client
- func NewIntegrationTestMasterConfig() *master.Config
- func NewMasterConfig() *master.Config
- func NewSingleContentTypeSerializer(scheme *runtime.Scheme, serializer runtime.Serializer, contentType string) runtime.StorageSerializer
- func RCFromManifest(fileName string) *api.ReplicationController
- func RequireEtcd()
- func RunAMaster(masterConfig *master.Config) (*master.Master, *httptest.Server)
- func RunAMasterUsingServer(masterConfig *master.Config, s *httptest.Server, masterReceiver MasterReceiver) (*master.Master, *httptest.Server)
- func RunParallel(task Task, numTasks, numWorkers int)
- func ScaleRC(name, ns string, replicas int32, clientset clientset.Interface) (*api.ReplicationController, error)
- func StopRC(rc *api.ReplicationController, clientset clientset.Interface) error
- func WithEtcdKey(f func(string))
- type Config
- type MasterComponents
- type MasterHolder
- type MasterReceiver
- type Task
Constants ¶
const ( // Timeout used in benchmarks, to eg: scale an rc DefaultTimeout = 30 * time.Minute // Rc manifest used to create pods for benchmarks. // TODO: Convert this to a full path? TestRCManifest = "benchmark-controller.json" )
Variables ¶
This section is empty.
Functions ¶
func CreateTestingNamespace ¶ added in v1.4.0
func DeleteTestingNamespace ¶ added in v1.4.0
func GetEtcdURLFromEnv ¶ added in v1.3.0
func GetEtcdURLFromEnv() string
func NewEtcdClient ¶
func NewIntegrationTestMasterConfig ¶ added in v1.2.0
Returns the master config appropriate for most integration tests.
func NewMasterConfig ¶ added in v1.2.0
Returns a basic master config.
func NewSingleContentTypeSerializer ¶ added in v1.3.0
func NewSingleContentTypeSerializer(scheme *runtime.Scheme, serializer runtime.Serializer, contentType string) runtime.StorageSerializer
NewSingleContentTypeSerializer wraps a serializer in a NegotiatedSerializer that handles one content type
func RCFromManifest ¶
func RCFromManifest(fileName string) *api.ReplicationController
RCFromManifest reads a .json file and returns the rc in it.
func RequireEtcd ¶
func RequireEtcd()
func RunAMasterUsingServer ¶ added in v1.5.0
func RunParallel ¶
RunParallel spawns a goroutine per task in the given queue
func ScaleRC ¶
func ScaleRC(name, ns string, replicas int32, clientset clientset.Interface) (*api.ReplicationController, error)
ScaleRC scales the given rc to the given replicas.
func StopRC ¶
func StopRC(rc *api.ReplicationController, clientset clientset.Interface) error
StopRC stops the rc via kubectl's stop library
func WithEtcdKey ¶
func WithEtcdKey(f func(string))
Types ¶
type Config ¶
type Config struct { // If nil, a default is used, partially filled configs will not get populated. MasterConfig *master.Config StartReplicationManager bool // Client throttling qps QPS float32 // Client burst qps, also burst replicas allowed in rc manager Burst int }
Config is a struct of configuration directives for NewMasterComponents.
type MasterComponents ¶
type MasterComponents struct { // Raw http server in front of the master ApiServer *httptest.Server // Kubernetes master, contains an embedded etcd storage KubeMaster *master.Master // Restclient used to talk to the kubernetes master RestClient *client.Client // Replication controller manager ControllerManager *replicationcontroller.ReplicationManager // contains filtered or unexported fields }
MasterComponents is a control struct for all master components started via NewMasterComponents. TODO: Include all master components (scheduler, nodecontroller). TODO: Reconcile with integration.go, currently the master used there doesn't understand how to restart cleanly, which is required for each iteration of a benchmark. The integration tests also don't make it easy to isolate and turn off components at will.
func NewMasterComponents ¶
func NewMasterComponents(c *Config) *MasterComponents
NewMasterComponents creates, initializes and starts master components based on the given config.
func (*MasterComponents) Stop ¶
func (m *MasterComponents) Stop(apiServer, rcManager bool)
type MasterHolder ¶ added in v1.5.0
MasterHolder implements
func (*MasterHolder) SetMaster ¶ added in v1.5.0
func (h *MasterHolder) SetMaster(m *master.Master)
type MasterReceiver ¶ added in v1.5.0
MasterReceiver can be used to provide the master to a custom incoming server function