Skip to content

Commit 4884873

Browse files
authored
Merge pull request kubernetes#78272 from yujuhong/disable-windows-defender
GCE: Disable the Windows defender
2 parents a07b027 + 3b58a5d commit 4884873

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cluster/gce/windows/k8s-node-setup.psm1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,18 +249,16 @@ function Set-PrerequisiteOptions {
249249
Install-Module -Name powershell-yaml -Force
250250
}
251251

252-
# Disables Windows Defender realtime scanning if this Windows node is part of a
253-
# test cluster.
254-
#
255-
# ${kube_env} must have already been set.
252+
# Disables Windows Defender realtime scanning.
253+
# TODO: remove this workaround once the fix is rolled out the Windows image
254+
# https://github.com/kubernetes/kubernetes/issues/75148
256255
function Disable-WindowsDefender {
257256
# Windows Defender periodically consumes 100% of the CPU, so disable realtime
258257
# scanning. Uninstalling the Windows Feature will prevent the service from
259258
# starting after a reboot.
260259
# TODO(pjh): move this step to image preparation, since we don't want to do a
261260
# full reboot here.
262-
if ((Test-IsTestCluster ${kube_env}) -and
263-
((Get-WindowsFeature -Name 'Windows-Defender').Installed)) {
261+
if ((Get-WindowsFeature -Name 'Windows-Defender').Installed) {
264262
Log-Output "Disabling Windows Defender service"
265263
Set-MpPreference -DisableRealtimeMonitoring $true
266264
Uninstall-WindowsFeature -Name 'Windows-Defender'

0 commit comments

Comments
 (0)