Documentation
¶
Index ¶
- Constants
- Variables
- func DiscoverClusterName(config *rest.Config) (string, error)
- func NewClient(config *rest.Config) (client.Client, error)
- func NewConfig() *rest.Config
- type Environment
- func (env *Environment) AfterEach()
- func (env *Environment) BeforeEach()
- func (env *Environment) EventuallyExpectAvgUtilization(resource v1.ResourceName, comparator string, value float64)
- func (env *Environment) EventuallyExpectCreatedNodeCount(comparator string, nodeCount int)
- func (env *Environment) EventuallyExpectHealthy(pods ...*v1.Pod)
- func (env *Environment) EventuallyExpectHealthyPodCount(selector labels.Selector, numPods int)
- func (env *Environment) EventuallyExpectKarpenterWithEnvVar(envVar v1.EnvVar)
- func (env *Environment) EventuallyExpectMinUtilization(resource v1.ResourceName, comparator string, value float64)
- func (env *Environment) EventuallyExpectNotFound(objects ...client.Object)
- func (env *Environment) ExpectCreated(objects ...client.Object)
- func (env *Environment) ExpectCreatedNodeCount(comparator string, nodeCount int)
- func (env *Environment) ExpectDeleted(objects ...client.Object)
- func (env *Environment) ExpectInstance(nodeName string) Assertion
- func (env *Environment) ExpectUniqueNodeNames(selector labels.Selector, uniqueNames int)
- func (env *Environment) ExpectUpdate(objects ...client.Object)
- func (env *Environment) GetInstance(nodeName string) ec2.Instance
- func (env *Environment) GetNode(nodeName string) v1.Node
- func (env *Environment) GetVolume(volumeID *string) ec2.Volume
- type Monitor
- func (m *Monitor) AvgUtilization(resource v1.ResourceName) float64
- func (m *Monitor) CreatedNodes() int
- func (m *Monitor) GetCreatedNodes() []v1.Node
- func (m *Monitor) GetNodes() []v1.Node
- func (m *Monitor) MinUtilization(resource v1.ResourceName) float64
- func (m *Monitor) NodeCount() int
- func (m *Monitor) NodeCountAtReset() int
- func (m *Monitor) Reset()
- func (m *Monitor) RestartCount() map[string]int
- func (m *Monitor) RunningPods(selector labels.Selector) []*v1.Pod
- func (m *Monitor) RunningPodsCount(selector labels.Selector) int
- func (m *Monitor) TotalNodesSeen() int
Constants ¶
View Source
const ( NoWatch = "NoWatch" NoEvents = "NoEvents" )
Variables ¶
View Source
var ( TestLabelName = "testing.karpenter.sh/test-id" CleanableObjects = []client.Object{ &v1.Pod{}, &appsv1.Deployment{}, &appsv1.DaemonSet{}, &policyv1.PodDisruptionBudget{}, &v1.PersistentVolumeClaim{}, &v1.PersistentVolume{}, &storagev1.StorageClass{}, &v1alpha1.AWSNodeTemplate{}, &v1alpha5.Provisioner{}, } )
Functions ¶
Types ¶
type Environment ¶
type Environment struct { context.Context ClusterName string Region string Client client.Client KubeClient kubernetes.Interface EC2API ec2.EC2 SSMAPI ssm.SSM IAMAPI iam.IAM Monitor *Monitor StartingNodeCount int }
func NewEnvironment ¶
func NewEnvironment(t *testing.T) (*Environment, error)
func (*Environment) AfterEach ¶
func (env *Environment) AfterEach()
func (*Environment) EventuallyExpectAvgUtilization ¶ added in v0.15.0
func (env *Environment) EventuallyExpectAvgUtilization(resource v1.ResourceName, comparator string, value float64)
func (*Environment) EventuallyExpectCreatedNodeCount ¶ added in v0.16.2
func (env *Environment) EventuallyExpectCreatedNodeCount(comparator string, nodeCount int)
func (*Environment) EventuallyExpectHealthy ¶
func (env *Environment) EventuallyExpectHealthy(pods ...*v1.Pod)
func (*Environment) EventuallyExpectHealthyPodCount ¶
func (env *Environment) EventuallyExpectHealthyPodCount(selector labels.Selector, numPods int)
func (*Environment) EventuallyExpectKarpenterWithEnvVar ¶
func (env *Environment) EventuallyExpectKarpenterWithEnvVar(envVar v1.EnvVar)
func (*Environment) EventuallyExpectMinUtilization ¶ added in v0.15.0
func (env *Environment) EventuallyExpectMinUtilization(resource v1.ResourceName, comparator string, value float64)
func (*Environment) EventuallyExpectNotFound ¶ added in v0.16.0
func (env *Environment) EventuallyExpectNotFound(objects ...client.Object)
func (*Environment) ExpectCreated ¶
func (env *Environment) ExpectCreated(objects ...client.Object)
func (*Environment) ExpectCreatedNodeCount ¶
func (env *Environment) ExpectCreatedNodeCount(comparator string, nodeCount int)
func (*Environment) ExpectDeleted ¶
func (env *Environment) ExpectDeleted(objects ...client.Object)
func (*Environment) ExpectInstance ¶ added in v0.15.0
func (env *Environment) ExpectInstance(nodeName string) Assertion
func (*Environment) ExpectUniqueNodeNames ¶ added in v0.16.2
func (env *Environment) ExpectUniqueNodeNames(selector labels.Selector, uniqueNames int)
func (*Environment) ExpectUpdate ¶ added in v0.15.0
func (env *Environment) ExpectUpdate(objects ...client.Object)
func (*Environment) GetInstance ¶ added in v0.15.0
func (env *Environment) GetInstance(nodeName string) ec2.Instance
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor is used to monitor the cluster state during a running test
func (*Monitor) AvgUtilization ¶ added in v0.15.0
func (m *Monitor) AvgUtilization(resource v1.ResourceName) float64
func (*Monitor) CreatedNodes ¶
CreatedNodes returns the number of nodes created since the last reset
func (*Monitor) GetCreatedNodes ¶ added in v0.16.0
func (*Monitor) MinUtilization ¶ added in v0.15.0
func (m *Monitor) MinUtilization(resource v1.ResourceName) float64
func (*Monitor) NodeCountAtReset ¶
NodeCountAtReset returns the number of nodes that were running when the monitor was last reset, typically at the beginning of a test
func (*Monitor) Reset ¶
func (m *Monitor) Reset()
Reset resets the cluster monitor prior to running a test.
func (*Monitor) RestartCount ¶
RestartCount returns the containers and number of restarts for that container for all containers in the pods in the given namespace
func (*Monitor) RunningPods ¶
RunningPods returns the number of running pods matching the given selector
func (*Monitor) RunningPodsCount ¶ added in v0.16.2
func (*Monitor) TotalNodesSeen ¶
TotalNodesSeen returns the total number of unique nodes ever seen since the last reset.
Click to show internal directories.
Click to hide internal directories.