Documentation ¶
Index ¶
- type Cluster
- type ClusterParams
- type Config
- type Kubeclient
- type LiveVMValidator
- func CommandHasOutputValidator(commandToExecute string, expectedOutput string) *LiveVMValidator
- func DirectoryValidator(path string, files []string) *LiveVMValidator
- func FileExcludesContentsValidator(fileName string, contents string, contentsName string) *LiveVMValidator
- func FileHasContentsValidator(fileName string, contents string) *LiveVMValidator
- func KubeletHasConfigFlagsValidator(filePath string) *LiveVMValidator
- func KubeletHasNotStoppedValidator() *LiveVMValidator
- func NonEmptyDirectoryValidator(dirName string) *LiveVMValidator
- func NvidiaModProbeInstalledValidator() *LiveVMValidator
- func NvidiaSMIInstalledValidator() *LiveVMValidator
- func NvidiaSMINotInstalledValidator() *LiveVMValidator
- func ServiceCanRestartValidator(serviceName string, restartTimeoutInSeconds int) *LiveVMValidator
- func SysctlConfigValidator(customSysctls map[string]string) *LiveVMValidator
- func UlimitValidator(ulimits map[string]string) *LiveVMValidator
- type Scenario
- func (s *Scenario) PrepareAKSNodeConfig()
- func (s *Scenario) PrepareNodeBootstrappingConfiguration(nbc *datamodel.NodeBootstrappingConfiguration) (*datamodel.NodeBootstrappingConfiguration, error)
- func (s *Scenario) PrepareRuntime(ctx context.Context, t *testing.T)
- func (s *Scenario) PrepareVMSSModel(ctx context.Context, t *testing.T, vmss *armcompute.VirtualMachineScaleSet)
- type ScenarioRuntime
- type Tags
- type VMCommandOutputAsserterFn
- type VNet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Model *armcontainerservice.ManagedCluster Kube *Kubeclient SubnetID string NodeBootstrappingConfiguration *datamodel.NodeBootstrappingConfiguration AKSNodeConfig *aksnodeconfigv1.Configuration Maintenance *armcontainerservice.MaintenanceConfiguration }
func ClusterAzureNetwork ¶
func ClusterKubenet ¶
Same cluster can be attempted to be created concurrently by different tests sync.Once is used to ensure that only one cluster for the set of tests is created
func ClusterKubenetAirgap ¶
func (*Cluster) IsAzureCNI ¶
Returns true if the cluster is configured with Azure CNI
func (*Cluster) MaxPodsPerNode ¶
Returns the maximum number of pods per node of the cluster's agentpool
type ClusterParams ¶
type Config ¶
type Config struct { // Cluster creates, updates or re-uses an AKS cluster for the scenario Cluster func(ctx context.Context, t *testing.T) (*Cluster, error) // VHD is the function called by the e2e suite on the given scenario to get its VHD selection VHD *config.Image // BootstrapConfigMutator is a function which mutates the base NodeBootstrappingConfig according to the scenario's requirements BootstrapConfigMutator func(*datamodel.NodeBootstrappingConfiguration) // AKSNodeConfigMutator if defined then aks-node-controller will be used to provision nodes AKSNodeConfigMutator func(*aksnodeconfigv1.Configuration) // VMConfigMutator is a function which mutates the base VMSS model according to the scenario's requirements VMConfigMutator func(*armcompute.VirtualMachineScaleSet) // LiveVMValidators is a slice of LiveVMValidator objects for performing any live VM validation // specific to the scenario that isn't covered in the set of common validators run with all scenarios LiveVMValidators []*LiveVMValidator }
Config represents the configuration of an AgentBaker E2E scenario.
type Kubeclient ¶
type LiveVMValidator ¶
type LiveVMValidator struct { // Description is the description of the validator and what it actually validates on the VM Description string // Command is the command string to be run on the live VM after node bootstrapping has succeeed Command string // Asserter is the validator's VMCommandOutputAsserterFn which will be run against command output Asserter VMCommandOutputAsserterFn // IsShellBuiltIn is a boolean flag which indicates whether or not the command is a shell built-in // that will fail when executed with sudo - requires separate command to avoid command not found error on node IsShellBuiltIn bool // TODO - extract this out of LiveVMValidator into a separate Pod level validator // IsPodNetwork is a boolean flags which indicates whether or not the validator should run on a pod that is NOT using // host's network interface. For example when testing connectivity from user pods to certain endpoints, we will set it to true IsPodNetwork bool }
LiveVMValidator represents a command to be run on a live VM after node bootstrapping has succeeded that generates output which can be asserted against to make sure that the live VM itself is in the correct state
func CommandHasOutputValidator ¶
func CommandHasOutputValidator(commandToExecute string, expectedOutput string) *LiveVMValidator
func DirectoryValidator ¶
func DirectoryValidator(path string, files []string) *LiveVMValidator
func FileExcludesContentsValidator ¶
func FileExcludesContentsValidator(fileName string, contents string, contentsName string) *LiveVMValidator
func FileHasContentsValidator ¶
func FileHasContentsValidator(fileName string, contents string) *LiveVMValidator
func KubeletHasConfigFlagsValidator ¶
func KubeletHasConfigFlagsValidator(filePath string) *LiveVMValidator
KubeletHasConfigFlagsValidator checks kubelet is started with the right flags and configs.
func KubeletHasNotStoppedValidator ¶
func KubeletHasNotStoppedValidator() *LiveVMValidator
Ensure kubelet does not restart which can result in delays deploying pods and unnecessary nodepool scaling while the node is incapacitated. This is intended to stop services (e.g. nvidia-modprobe), restarting kubelet rather than specifying the dependency order to run before kubelet.service
func NonEmptyDirectoryValidator ¶
func NonEmptyDirectoryValidator(dirName string) *LiveVMValidator
func NvidiaModProbeInstalledValidator ¶
func NvidiaModProbeInstalledValidator() *LiveVMValidator
func NvidiaSMIInstalledValidator ¶
func NvidiaSMIInstalledValidator() *LiveVMValidator
func NvidiaSMINotInstalledValidator ¶
func NvidiaSMINotInstalledValidator() *LiveVMValidator
func ServiceCanRestartValidator ¶
func ServiceCanRestartValidator(serviceName string, restartTimeoutInSeconds int) *LiveVMValidator
func SysctlConfigValidator ¶
func SysctlConfigValidator(customSysctls map[string]string) *LiveVMValidator
func UlimitValidator ¶
func UlimitValidator(ulimits map[string]string) *LiveVMValidator
type Scenario ¶
type Scenario struct { // Description is a short description of what the scenario does and tests for Description string // Tags are used for filtering scenarios to run based on the tags provided Tags Tags // Config contains the configuration of the scenario Config // Runtime contains the runtime state of the scenario. It's populated in the beginning of the test run Runtime *ScenarioRuntime }
Scenario represents an AgentBaker E2E scenario.
func (*Scenario) PrepareAKSNodeConfig ¶
func (s *Scenario) PrepareAKSNodeConfig()
func (*Scenario) PrepareNodeBootstrappingConfiguration ¶
func (s *Scenario) PrepareNodeBootstrappingConfiguration(nbc *datamodel.NodeBootstrappingConfiguration) (*datamodel.NodeBootstrappingConfiguration, error)
scenario's BootstrapConfigMutator on it, if configured.
func (*Scenario) PrepareRuntime ¶
func (*Scenario) PrepareVMSSModel ¶
func (s *Scenario) PrepareVMSSModel(ctx context.Context, t *testing.T, vmss *armcompute.VirtualMachineScaleSet)
PrepareVMSSModel mutates the input VirtualMachineScaleSet based on the scenario's VMConfigMutator, if configured. This method will also use the scenario's configured VHD selector to modify the input VMSS to reference the correct VHD resource.
type ScenarioRuntime ¶
type ScenarioRuntime struct { NBC *datamodel.NodeBootstrappingConfiguration AKSNodeConfig *aksnodeconfigv1.Configuration Cluster *Cluster }
type Tags ¶
type Tags struct { Name string ImageName string OS string Arch string Airgap bool GPU bool WASM bool ServerTLSBootstrapping bool Scriptless bool KubeletCustomConfig bool }
func (Tags) MatchesAnyFilter ¶
MatchesAnyFilter checks if the Tags struct matches at least one of the given filters. Filters are comma-separated "key=value" pairs (e.g., "gpu=true,os=x64"). Returns true if any filter matches, false if none match. Errors on invalid input.
func (Tags) MatchesFilters ¶
MatchesFilters checks if the Tags struct matches all given filters. Filters are comma-separated "key=value" pairs (e.g., "gpu=true,os=x64"). Returns true if all filters match, false otherwise. Errors on invalid input.
type VMCommandOutputAsserterFn ¶
VMCommandOutputAsserterFn is a function which takes in stdout and stderr stream content as strings and performs arbitrary assertions on them, returning an error in the case where the assertion fails