Skip to content

feat: download kubelet with oras in network isolated windows cluster#8042

Open
jiashun0011 wants to merge 1 commit intomainfrom
jiashunliu/ni-oras-cache-1
Open

feat: download kubelet with oras in network isolated windows cluster#8042
jiashun0011 wants to merge 1 commit intomainfrom
jiashunliu/ni-oras-cache-1

Conversation

@jiashun0011
Copy link
Contributor

What this PR does / why we need it:

/kind feature

Which issue(s) this PR fixes:

Download kubelet with oras in network isolated windows cluster.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for downloading Windows kubelet binaries via ORAS when running in a network-isolated cluster context (using the bootstrap profile container registry), and extends test coverage to exercise the new path.

Changes:

  • Update Get-KubePackage to download kubelet binaries via ORAS when BootstrapProfileContainerRegistryServer is set; otherwise keep HTTP download behavior.
  • Add/extend Pester tests for ORAS vs HTTP selection behavior in Get-KubePackage.
  • Add a new Windows network-isolated e2e scenario intended to validate ORAS-based kubelet download behavior.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 6 comments.

File Description
staging/cse/windows/kubeletfunc.ps1 Adds ORAS-based kubelet package download branch when bootstrap profile registry is configured.
staging/cse/windows/kubeletfunc.tests.ps1 Adds Pester contexts to cover ORAS vs HTTP download paths for kubelet package retrieval.
e2e/scenario_win_test.go Adds a network-isolated Windows e2e test and alters Windows 2025 bootstrap mutator to use a custom CSE package URL.

You can also share your feedback on Copilot code review. Take the survey.

@fseldow
Copy link
Contributor

fseldow commented Mar 9, 2026

staging-cse-windows.zip

forget to delete?

@jiashun0011 jiashun0011 force-pushed the jiashunliu/ni-oras-cache-1 branch from 76afb46 to 4450dfb Compare March 12, 2026 00:25
@jiashun0011 jiashun0011 force-pushed the jiashunliu/ni-oras-cache-1 branch from 4450dfb to bac8e29 Compare March 12, 2026 00:40
Copilot AI review requested due to automatic review settings March 12, 2026 00:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.


You can also share your feedback on Copilot code review. Take the survey.

Set-ExitCode -ExitCode $global:WINDOWS_CSE_ERROR_ORAS_PULL_WINDOWSZIP_FAIL -ErrorMessage "DownloadFileWithOras function is not available. networkisolatedclusterfunc.ps1 may not be sourced."
}
Logs-To-Event -TaskName "AKS.WindowsCSE.DownloadKubletBinariesWithOras" -TaskMessage "Start to download kubelet binaries with oras. KubeBinariesVersion: $global:KubeBinariesVersion, BootstrapProfileContainerRegistryServer: $global:BootstrapProfileContainerRegistryServer"
$orasReference = "$($global:BootstrapProfileContainerRegistryServer)/aks/packages/kubernetes/windowszip:v$($global:KubeBinariesVersion)"

This comment was marked as off-topic.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


You can also share your feedback on Copilot code review. Take the survey.

nbc.ContainerService.Properties.SecurityProfile = &datamodel.SecurityProfile{
PrivateEgress: &datamodel.PrivateEgress{
Enabled: true,
ContainerRegistryServer: fmt.Sprintf("%s.azurecr.io/aks-managed-repository", config.PrivateACRName(config.Config.DefaultLocation)),

This comment was marked as off-topic.

Comment on lines +88 to +94
It "Should call DownloadFileWithOras with correct reference when BootstrapProfileContainerRegistryServer is set" {
Get-KubePackage -KubeBinariesSASURL 'https://xxx.blob.core.windows.net/kubernetes/v1.29.2/windowszip/v1.29.2-1int.zip'
Assert-MockCalled -CommandName 'DownloadFileWithOras' -Exactly -Times 1 -ParameterFilter {
$Reference -eq 'myregistry.azurecr.io/aks/packages/kubernetes/windowszip:v1.29.2' -and
$DestinationPath -eq 'c:\k.zip' -and
$ExitCode -eq $global:WINDOWS_CSE_ERROR_ORAS_PULL_WINDOWSZIP_FAIL
}

This comment was marked as off-topic.

@jiashun0011
Copy link
Contributor Author

staging-cse-windows.zip

forget to delete?

deleted

@jiashun0011 jiashun0011 force-pushed the jiashunliu/ni-oras-cache-1 branch from 87651bd to bf626ee Compare March 16, 2026 03:48
@jiashun0011 jiashun0011 force-pushed the jiashunliu/ni-oras-cache-1 branch from bf626ee to 663af34 Compare March 16, 2026 03:58
Copilot AI review requested due to automatic review settings March 16, 2026 03:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +172 to +176
{ DownloadFileWithOras -Reference $reference -DestinationPath $destPath -ExitCode 80 } | Should -Not -Throw

Assert-MockCalled -CommandName 'Write-Log' -ParameterFilter {
$message -like "*platform=windows/amd64*"
}
Comment on lines +127 to +133
It "should call oras with correct arguments on success" {
$reference = "myregistry.azurecr.io/aks/packages/kubernetes/windowszip:1.29.2"
$destPath = "c:\k.zip"

$global:OrasPath = "Write-Output"
{ DownloadFileWithOras -Reference $reference -DestinationPath $destPath -ExitCode 80 } | Should -Not -Throw
}
@azure-pipelines
Copy link

There was an error handling pipeline event fa0590be-b5f0-479e-812d-33890e8827ec.

Copilot AI review requested due to automatic review settings March 16, 2026 12:12
@jiashun0011 jiashun0011 force-pushed the jiashunliu/ni-oras-cache-1 branch from 411dd66 to af24e0a Compare March 16, 2026 12:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.


You can also share your feedback on Copilot code review. Take the survey.

}
},
Validator: func(ctx context.Context, s *Scenario) {
ValidateFileHasContent(ctx, s, "/k/kubeletstart.ps1", "--container-runtime=remote")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most of the default tests use images that are already cached on the VHD. I think it's worth explicitly checking a pod can start using a container that's not on the VHD - and is only in the aks managed repository you link to above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fseldow

Good point, I agree it’s useful to validate pulling an image that is not pre-cached on the VHD.

For this test though, we are trying to keep it fully isolated using our specified ACR to validate the network-isolated scenario. We still have some essential components that require additional PRs to support oras-based download, so we’re not fully relying on the AKS-managed repo path yet.

We can add a dedicated test case for non-VHD-cached images once those pieces are in place.

Copy link
Contributor

@timmy-wright timmy-wright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of comments - and as copilot says, the git conflict merge markers indicate that something went unresolved in the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants