mirror of https://github.com/k3s-io/k3s
Merge pull request #78272 from yujuhong/disable-windows-defender
GCE: Disable the Windows defenderk3s-v1.15.3
commit
4884873160
|
@ -249,18 +249,16 @@ function Set-PrerequisiteOptions {
|
||||||
Install-Module -Name powershell-yaml -Force
|
Install-Module -Name powershell-yaml -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
# Disables Windows Defender realtime scanning if this Windows node is part of a
|
# Disables Windows Defender realtime scanning.
|
||||||
# test cluster.
|
# TODO: remove this workaround once the fix is rolled out the Windows image
|
||||||
#
|
# https://github.com/kubernetes/kubernetes/issues/75148
|
||||||
# ${kube_env} must have already been set.
|
|
||||||
function Disable-WindowsDefender {
|
function Disable-WindowsDefender {
|
||||||
# Windows Defender periodically consumes 100% of the CPU, so disable realtime
|
# Windows Defender periodically consumes 100% of the CPU, so disable realtime
|
||||||
# scanning. Uninstalling the Windows Feature will prevent the service from
|
# scanning. Uninstalling the Windows Feature will prevent the service from
|
||||||
# starting after a reboot.
|
# starting after a reboot.
|
||||||
# TODO(pjh): move this step to image preparation, since we don't want to do a
|
# TODO(pjh): move this step to image preparation, since we don't want to do a
|
||||||
# full reboot here.
|
# full reboot here.
|
||||||
if ((Test-IsTestCluster ${kube_env}) -and
|
if ((Get-WindowsFeature -Name 'Windows-Defender').Installed) {
|
||||||
((Get-WindowsFeature -Name 'Windows-Defender').Installed)) {
|
|
||||||
Log-Output "Disabling Windows Defender service"
|
Log-Output "Disabling Windows Defender service"
|
||||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
Set-MpPreference -DisableRealtimeMonitoring $true
|
||||||
Uninstall-WindowsFeature -Name 'Windows-Defender'
|
Uninstall-WindowsFeature -Name 'Windows-Defender'
|
||||||
|
|
Loading…
Reference in New Issue