New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KubeEnv var to enable Hyper-V in GCE Windows nodes created with kube-up #105999
Conversation
/sig windows |
15ec1e1
to
9e29cc0
Compare
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
@@ -118,17 +118,32 @@ try { | |||
|
|||
Dump-DebugInfoToConsole | |||
|
|||
$kube_env = Fetch-KubeEnv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why moved this part up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first check to see if we have to install Hyper-V is to see the value of kube_env[WINDOWS_ENABLE_HYPERV]
, these lines fetch kubeEnv from the instance metadata
function Enable-HyperVFeature { | ||
Log-Output "Enabling Windows 'HyperV' feature" | ||
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart | ||
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShell -All -NoRestart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why -NoRestart option here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could restart after enabling each feature but instead we could batch all of the installations that require a restart to do a restart after all of them completed, what I saw is:
Install Hyper-V (requires restart but it's deferred)
Install Hyper-V PowerShell tools
Install Container support (requires restart but it's deferred)
Restart Computer
/lgtm |
/triage accepted |
/lgtm Thanks for the clean code and the detailed PR description. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mauriciopoppe, pjh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
We'd like to create VHDs as part of the E2E tests of Local Volume Provisioner (kubernetes-sigs/sig-storage-local-static-provisioner#277), VHDs require Hyper-V to be enabled, this PR adds a new KubeEnv flag to enable Hyper-V in GCE Windows VMs, the feature is opt-in and disabled by default.
Testing
I created a GCE cluster with the following env vars (in addition to the common ones):
Once the Windows VM was up I SSHd to it and verified that the command
New-VHD
is available, I could create a VHD with it:Installation logs:
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?
/cc @pjh @jingxu97