Documentation
¶
Index ¶
- func NewAPIServerIdentityToHostNameDecoder(kubeClient kubernetes.Interface) (*apiServerIdentityDecoder, error)
- type BackendSampler
- func (bs *BackendSampler) GetConnectionType() monitorapi.BackendConnectionType
- func (bs *BackendSampler) GetDisruptionBackendName() string
- func (bs *BackendSampler) GetLoadBalancerType() string
- func (bs *BackendSampler) GetLocator() monitorapi.Locator
- func (bs *BackendSampler) GetProtocol() string
- func (bs *BackendSampler) GetTargetServerName() string
- func (bs *BackendSampler) GetURL() (string, error)
- func (bs *BackendSampler) RunEndpointMonitoring(ctx context.Context, m monitorapi.RecorderWriter, ...) error
- func (bs *BackendSampler) StartEndpointMonitoring(ctx context.Context, m monitorapi.RecorderWriter, ...) error
- func (bs *BackendSampler) Stop()
- type Factory
- type Sampler
- type ServerNameType
- type TestConfiguration
- type TestDescriptor
- func (t TestDescriptor) DisruptionLocator() monitorapi.Locator
- func (t TestDescriptor) GetConnectionType() monitorapi.BackendConnectionType
- func (t TestDescriptor) GetLoadBalancerType() backend.LoadBalancerType
- func (t TestDescriptor) GetProtocol() backend.ProtocolType
- func (t TestDescriptor) GetTargetServerName() string
- func (t TestDescriptor) Name() string
- func (t TestDescriptor) ShutdownLocator() monitorapi.Locator
- func (t TestDescriptor) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAPIServerIdentityToHostNameDecoder ¶
func NewAPIServerIdentityToHostNameDecoder(kubeClient kubernetes.Interface) (*apiServerIdentityDecoder, error)
NewAPIServerIdentityToHostNameDecoder returns a new HostNameDecoder instance that is capable of decoding the APIServerIdentity into the human readable hostname.
Types ¶
type BackendSampler ¶
type BackendSampler struct {
TestConfiguration
SampleRunner sampler.Runner
// contains filtered or unexported fields
}
BackendSampler has the machinery to run a disruption test in CI
func (*BackendSampler) GetConnectionType ¶
func (bs *BackendSampler) GetConnectionType() monitorapi.BackendConnectionType
func (*BackendSampler) GetDisruptionBackendName ¶
func (bs *BackendSampler) GetDisruptionBackendName() string
func (*BackendSampler) GetLoadBalancerType ¶
func (bs *BackendSampler) GetLoadBalancerType() string
func (*BackendSampler) GetLocator ¶
func (bs *BackendSampler) GetLocator() monitorapi.Locator
func (*BackendSampler) GetProtocol ¶
func (bs *BackendSampler) GetProtocol() string
func (*BackendSampler) GetTargetServerName ¶
func (bs *BackendSampler) GetTargetServerName() string
func (*BackendSampler) GetURL ¶
func (bs *BackendSampler) GetURL() (string, error)
func (*BackendSampler) RunEndpointMonitoring ¶
func (bs *BackendSampler) RunEndpointMonitoring(ctx context.Context, m monitorapi.RecorderWriter, eventRecorder events.EventRecorder) error
func (*BackendSampler) StartEndpointMonitoring ¶
func (bs *BackendSampler) StartEndpointMonitoring(ctx context.Context, m monitorapi.RecorderWriter, eventRecorder events.EventRecorder) error
func (*BackendSampler) Stop ¶
func (bs *BackendSampler) Stop()
type Factory ¶
type Factory interface {
New(TestConfiguration) (Sampler, error)
}
Factory creates a new instance of a Disruption test from the user specified configuration.
func NewDisruptionTestFactory ¶
func NewDisruptionTestFactory(config *rest.Config, kubeClient kubernetes.Interface) Factory
NewDisruptionTestFactory returns a shared disruption test factory that uses the given rest Config object to create new disruption test instances.
type Sampler ¶
type Sampler interface {
GetTargetServerName() string
GetLoadBalancerType() string
GetConnectionType() monitorapi.BackendConnectionType
GetProtocol() string
GetDisruptionBackendName() string
GetLocator() monitorapi.Locator
GetURL() (string, error)
RunEndpointMonitoring(ctx context.Context, m monitorapi.RecorderWriter, eventRecorder events.EventRecorder) error
StartEndpointMonitoring(ctx context.Context, m monitorapi.RecorderWriter, eventRecorder events.EventRecorder) error
Stop()
}
type ServerNameType ¶
type ServerNameType string
const ( KubeAPIServer ServerNameType = "kube-api" OpenShiftAPIServer ServerNameType = "openshift-api" )
type TestConfiguration ¶
type TestConfiguration struct {
TestDescriptor
// Path is the request path that the backend sampler will exercise
Path string
// Timeout is the transport timeout, it is the maximum amount of time a
// dial will wait for a connect to complete.
// If Deadline is also set, it may fail earlier.
// NOTE: we infer the client timeout and request deadline from this value,
// this is how the current backend sampler works.
Timeout time.Duration
// SampleInterval is the interval that the sampler will
// wait before generating the next sample.
// NOTE: the current backend sampler implementation defaults
// it to 1s.
SampleInterval time.Duration
// EnableShutdownResponseHeader indicates whether to include the shutdown
// response header extractor, this should be true only when the
// request(s) are being sent to the kube-apiserver.
EnableShutdownResponseHeader bool
// Source contains pod name if incluster monitor is used
Source string
}
TestConfiguration allows a user to specify the disruption test parameters
type TestDescriptor ¶
type TestDescriptor struct {
// TargetServer is the server that is is being tested
TargetServer ServerNameType
// LoadBalancerType is the type of load balancer through which the
// disruption test is hitting the target server.
LoadBalancerType backend.LoadBalancerType
// ConnectionType specifies whether the underlying TCP connection(s) used
// by the requests should be new or reused.
ConnectionType monitorapi.BackendConnectionType
// Protocol specifies the protocol used by the test,
// whether it is http/1x or http/2.0
Protocol backend.ProtocolType
}
TestDescriptor defines the disruption test type, the user must provide a complete specification for the desired test.
func (TestDescriptor) DisruptionLocator ¶
func (t TestDescriptor) DisruptionLocator() monitorapi.Locator
func (TestDescriptor) GetConnectionType ¶
func (t TestDescriptor) GetConnectionType() monitorapi.BackendConnectionType
func (TestDescriptor) GetLoadBalancerType ¶
func (t TestDescriptor) GetLoadBalancerType() backend.LoadBalancerType
func (TestDescriptor) GetProtocol ¶
func (t TestDescriptor) GetProtocol() backend.ProtocolType
func (TestDescriptor) GetTargetServerName ¶
func (t TestDescriptor) GetTargetServerName() string
func (TestDescriptor) Name ¶
func (t TestDescriptor) Name() string
func (TestDescriptor) ShutdownLocator ¶
func (t TestDescriptor) ShutdownLocator() monitorapi.Locator
func (TestDescriptor) Validate ¶
func (t TestDescriptor) Validate() error