-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Windows release? #300
Comments
I think cross-compiling Kubebuilder binary itself should be easy because we use |
If you want to run this on Windows, you could also enable the Windows Linux Subsystem on Windows https://github.com/michaeltreat/Windows-Subsystem-For-Linux-Setup-Guide |
@p-bakker It's worth noting that ~50% of devs use Windows and most don't use the subsystem for Linux. |
true, but WSL is fairly new/gaining traction and while Devs use windows, I'd say most deployments are on Linux, so imho devs would be wise to get familiar with WSL and start making it part of their Not saying there's no point in having native support on Windows, just noting there are alternatives which are pretty straight forward imho |
WSL does not fully support all development workflows. For example: Can't run delve debugger on WSL: microsoft/WSL#2977 There is also issue running kubebuilder tests on WSL because etcd shipped with kubebuilder does not run under WSL. Would be nice if the native windows version was available. |
@droot Could you elaborate on With the two diffs below, I'm able to build and use Kubebuilder natively on windows. I'm happy to take this task up and do the work necessary to get it into mergeable state. |
For testing on windows, I used a container and volume mounted my dev directory so that I could run kube-apiserver. This is one of the areas that would require more work for a smooth experience, e.g. providing a predefined dev docker container or possibly running kube-apiserver (and ideally other elements) from a docker image during tests. |
Yes, thats what I meant. |
/reopen |
@alexeldeib: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@droot I marked this as fixed in the PR which was a mistake 😦 could you reopen? |
sorry for the terrifically long delay here |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/lifecycle frozen |
we still need help for this. we'll want CI too |
Re #300 (comment) about WSL, Microsoft gave up on trying to translating syscalls and WSL2 is a very lightweight VM so now truly all Linux programs will work. Just sayin'. |
I think it’s reasonable to tell windows users to run e2e tests agains kind, and set envtest to use existing cluster? I regularly work on windows and linux and use kubebuilder fine with this approach on both. Some random characters in help text but that’s my biggest complaint. Rest of testing can probably be done in Go and be x-plat? |
I am starting off with kubebuilder on windows- is the easiest option to build by myself? |
That’s what I do |
It'd be nice to at least have nightly builds using cross-compile, I think (if anyone wants to pitch in) and a test on prow/travis that tries to cross-compile. |
With both issues mentioned in #300 (comment) merged, is it possible to compile for windows straight away or do I need to change anything? The mentioned tests issues are with projects build with kubebuilder or with the kubebuilder cmd? The first is not an issue as they will be tested in my CI machines which are non-windows. |
You'll be fine. I did a sanity check right now: git clone [email protected]:kubernetes-sigs/kubebuilder
cd kubebuilder
go build -o kubebuilder.exe ./cmd/
./kubebuilder.exe # works |
Elaborating on my original comment, the test issues are related to running e2e tests for controllers built using Kubebuilder which depend on a full Kubernetes cluster. On Linux, you can use the etcd/apiserver binaries and the Using kind works well as a backing cluster for The tests for kubebuilder itself are a separate story. |
I have a running kubernetes on windows (docker-for-windows). Well its actually not windows somehow as it is pulling the linux images from the manifests, but all the kubernetes cluster is accessible with kubectl from the windows command. Shouldn't that be enough for e2e tests? |
See https://godoc.org/sigs.k8s.io/controller-runtime/pkg/envtest for requirements, but that will probably work. I can't say without more certainty without trying 😄 |
Which version of Golang are you using? I'm asking this to know if I must set go modules as I'm currently using 1.12.x which if I'm not mistaken is the last that doesn't have it turned on by default. |
Correct, the above requires go modules (I always enable them by default in my environment) Barring windows specific issues on this thread, slack channel is probably a better forum for discussion + q/a 🙂 |
@alexeldeib So forgive the novice question, but with a backing "real" k8s cluster, this should just work then? The issues you are pointing out are unit testing without a cluster which I can honestly live without. |
I'm finding some issues with the paths inside the generated Makefile for the projects. To achieve compatibility with Windows I guess this generated Makefile (https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/scaffold/v2/makefile.go) needs to be either generic or specific for the target OS. |
happy to take fixes to make it windows-compatible (none of the core devs have windows machines, so it's a bit hard for us) |
This is how I installed kubebuilder on WSL2.
|
@alexeldeib It works brilliant, however I am having issues when I use the command |
it doesn't work at all !!! I have tried , but when I execute "kubebuilder version", error occured and shows that |
Closed in favor of : #2940 |
There are releases for both Mac and Linux (appears to be POSIX based). Would it be possible to cross-compile to Windows and have a Windows release as well?
The text was updated successfully, but these errors were encountered: