-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
custom built 'k3s kubectl' and 'k3s crictl' do not work #231
Comments
The recommended way to build k3s is using |
Is there any more info needed here @ggardet? Maybe better documentation on building? |
I was following https://github.com/rancher/k3s#building-from-source to build and if I try to use the build script I get:
|
@ggardet try this
|
I guess it caused by GOPATH. |
Closing due to age. |
still broken in 1.20.4+k3s1 |
@hramrach would you like to expand on that comment? |
strace -f k3s kubectl get nodes |& grep ENOENT This is totally bogus.
|
Note that the message Error: unknown command "kubectl" for "kubectl" already hints at this problem. |
strace -f k3s crictl --help |& grep ENOENT |
Are you seeing this when building from source, or on a released version? Note that k3s is a self-extracting multicall binary, that's how we package containerd, kubectl, etc. If you are building from source but not running the correct binary you will see this behavior. |
Build from source, that's what this bug is about. What it the correct binary? |
Are you following the instructions in BUILDING.md, or just running |
I am running %{goprep} github.com/rancher/k3s The BUILDING.md adivises mkdir -p build/data && ./scripts/download && go generate There is problem with both commands. |
K3s is not just K3s - it also embeds kubernetes, containerd, flannel, etc. For that reason it cannot be built as simply as a more traditional standalone go binary. You need to build it the way we build it. If necessary, you may need to adapt your build pipeline to pull down the Traefik artifacts and place them in the appropriate location as if you were running the download script. If you need to customize the go flags, you can tweak the makefile as necessary for your platform. |
scripts/download downloads binaries during build. Is there no way to build k3s from source? |
K3s is built from many pieces. It includes a full set of userspace binaries, and manifests for all the packaged components. Some of these are pulled from other repos in this project, while others come from different projects. Which binary are you having a problem with? |
@brandond I have to agree with @hramrach here. We need to be able to build this from source in an offline environment like the openSUSE Build Service. For example I ran into #3704 because the version you ship in the OBS is outdated. I know Golang packaging is a pain in the OBS but compliance is a thing these days. At least I don't want to download random stuff from the internet, the past should show that this is not a clever thing to do. P.S.: You do find me in Slack, so if you need help with the packaging we can go through the pain together. |
I don't believe K3s maintainers are utilizing OBS to ship anything at this point. The K3s package that exists for OpenSUSE is not an official package. |
@Oats87 I know this is politically incorrect but Rancher has joined SUSE and thus they live in our Ecosystem. Customers do want RPMs from the IBS. Since at SUSE we have the Factory first policy, I personally (can't speak for the company though) would believe they have inherited the maintenance if they want or not. I mean we do offer MicroOS Flavors with preinstalled k3s. |
@SchoolGuy I'm not so sure I agree with that. I'm sure folks want official RPMs for K3s but at this point we (the K3s maintainers) don't even have that on our roadmap. To my understanding, the folks that initially created the K3s package for OpenSUSE are part of the openSUSE Kubic project. OpenSUSE is exactly what it is stated as -- open, and thus maintenance of the packages for for OpenSUSE, while they may be influenced by SUSE, are still technically community driven. |
I'll repost what I said on slack, which is a paraphrased version of what I posted above.
Also keep in mind that K3s is a CNCF project, and does not need to (nor should it be asked to) suse-ify itself. We have other downstream projects like RKE2 that are more tightly tied to business deliverables. Also, related: #4347 |
OK, I think we should remove K3s from openSUSE then. It is not meant to be buildable from source so we cannot distribute it in openSUSE. |
That is an incorrect statement. If it's not built from source, then what is it built from? Like many Go projects, it is not buildable solely from the source code in this repository. It is easiest to build it online so that the build scripts can pull down various external components. It can be built in an isolated environment with some additional preparation. |
No, it cannot be built from source. It uses other repositories but does not build the software from those repositories from source, it downloads prebuilt binaries. It does not support using binaries preinstalled on the system for its dependencies either, it must be a binary package downloaded form the Internet (either during build or in advance). Some of these projects it relies on require binaries of themselves to build, there is no provision for building from source whatsoever. |
@hramrach Then you can't sell any of our products except SLE. Vendoring is part of the OBS currently. And because this is Golang it can be built offline. So no we don't have to remove it from the OBS. |
Vendoring sources or vendoring binaries? k3s is vendoring binaries while openSUSE only allows vendoring sources AFAIK. |
@hramrach We do both afaik. At least if you consider shipping minified JS as a binary. |
That probably escaped review because it is not obvious that the file is a binary. |
@hramrach Let's take this discussion elsewhere to not spam this issue. |
Describe the bug
k3s kubectl --help
returns:k3s crictl--help
returns:To Reproduce
Steps to reproduce the behavior:
Build k3s, symlink kubectl and crictl to k3s and run:
k3s kubectl --help
ork3s crictl --help
Expected behavior
k3s kubectl
should handlekubectl
requests. Same for crictl.Screenshots
None
Additional context
It is built from sources, v0.2.0. Maybe some flags/options are missing to enable kubectl and crictl support?
The text was updated successfully, but these errors were encountered: