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
|
||||
}
|
||||
|
||||
# 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'
|
||||
|
|
Loading…
Reference in New Issue