This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from OctopusDeployLabs/mh/win2022
Add windows 2022 support for k8s-workertools
- Loading branch information
Showing
3 changed files
with
152 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# escape=` | ||
|
||
FROM octopuslabs/workertools:latest-windows.2022 | ||
SHELL ["powershell", "-Command"] | ||
|
||
# gcloud cli needed for gke auth plugin | ||
ARG GCLOUD_CLI_VERSION=433.0.0 | ||
|
||
RUN choco install kubernetes-cli -y --no-progress | ||
|
||
RUN choco install -y kubernetes-helm --no-progress | ||
|
||
# Get Kubelogin | ||
RUN choco install azure-kubelogin --no-progress -y | ||
|
||
RUN choco install eksctl -y --no-progress | ||
|
||
RUN choco install awscli -y --no-progress | ||
|
||
# Get Argo | ||
RUN choco install argocd-cli -y --no-progress | ||
|
||
# Install Azure CLI | ||
RUN choco install azure-cli -y --no-progress | ||
|
||
RUN Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force; ` | ||
Install-Module -Force -Name Az -AllowClobber -Scope AllUsers | ||
|
||
# Install gcloud (required for gke-auth-plugin) | ||
RUN $GCLOUD_VERSION = $env:GCLOUD_CLI_VERSION; ` | ||
Write-Host "GCLOUD_VERSION: ${env:GCLOUD_CLI_VERSION}"; ` | ||
Write-Host "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${env:GCLOUD_CLI_VERSION}-windows-x86_64.zip"; ` | ||
Invoke-WebRequest "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${env:GCLOUD_CLI_VERSION}-windows-x86_64.zip" -OutFile google-cloud-sdk-$env:GCLOUD_CLI_VERSION-windows-x86_64.zip; ` | ||
& '.\Program Files\7-Zip\7z.exe' x .\google-cloud-sdk-$env:GCLOUD_CLI_VERSION-windows-x86_64.zip; ` | ||
.\google-cloud-sdk\install.bat --quiet; ` | ||
rm .\google-cloud-sdk-$env:GCLOUD_CLI_VERSION-windows-x86_64.zip | ||
|
||
# Update Path | ||
RUN $old = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name path).path; ` | ||
Write-Host $old; ` | ||
$gcloudPath = ';C:\google-cloud-sdk\bin'; ` | ||
$new = $old + $gcloudPath; ` | ||
Write-Host $new; ` | ||
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name path -Value $new; ` | ||
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1; ` | ||
refreshenv | ||
|
||
# Install gke-gcloud-auth-plugin (gcloud cli doesnt make this easy) | ||
RUN Write-Host "Installing gke-gcloud-auth-plugin"; ` | ||
$env:CLOUDSDK_PYTHON = (& gcloud components copy-bundled-python); ` | ||
Write-Host "GCLOUDSDK_PYTHON path: ${env:CLOUDSDK_PYTHON}"; ` | ||
$env:GCloud_output = (gcloud components install gke-gcloud-auth-plugin --quiet 2>&1); ` | ||
if(-not [string]::IsNullOrWhiteSpace($env:GCloud_output)) { Write-Host "${env:GCloud_output}"; } |