Skip to content

Commit

Permalink
Extend windows os drive size when customized OSDiskSizeGB is used (Az…
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangtianLi authored and wenwu449 committed Jan 22, 2018
1 parent 88ec2fb commit 203efbf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions parts/kuberneteswindowssetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ function Set-TelemetrySetting()
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "CommercialId" -Value $global:WindowsTelemetryGUID -Force
}

function Resize-OSDrive()
{
$osDrive = ((Get-WmiObject Win32_OperatingSystem).SystemDrive).TrimEnd(":")
$size = (Get-Partition -DriveLetter $osDrive).Size
$maxSize = (Get-PartitionSupportedSize -DriveLetter $osDrive).SizeMax
if ($size -lt $maxSize)
{
Resize-Partition -DriveLetter $osDrive -Size $maxSize
}
}

function
Get-KubeBinaries()
{
Expand Down Expand Up @@ -369,6 +380,9 @@ try
Write-Log "apply telemetry data setting"
Set-TelemetrySetting

Write-Log "resize os drive if possible"
Resize-OSDrive

Write-Log "download kubelet binaries and unzip"
Get-KubeBinaries

Expand Down

0 comments on commit 203efbf

Please sign in to comment.