AgentBaker/staging/cse/windows
Chou Hu 7dc17adcd4
feat: bump AKS Windows CSE script package to v0.0.50 (#5152)
2024-10-24 10:10:00 +00:00
..
azurecnifunc.tests.suites feat: block 32526 to wireserver on Windows nodes (#4758) 2024-08-09 16:04:27 +08:00
credentialProvider.tests.suites feat: update window cse to install credental provider (#4281) 2024-04-16 13:48:25 +08:00
debug chore: refine collect-windows-logs.ps1 to enable crt by default (#4863) 2024-08-26 14:29:17 +08:00
kubeletfunc.tests.suites feat: respect nodepool tags for disabling kubelet serving certificate rotation (#4911) 2024-09-12 13:00:01 -07:00
provisioningscripts chore: add windowsnodereset.log in loggenerator.ps1 (#4869) 2024-08-27 15:33:15 +08:00
README feat: bump AKS Windows CSE script package to v0.0.50 (#5152) 2024-10-24 10:10:00 +00:00
azurecnifunc.ps1 feat: block 32526 to wireserver on Windows nodes (#4758) 2024-08-09 16:04:27 +08:00
azurecnifunc.tests.ps1 chore: update regkey for disabling OutboundNAT on WS2022 nodes (#3655) 2023-10-09 11:27:10 +08:00
calicofunc.ps1 feat: block 32526 to wireserver on Windows nodes (#4758) 2024-08-09 16:04:27 +08:00
configfunc.ps1 Revert "fix: exclude udp ports on Windows (#4886)" (#4919) 2024-09-10 12:15:44 +08:00
configfunc.tests.ps1 Revert "fix: exclude udp ports on Windows (#4886)" (#4919) 2024-09-10 12:15:44 +08:00
containerdfunc.ps1 feat: refine the code to get the Windows containerd version (#4226) 2024-04-01 02:17:45 +00:00
containerdtemplate.toml feat: support Windows container local dumps (#3684) 2024-02-23 16:22:20 +08:00
kubeletfunc.ps1 fix: do not use return in updating kubelet node labels (#5151) 2024-10-24 07:50:47 +00:00
kubeletfunc.tests.ps1 fix: do not use return in updating kubelet node labels (#5151) 2024-10-24 07:50:47 +00:00
kubernetesfunc.ps1 feat: add log events in Windows CSE (#4657) 2024-07-17 16:14:02 +08:00
nvidiagpudriverfunc.ps1 chore: support cse log for windows (#3944) 2024-02-20 20:29:57 +08:00
nvidiagpudriverfunc.tests.ps1 feat: update cse script package changes for aks windows gpu feature (#3794) 2023-11-20 01:12:43 -08:00

README

# Unit Tests
1. Execute unit tests on pipeline. The yaml file of unit test pipeline is .github/workflows/validate-windows-ut.yml.
1. Execute unit tests locally:
  1. Please install [pester](https://github.com/pester/Pester) with the command `Install-Module -Name pester -SkipPublisherCheck -Force`.
    - Doc: https://pester.dev/docs/quick-start
    - Courses: https://docs.microsoft.com/en-us/shows/testing-powershell-with-pester/
  1. You need to run unit tests on Windows. NOTE: WSL does not work.
  1. Run unit test:
    - `Invoke-Pester parts/windows/*.tests.ps1 -Passthru`
    - `Invoke-Pester staging/cse/windows/*.tests.ps1 -Passthru`

# Test with AKS RP
1. Run below commands to build a test package
```bash
branchName="master"
currentCseVersion="v0.0.50" # `WindowsCSEScriptsPackage` defined in `parts/windows/kuberneteswindowssetup.ps1`
testCseVersion="v0.0.50.0" # Test package name. NOTE: Please do not use the official package format and earlier used version.
url="https://raw.githubusercontent.com/Azure/AgentBaker/$branchName/staging/cse/windows"

mkdir -p temp-work-folder/aks-windows-cse
cd temp-work-folder
curl -O "https://acs-mirror.azureedge.net/aks/windows/cse/aks-windows-cse-scripts-$currentCseVersion.zip"
pushd aks-windows-cse
    unzip ../aks-windows-cse-scripts-*.zip
    rm ../*.zip

	files=("azurecnifunc.ps1" "calicofunc.ps1" "configfunc.ps1" "containerdfunc.ps1" "containerdtemplate.toml" "kubeletfunc.ps1" "kubernetesfunc.ps1" "nvidiagpudriverfunc.ps1")
	for file in ${files[@]}; do
	    echo "Downloading $file from $url/$file"
	   curl -O "$url/$file"
	done

	pushd debug
		files=("VFP.psm1" "captureNetworkFlows.ps1" "collect-windows-logs.ps1" "collectlogs.ps1" "dumpVfpPolicies.ps1" "helper.psm1" "hns.psm1" "hns.v2.psm1" "networkhealth.ps1" "portReservationTest.ps1" "starthnstrace.cmd" "starthnstrace.ps1" "startpacketcapture.cmd" "startpacketcapture.ps1" "stoppacketcapture.cmd")
		for file in ${files[@]}; do
		    echo "Downloading $file from $url/debug/$file"
		   curl -O "$url/debug/$file"
		done
	popd
	
	pushd provisioningscripts
		files=("cleanupnetwork.ps1" "hnsremediator.ps1" "hostsconfigagent.ps1" "kubeletstart.ps1" "kubeproxystart.ps1" "loggenerator.ps1" "windowslogscleanup.ps1" "windowsnodereset.ps1" "windowssecuretls.ps1")
		for file in ${files[@]}; do
		    echo "Downloading $file from $url/provisioningscripts/$file"
		   curl -O "$url/provisioningscripts/$file"
		done
	popd

	zip -r "../aks-windows-cse-scripts-$testCseVersion.zip" *
popd
```
1. Upload the test package to your Azure storage container `$web`
  - You need to enable `Static website` in your storage account on Azure portal
  - You need to note down your `Primary endpoint` of `Static website` of your storage account
  - The test package download URL should be `[Primary endpoint]/aks-windows-cse-scripts-[$testCseVersion].zip`
1. Test it with AKS RP in the toggle `windows-cse-package-url.yaml`

# AKS Windows CSE Scripts Package
All files except *.test.ps1 and README will be published in AKS Windows CSE Scripts Package.

## v0.0.50
- fix: do not use return in updating kubelet node labels #5151

## v0.0.49
- refactor: configure kubelet serving certificate rotation label at runtime #5115

## v0.0.48
- chore: refine collect-windows-logs.ps1 to enable crt by default #4863
- chore: add windowsnodereset.log in loggenerator.ps1 #4869
- feat: respect nodepool tags for disabling kubelet serving certificate rotation #4911

## v0.0.46
- feat: add log events in Windows CSE #4657
- feat: block 32526 to wireserver on Windows nodes #4758

## v0.0.45
- Edit containerd snapshot size calculation #4345
- Add more containerd logs #4398
- feat: use PowerShell commands to set pagefile size instead of wmic #4594

## v0.0.44
- fix: do not collect vfp ports in loggenerator.ps1 #4542

## v0.0.43
- feat: support Windows private k8s packages #4496
- doc: update Windows CSE script package doc #4447
- feat: cse supports windows-exporter log #4389
- feat: refine collect-windows-logs.ps1 #4383

## v0.0.42
- feat: add parameters for collect-windows-logs.ps1 #4325
- feat: support skipping legacy code CleanupNetwork in AKS Windows CSE #4131
- chore: sync the latest Windows debug scripts #4279

## v0.0.41
- feat: update window cse to install credental provider #4281
- Add more containerd logs to collect-windows-logs.ps1 #3952
- feat: add system startup task to expand os volume #4213
- feat: refine the code to get the Windows containerd version #4226
- feat: collect Windows extensions logs #4169
- feat: collect Windows memroy dump in collect-windows-logs.ps1 #4168
- fix: avoid running Windows CSE multiple times. #4158

## v0.0.40
- feat: set --node-ip for Windows kubelet in k8s v1.29+ #4148

## v0.0.39
- feat: support Windows container local dumps #3684

## v0.0.38
- chore: support cse log for windows #3944

## v0.0.37
- chore: add the output of collect-windows-logs-output into the node log #3919
- fix: check the path of nvidiaInstallLogFolder #3920
- feat: collect kubectl information in AKS Windows node log #3936

## v0.0.36
- chore: support to test Windows 2025 #3871

## v0.0.35
- feat: update cse script package changes for aks windows gpu feature #3794
- feat: optimize resize-osdrive replacing get-partitionsupportedsize with diskpart #3804

## v0.0.34
- feat: adding changes to AgentBaker for Stateless CNI on Windows #3704
- chore: update the MaxRetryCount to 60 in Check-APIServerConnectivity of Windows CSE #3737

## v0.0.33
- update signature of binaries in windows cse script package

## v0.0.32
- chore: update regkey for disabling OutboundNAT on WS2022 nodes #3655

## v0.0.31
- fix: WS2022 support disabling OutboundNAT without updating regkey in CSE #3621
- chore: use Get-WindowsVersion for os version check #3630

## v0.0.30
- chore: added check on Windows CSE for vmss type so we don't throw an error #3520

## v0.0.29
- chore: remove unused function #3415
- chore: cleanup docker in Windows CSE scripts #3403
- feat: collect dump files #3437
- fix: fix the bug in collect-windows-logs.ps1 #3442
- fix: fix wrong log in Windows debug script #3446

## v0.0.27
- feat: clear existing images tags in non-AzureChinaCloud #3422
- feat: retag images for AzureChinaCloud in provisioning Windows nodes #3414
- feat: collect windowslogscleanup.log in GuestVMLogs #3355

## v0.0.26
- fix: exit Windows CSE when it fails in Resize-OSDrive #3212

## v0.0.25
- feat: remove Kubelet flag --container-runtime in k8s 1.27+ #3181

## v0.0.24
- fix: do not add IPv6DualStack to Windows kube-proxy feature-gates when K8s >= 1.25.0 #3024
- fix: add file check for windows log script #3029
- fix: Windows Azure CNI conflist should split ExceptionList by IP family #3049

## v0.0.23
- fix: Remove all download steps in Windows debug scripts #2738
- fix: Validate whether the PID of HNS service is valid #2781
- fix: Add hosts config agent logs in lockedFiles #2846
- chore: add more Container Platform logs to collect-windows-logs.ps1 and loggenerator.ps1 #2755
- feat: use cluster subnets for dual-stack #2867

## v0.0.22
- fix: Remove vfpOutput.txt before generating new logs #2566

## v0.0.21
- feat: Support Windows calico v3.23.3 in AKS Windows CSE scripts #2515
- fix: Enable WinDSR with the new Azure CNI config #2516
- fix: Start Windows calico services for v3.23.3 #2525

## v0.0.20
- feat: Cache log collect scripts in Windows CSE script package #2481

## v0.0.19
- feat: Add AKS logs in Windows GuestVMLogs #2426
- Don't add VnetCidrs to exceptionlist when network plugin mode is overlay #2428
- chore: Update RegKey HNSControlFlag when disable Windows OutboundNAT #2417

NOTE: v0.0.17 and v0.0.18 have some issues so we skip them.

## v0.0.16
- chore: move the installation of containerd from containerdfunc.ps1 to windowscsehelper.ps1 #2199

## v0.0.15
- feat: Use hns.v2.psm1 for Windows containerd in CSE package #2223
- fix: Restart Calico services in HNS remediato #2233
- feat: Copy new Windows debug scripts in node provisioning #2164

## v0.0.14
- feat: Windows CSE support disabling OutboundNAT and removing ROUTE if WinDSR is enabled #2144

## v0.0.13
- feat: Add hnsremediator for hns crash in Windows nodes #2085

## v0.0.12
- feat: Add specified code in Windows CSE #2033

## v0.0.11
- feat: Support mutilple Windows containerd versions in cse package #1945

## v0.0.10
- feat: Update the command to exclude UDP source port in Windows node #1924 **NOTE: DO NOT USE**

## v0.0.9
- fix: Exclude UDP source port 65330 in Windows nodes #1784 **NOTE: DO NOT USE**

## v0.0.8
- Use provisioning scripts in CSEScriptsPackage. #1623

## v0.0.7
- Exclude dockerd in Microsoft Defender #1600

## v0.0.6
- Refine Get-WindowsVersion to support Windows 2022 #1565

## v0.0.5

- fix: correct the file name for csi proxy #1540
- fix: Add kubeproxy and CNI binaries to defender exclusion list #1541
- Refine Get-LogCollectionScripts #1383

## v0.0.4

- fix: Set loopbackdsr in Azure CNI conflist for WinDSR (#1356)

## v0.0.3

- fix: Update Windows dynamic port range #1352

## v0.0.2

- Add accelerated networking support for Windows in CSE scripts #1325

## v0.0.1

- The first package