mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #81625 from pjh/reenable-windows-defender
Leave Windows Defender enabled for clusters on GCE
This commit is contained in:
commit
5e649417c6
@ -100,7 +100,6 @@ try {
|
|||||||
Dump-DebugInfoToConsole
|
Dump-DebugInfoToConsole
|
||||||
Set-PrerequisiteOptions
|
Set-PrerequisiteOptions
|
||||||
$kube_env = Fetch-KubeEnv
|
$kube_env = Fetch-KubeEnv
|
||||||
Disable-WindowsDefender
|
|
||||||
|
|
||||||
if (Test-IsTestCluster $kube_env) {
|
if (Test-IsTestCluster $kube_env) {
|
||||||
Log-Output 'Test cluster detected, installing OpenSSH.'
|
Log-Output 'Test cluster detected, installing OpenSSH.'
|
||||||
|
@ -244,22 +244,6 @@ function Set-PrerequisiteOptions {
|
|||||||
Install-Module -Name powershell-yaml -Force
|
Install-Module -Name powershell-yaml -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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 ((Get-WindowsFeature -Name 'Windows-Defender').Installed) {
|
|
||||||
Log-Output "Disabling Windows Defender service"
|
|
||||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
|
||||||
Uninstall-WindowsFeature -Name 'Windows-Defender'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Creates directories where other functions in this module will read and write
|
# Creates directories where other functions in this module will read and write
|
||||||
# data.
|
# data.
|
||||||
# Note: C:\tmp is required for running certain kubernetes tests.
|
# Note: C:\tmp is required for running certain kubernetes tests.
|
||||||
|
Loading…
Reference in New Issue
Block a user