Skip to content

Conversation

@bobsira
Copy link

@bobsira bobsira commented Sep 20, 2024

To test this PR follow the steps below

Prerequisites (local machine)

  • Local clones of:
  1. minikube-machine with the branch for this PR
  2. minikube with the branch for this PR

1) Prepare local modules (temporary local replace)

Open go.mod in your local minikube repo and temporarily replace the github.com/docker/machine module with your local minikube-machine path.

Before (example upstream replacement)
github.com/docker/machine => github.com/minikube-machine/machine v0.0.0-20240815173309-ffb6b643c381

Temporary local replace( use a Windows absolute path)

- github.com/docker/machine => github.com/minikube-machine/machine v0.0.0-20240815173309-ffb6b643c381
+ github.com/docker/machine => c:/dev/mini-machine/machine

Important: This replace is only for local testing. Remove or revert it before committing/pushing.

2) Build minikube

From the minikube repo root build with make (repo uses make target)

# execute this in git bash 
make

You should now have minikube.exe in the repo out directory

3) Start a hybrid cluster (elevated PowerShell)

Start using the default (built-in) VHD

.\minikube.exe start --kubernetes-version=v1.33.0 -n 2 --node-os='[linux,windows]'

Start using a custom VHD (remote or local)

--windows-vhd-url accepts remote URLs or local absolute paths:

Remote
.\minikube.exe start --kubernetes-version=v1.32.3 -n 2 --node-os='[linux,windows]' --windows-vhd-url='https://<your-storage>/hybrid-minikube-windows-server.vhdx'
Local path
.\minikube.exe start --kubernetes-version=v1.32.3 -n 2 --node-os='[linux,windows]' --windows-vhd-url='C:\vhd\hybrid-minikube-windows-server.vhdx'

4) What to expect

  • minikube start provisions a Linux control plane VM and a Windows worker VM.
  • VM provisioned from a prebuilt VHD
  • kubectl get nodes -o wide should show two nodes with OS labels: one linux, one windows.

Setting up the cluster
minikube_pic

Verify your cluster
cluster

@bobsira bobsira marked this pull request as ready for review January 1, 2025 09:22
@bobsira bobsira changed the title [DRAFT] Windows node setup Windows node setup Jan 1, 2025
@bobsira bobsira changed the title Windows node setup windows node setup Feb 27, 2025
@bobsira bobsira changed the title windows node setup [machine]:windows node setup Feb 27, 2025
if err := b2dutils.CopyIsoToMachineDir(d.Boot2DockerURL, d.MachineName); err != nil {
return err

if mcnutils.ConfigGuest.GetGuestOS() == "windows" {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice if the ConfigGuest type had a "IsWindows()" method that we reuse throughout this change. I know it's just a comparison against a string, but this type of comparison changes over time.

}
}

log.Infof("Starting VM...")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a useful logging message we're removing. Could even enhance it a bit with info about the VM we're starting.

@kartikjoshi21
Copy link

@bobsira Thankyou for the PR, I have tried this PR locally along with bobsira/minikube#4 , Looks good to me. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants