Merge pull request #78272 from yujuhong/disable-windows-defender

GCE: Disable the Windows defender
k3s-v1.15.3
Kubernetes Prow Robot 2019-05-24 00:46:19 -07:00 committed by GitHub
commit 4884873160
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

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