Documentation
¶
Index ¶
- Variables
- func ConfigureAndCreateVMSS(ctx context.Context, s *Scenario) *armcompute.VirtualMachineScaleSet
- func CreateImage(ctx context.Context, s *Scenario) *config.Image
- func CreateSIGImageVersionFromDisk(ctx context.Context, s *Scenario, version string, diskResourceID string) *config.Image
- func CreateVMSS(ctx context.Context, s *Scenario, resourceGroupName string, vmssName string, ...) (*armcompute.VirtualMachineScaleSet, error)
- func CreateVMSSWithRetry(ctx context.Context, s *Scenario, parameters armcompute.VirtualMachineScaleSet) (*armcompute.VirtualMachineScaleSet, error)
- func CustomDataWithHack(s *Scenario, binaryURL string) (string, error)
- func EnableGPUNPDToggle(ctx context.Context, s *Scenario)
- func GetFieldFromJsonObjectOnNode(ctx context.Context, s *Scenario, fileName string, jsonPath string) string
- func RunCommand(ctx context.Context, s *Scenario, command string) (armcompute.RunCommandResult, error)
- func RunScenario(t *testing.T, s *Scenario)
- func ServiceCanRestartValidator(ctx context.Context, s *Scenario, serviceName string, ...)
- func ValidateCiliumIsNotRunningWindows(ctx context.Context, s *Scenario)
- func ValidateCiliumIsRunningWindows(ctx context.Context, s *Scenario)
- func ValidateCommonLinux(ctx context.Context, s *Scenario)
- func ValidateContainerRuntimePlugins(ctx context.Context, s *Scenario)
- func ValidateContainerd2Properties(ctx context.Context, s *Scenario, versions []string)
- func ValidateDirectoryContent(ctx context.Context, s *Scenario, path string, files []string)
- func ValidateDllIsNotLoadedWindows(ctx context.Context, s *Scenario, dllName string)
- func ValidateDllLoadedWindows(ctx context.Context, s *Scenario, dllName string)
- func ValidateEnableNvidiaResource(ctx context.Context, s *Scenario)
- func ValidateFileDoesNotExist(ctx context.Context, s *Scenario, fileName string)
- func ValidateFileExcludesContent(ctx context.Context, s *Scenario, fileName string, contents string)
- func ValidateFileExists(ctx context.Context, s *Scenario, fileName string)
- func ValidateFileHasContent(ctx context.Context, s *Scenario, fileName string, contents string)
- func ValidateFileIsRegularFile(ctx context.Context, s *Scenario, fileName string)
- func ValidateGPUWorkloadSchedulable(ctx context.Context, s *Scenario)
- func ValidateIMDSRestrictionRule(ctx context.Context, s *Scenario, table string)
- func ValidateInstalledPackageVersion(ctx context.Context, s *Scenario, component, version string)
- func ValidateJournalctlOutput(ctx context.Context, s *Scenario, serviceName string, expectedContent string)
- func ValidateJsonFileDoesNotHaveField(ctx context.Context, s *Scenario, fileName string, jsonPath string, ...)
- func ValidateJsonFileHasField(ctx context.Context, s *Scenario, fileName string, jsonPath string, ...)
- func ValidateKubeletHasFlags(ctx context.Context, s *Scenario, filePath string)
- func ValidateKubeletHasNotStopped(ctx context.Context, s *Scenario)
- func ValidateKubeletNodeIP(ctx context.Context, s *Scenario)
- func ValidateLeakedSecrets(ctx context.Context, s *Scenario)
- func ValidateLocalDNSResolution(ctx context.Context, s *Scenario, server string)
- func ValidateLocalDNSService(ctx context.Context, s *Scenario, state string)
- func ValidateMultipleKubeProxyVersionsExist(ctx context.Context, s *Scenario)
- func ValidateNPDFilesystemCorruption(ctx context.Context, s *Scenario)
- func ValidateNPDGPUCountAfterFailure(ctx context.Context, s *Scenario)
- func ValidateNPDGPUCountCondition(ctx context.Context, s *Scenario)
- func ValidateNPDGPUCountPlugin(ctx context.Context, s *Scenario)
- func ValidateNPDIBLinkFlappingAfterFailure(ctx context.Context, s *Scenario)
- func ValidateNPDIBLinkFlappingCondition(ctx context.Context, s *Scenario)
- func ValidateNodeAdvertisesGPUResources(ctx context.Context, s *Scenario)
- func ValidateNodeCanRunAPod(ctx context.Context, s *Scenario)
- func ValidateNodeProblemDetector(ctx context.Context, s *Scenario)
- func ValidateNonEmptyDirectory(ctx context.Context, s *Scenario, dirName string)
- func ValidateNvidiaDCGMExporterIsScrapable(ctx context.Context, s *Scenario)
- func ValidateNvidiaDCGMExporterScrapeCommonMetric(ctx context.Context, s *Scenario)
- func ValidateNvidiaDCGMExporterSystemDServiceRunning(ctx context.Context, s *Scenario)
- func ValidateNvidiaDevicePluginServiceRunning(ctx context.Context, s *Scenario)
- func ValidateNvidiaGRIDLicenseValid(ctx context.Context, s *Scenario)
- func ValidateNvidiaModProbeInstalled(ctx context.Context, s *Scenario)
- func ValidateNvidiaPersistencedRunning(ctx context.Context, s *Scenario)
- func ValidateNvidiaSMIInstalled(ctx context.Context, s *Scenario)
- func ValidateNvidiaSMINotInstalled(ctx context.Context, s *Scenario)
- func ValidatePodRunning(ctx context.Context, s *Scenario, pod *corev1.Pod)
- func ValidatePubkeySSHDisabled(ctx context.Context, s *Scenario)
- func ValidateRunc12Properties(ctx context.Context, s *Scenario, versions []string)
- func ValidateSSHServiceDisabled(ctx context.Context, s *Scenario)
- func ValidateSSHServiceEnabled(ctx context.Context, s *Scenario)
- func ValidateServicesDoNotRestartKubelet(ctx context.Context, s *Scenario)
- func ValidateSysctlConfig(ctx context.Context, s *Scenario, customSysctls map[string]string)
- func ValidateSystemdUnitIsNotFailed(ctx context.Context, s *Scenario, serviceName string)
- func ValidateSystemdUnitIsNotRunning(ctx context.Context, s *Scenario, serviceName string)
- func ValidateSystemdUnitIsRunning(ctx context.Context, s *Scenario, serviceName string)
- func ValidateSystemdWatchdogForKubernetes132Plus(ctx context.Context, s *Scenario)
- func ValidateTaints(ctx context.Context, s *Scenario, expectedTaints string)
- func ValidateUlimitSettings(ctx context.Context, s *Scenario, ulimits map[string]string)
- func ValidateWindowsCiliumIsNotRunning(ctx context.Context, s *Scenario)
- func ValidateWindowsCiliumIsRunning(ctx context.Context, s *Scenario)
- func ValidateWindowsDisplayVersion(ctx context.Context, s *Scenario, displayVersion string)
- func ValidateWindowsProcessHasCliArguments(ctx context.Context, s *Scenario, processName string, arguments []string)
- func ValidateWindowsProductName(ctx context.Context, s *Scenario, productName string)
- func ValidateWindowsServiceIsNotRunning(ctx context.Context, s *Scenario, serviceName string)
- func ValidateWindowsServiceIsRunning(ctx context.Context, s *Scenario, serviceName string)
- func ValidateWindowsVersionFromWindowsSettings(ctx context.Context, s *Scenario, windowsVersion string)
- type Cluster
- type ClusterParams
- type ClusterRequest
- type Config
- type CreateGalleryImageRequest
- type CreateGalleryRequest
- type GetVHDRequest
- type Kubeclient
- func (k *Kubeclient) CreateDaemonset(ctx context.Context, ds *appsv1.DaemonSet) error
- func (k *Kubeclient) EnsureDebugDaemonsets(ctx context.Context, isAirgap bool, privateACRName string) error
- func (k *Kubeclient) GetHostNetworkDebugPod(ctx context.Context) (*corev1.Pod, error)
- func (k *Kubeclient) GetPodNetworkDebugPodForNode(ctx context.Context, kubeNodeName string) (*corev1.Pod, error)
- func (k *Kubeclient) WaitUntilNodeReady(ctx context.Context, t testing.TB, vmssName string) string
- func (k *Kubeclient) WaitUntilPodRunning(ctx context.Context, namespace string, labelSelector string, ...) (*corev1.Pod, error)
- type Scenario
- type ScenarioRuntime
- type Tags
- type VNet
Constants ¶
This section is empty.
Variables ¶
var CachedCompileAndUploadAKSNodeController = cachedFunc(compileAndUploadAKSNodeController)
var CachedCreateGallery = cachedFunc(createGallery)
var CachedCreateGalleryImage = cachedFunc(createGalleryImage)
var CachedCreateVMManagedIdentity = cachedFunc(config.Azure.CreateVMManagedIdentity)
var CachedEnsureResourceGroup = cachedFunc(ensureResourceGroup)
var CachedPrepareVHD = cachedFunc(prepareVHD)
var ClusterAzureNetwork = cachedFunc(clusterAzureNetwork)
var ClusterAzureOverlayNetwork = cachedFunc(clusterAzureOverlayNetwork)
var ClusterAzureOverlayNetworkDualStack = cachedFunc(clusterAzureOverlayNetworkDualStack)
var ClusterCiliumNetwork = cachedFunc(clusterCiliumNetwork)
var ClusterKubenet = cachedFunc(clusterKubenet)
var ClusterKubenetAirgap = cachedFunc(clusterKubenetAirgap)
var ClusterKubenetAirgapNonAnon = cachedFunc(clusterKubenetAirgapNonAnon)
var ClusterLatestKubernetesVersion = cachedFunc(clusterLatestKubernetesVersion)
var (
SSHKeyPrivate, SSHKeyPublic = mustGetNewRSAKeyPair()
)
Functions ¶
func ConfigureAndCreateVMSS ¶
func CreateSIGImageVersionFromDisk ¶
func CreateSIGImageVersionFromDisk(ctx context.Context, s *Scenario, version string, diskResourceID string) *config.Image
CreateSIGImageVersionFromDisk creates a new SIG image version directly from a VM disk
func CreateVMSS ¶
func CreateVMSSWithRetry ¶
func CustomDataWithHack ¶
CustomDataWithHack is similar to nodeconfigutils.CustomData, but it uses a hack to run new aks-node-controller binary Original aks-node-controller isn't run because it fails systemd check validating aks-node-controller-config.json exists check aks-node-controller.service for details a new binary is downloaded from the given URL and run with provision command
func EnableGPUNPDToggle ¶
func RunCommand ¶
func RunCommand(ctx context.Context, s *Scenario, command string) (armcompute.RunCommandResult, error)
RunCommand executes a command on the VMSS VM with instance ID "0" and returns the raw JSON response from Azure Unlike default approach, it doesn't use SSH and uses Azure tooling This approach is generally slower, but it works even if SSH is not available
func RunScenario ¶
func ValidateCommonLinux ¶
func ValidateFileExists ¶
func ValidateFileHasContent ¶
func ValidateJournalctlOutput ¶
func ValidateJournalctlOutput(ctx context.Context, s *Scenario, serviceName string, expectedContent string)
ValidateJournalctlOutput checks if specific content exists in the systemd service logs
func ValidateKubeletHasFlags ¶
ValidateKubeletHasFlags checks kubelet is started with the right flags and configs.
func ValidateKubeletNodeIP ¶
func ValidateLeakedSecrets ¶
func ValidateLocalDNSResolution ¶
ValidateLocalDNSResolution checks if the DNS resolution for an external domain is successful from localdns clusterlistenerIP. It uses the 'dig' command to check the DNS resolution and expects a successful response.
func ValidateLocalDNSService ¶
ValidateLocalDNSService checks if the localdns service is in the expected state (enabled or disabled).
func ValidateNodeCanRunAPod ¶
func ValidatePodRunning ¶
func ValidatePubkeySSHDisabled ¶
ValidatePubkeySSHDisabled validates that SSH with private key authentication is disabled by checking sshd_config
func ValidateSSHServiceDisabled ¶
ValidateSSHServiceDisabled validates that the SSH daemon service is disabled and stopped on the node
func ValidateSysctlConfig ¶
func ValidateTaints ¶
ValidateTaints checks if the node has the expected taints that are set in the kubelet config with --register-with-taints flag
func ValidateUlimitSettings ¶
Types ¶
type Cluster ¶
type Cluster struct { Model *armcontainerservice.ManagedCluster Kube *Kubeclient SubnetID string ClusterParams *ClusterParams Maintenance *armcontainerservice.MaintenanceConfiguration DebugPod *corev1.Pod }
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 ClusterRequest ¶
ClusterRequest represents the parameters needed to create a cluster
type Config ¶
type Config struct { // Cluster creates, updates or re-uses an AKS cluster for the scenario Cluster func(ctx context.Context, request ClusterRequest) (*Cluster, error) // VHD is the node image used by the scenario. 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) // Validator is a function where the scenario can perform any extra validation checks Validator func(ctx context.Context, s *Scenario) // SkipDefaultValidation is a flag to indicate whether the common validation (like spawning a pod) should be skipped. // It shouldn't be used for majority of scenarios, currently only used for preparing VHD in a two-stage scenario SkipDefaultValidation bool // SkipSSHConnectivityValidation is a flag to indicate whether the ssh connectivity validation should be skipped. // It shouldn't be used for majority of scenarios, currently only used for scenarios where the node is not expected to be reachable via ssh SkipSSHConnectivityValidation bool // if VHDCaching is set then a VHD will be created first for the test scenario and then a VM will be created from that VHD. // The main purpose is to validate VHD Caching logic and ensure a reboot step between basePrep and nodePrep doesn't break anything. VHDCaching bool }
Config represents the configuration of an AgentBaker E2E scenario.
type CreateGalleryRequest ¶
type GetVHDRequest ¶
type Kubeclient ¶
type Kubeclient struct { Dynamic client.Client Typed kubernetes.Interface RESTConfig *rest.Config KubeConfig []byte }
func (*Kubeclient) CreateDaemonset ¶
func (*Kubeclient) EnsureDebugDaemonsets ¶
func (k *Kubeclient) EnsureDebugDaemonsets(ctx context.Context, isAirgap bool, privateACRName string) error
this is a bit ugly, but we don't want to execute this piece concurrently with other tests
func (*Kubeclient) GetHostNetworkDebugPod ¶
GetHostNetworkDebugPod returns a pod that's a member of the 'debug' daemonset, running on an aks-nodepool node.
func (*Kubeclient) GetPodNetworkDebugPodForNode ¶
func (k *Kubeclient) GetPodNetworkDebugPodForNode(ctx context.Context, kubeNodeName string) (*corev1.Pod, error)
GetPodNetworkDebugPodForNode returns a pod that's a member of the 'debugnonhost' daemonset running in the cluster - this will return the name of the pod that is running on the node created for specifically for the test case which is running validation checks.
func (*Kubeclient) WaitUntilNodeReady ¶
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 // Location is the Azure location where the scenario will run. This can be // used to override the default location. Location string // K8sSystemPoolSKU is the VM size to use for the system nodepool. If empty, // a default size will be used. K8sSystemPoolSKU string // Runtime contains the runtime state of the scenario. It's populated in the beginning of the test run Runtime *ScenarioRuntime T testing.TB }
Scenario represents an AgentBaker E2E scenario.
func (*Scenario) PrepareAKSNodeConfig ¶
func (s *Scenario) PrepareAKSNodeConfig()
func (*Scenario) PrepareVMSSModel ¶
func (s *Scenario) PrepareVMSSModel(ctx context.Context, t testing.TB, 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 VMSSName string KubeNodeName string VMPrivateIP string }
type Tags ¶
type Tags struct { Name string ImageName string OS string Arch string Airgap bool NonAnonymousACR bool GPU bool WASM bool ServerTLSBootstrapping bool KubeletCustomConfig bool Scriptless bool VHDCaching 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.