Summary and Goals
scoop.sh is a new community maintained package manager for Windows and can be used to install an extended number of application directly from the command line.
You can get more information on this project by visiting the official GitHub page at https://github.com/ScoopInstaller/Scoop#readme.
The goal of this internal project is to automate deployment of the scoop.sh package manager on the AKS Windows Nodes and installing two test application frequently used by the Engineering teams:
Tested this script on a Bash environment with AKS Windows 2022 version. In the following example it is used directly on the underlay Node by spinning up a privileged container and can be adapted to run directly on a test Pod.
Get the following script on a Linux instance where you already have configured kubectl binary.
if [ "$#" -lt 2 ];
echo "Windows Nodes Package Manager"
echo "Usage: kubectl scoop nodeName"
cat << EOF > ./winscoop.yaml
- image: mcr.microsoft.com/windows/nanoserver:ltsc2022
- mountPath: /tmp
- Write-Output "---> Installing scoop...";
- irm get.scoop.sh -outfile 'install.ps1';
- .\install.ps1 -RunAsAdmin -ScoopDir 'C:\Scoop' -ScoopGlobalDir 'C:\Scoop' -NoProxy;
- Write-Output "---> Done";
- scoop install netcat;
- scoop install tcping;
- sleep 600;
- name: logs
runAsUserName: NT AUTHORITY\SYSTEM
echo "Running the Pod"
kubectl apply -f ./winscoop.yaml
kubectl get pod windows-scoop-17263 | grep Completed > /dev/null
if [ $? != 0 ]
echo "Still working..."
kubectl delete pod windows-scoop-17263
Make this file executable with:
chmod +x ./kubectl-scoop
Select de Node where you want to install the packed manager. It could also be adapted to work on an entire Node Pool by changing the selector type on the manifest file.
After finishing the installation, you can use the same Pod to connect on the respective node. You can do it by:
kubectl exec -it windows-scoop-17263 -- powershell
With scoop install you can deploy any available application from the Repository: https://scoop.sh/#/apps. By default, the installation of the application is installed in C:\Scoop folder, you can change this by altering the manifest file. On the command list executed on the Node there is a sleep defaulted to 600 Sec, please modify the according to your case.