Skip to content
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

Failed to install ingress-nginx plugin with krew! #12226

Open
zhumeishuai opened this issue Oct 23, 2024 · 16 comments
Open

Failed to install ingress-nginx plugin with krew! #12226

zhumeishuai opened this issue Oct 23, 2024 · 16 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@zhumeishuai
Copy link

Installing ingress-nginx plugin with krew failed with an error download https://github.com/kubernetes/ingress-nginx/releases/download/controller-0.31.0/kubectl-ingress_nginx-linux-amd64.tar.gz 404.
I tried my best on the search engines, but couldn't find any relevant information.
image

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority labels Oct 23, 2024
@strongjz strongjz self-assigned this Oct 24, 2024
@zhumeishuai
Copy link
Author

Is there any way to solve it?

@zhumeishuai
Copy link
Author

@strongjz Is there any way to solve it?

@strongjz
Copy link
Member

strongjz commented Nov 6, 2024

0.31.0 controller is no longer supported. To my understanding, the plugin version should match the controller version.

@gianarb
Copy link

gianarb commented Nov 7, 2024

Hello @strongjz I have facing the same issue.

I use helm to install nginx in my kubernetes cluster. Currently this is the helm version:

  repository = "https://kubernetes.github.io/ingress-nginx"
  chart      = "ingress-nginx"
  version    = "4.11.3"

At the best of my knowledge it is the latest released by this project.

Looking at the nginx controller image deployed this is what I have:

  Containers:
   controller:
    Image:           registry.k8s.io/ingress-nginx/controller:v1.11.3@sha256:d56f135b6462cfc476447cfe564b83a45e8bb7da2774963b00d12161112270b7
    Ports:           80/TCP, 443/TCP, 8443/TCP
    Host Ports:      0/TCP, 0/TCP, 0/TCP
    SeccompProfile:  RuntimeDefault

I can't find 0.31.0 anywhere in my system, so I am not sure why krew is looking for such version. Unfortunately I am debugging an issue for one of my cluster. I can't really dig deeper, but I will be back with more if I can find what is going on.

In the meantime I am gonna build the plugin from source

@mhbahmani
Copy link

Same issue here. Is there any solution for this?

@threadcrux
Copy link

threadcrux commented Dec 2, 2024

See my related issue filed here in krew repo: kubernetes-sigs/krew-index#4254

This is not a solution but shedding more light on the situation. The plugin definition has not been updated in 4+ years.

There is also a secondary issue, the plugin is based upon the controller releases that used to provide builds for different platforms/architectures. It no longer looks like the release system is providing builds.

Ping:
@cpanato
@Gacko
@puerco
@rikatz
@strongjz
@tao12345666333

Sorry about the ping blast. What needs to be done to get platform/architecture builds reestablished for the above? I can provide the fix in the krew repo but there is nothing to point the plugin definitions at.

I am also unsure of which version would be best for the plugin definition

@threadcrux
Copy link

threadcrux commented Dec 2, 2024

I started to reverse engineer what happened. The MakeFile no longer has a build-plugin target and the associated build-plugin.sh script is missing.

I filed an issue for those here:
#12436

Looks like it was removed here, and then nothing has happened since:
#8812

Not sure why removing the build script for manual building was the idea thrown around. Anyways there is a github action for this but not entirely sure its working

@strongjz
Copy link
Member

strongjz commented Dec 4, 2024

@threadcrux if you want to help ensure this doesnt happen again, you could add some ci to test the krew build on PR.

@threadcrux
Copy link

threadcrux commented Dec 4, 2024

@threadcrux if you want to help ensure this doesnt happen again, you could add some ci to test the krew build on PR.

I can start to think about it. I have a little bit of over commitment at the moment.

Questions:

  • This would test the plugin after build -separate of krew plugin? Or post krew install? Or both?
  • Are there any docs or previous implementations of testing in this area? How do you see this occurring from a high level standpoint. I'd like to see anything that's preexisting

It's definitely a good idea even if the initial implementation is super simple (i.e. testing a single piece of functionality to start). This would validate the releases are being made and it's usable from a deployment standpoint, not necessarily a functionality standpoint, but its a move in the right direction.

EDIT: Missed this phrasing

test the krew build on PR

Gotcha I see what you're thinking, add the test on the other side of that repo

@strongjz
Copy link
Member

/kind bug
/priority backlog
/triage accepted
/assign @strongjz

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 12, 2024
@strongjz
Copy link
Member

issues with our release for 1.12 have been resolved, we are looking to release 1.12.0, next patch for 1.11 and the final for 1.10 soon.

We should know then if the patch in the GHA for #12439 fixed the krew issue.

@allanhung
Copy link

From the GHA logs, it seems that the goreleaser configuration file (.goreleaser.yaml) needs to include version: 2.

version: 2
project_name: ingress-nginx
release:
  github:
    owner: kubernetes
...

@olix0r
Copy link

olix0r commented Jan 7, 2025

Is there a relatively straightforward way to fetch or build the binary manually? The docs only mention krew, afaict.

Barring that, is there a way to perform kubectl ingress-nginx backends manually (e.g. with port forwards?)

@olix0r
Copy link

olix0r commented Jan 7, 2025

I was able to work this out with something like:

:; go install k8s.io/ingress-nginx/cmd/[email protected]
...
:; go/bin/plugin
A kubectl plugin for inspecting your ingress-nginx deployments

Usage:
  ingress-nginx [command]
  ...

@zektorum
Copy link

zektorum commented Jan 8, 2025

I was able to work this out with something like:
:; go install k8s.io/ingress-nginx/cmd/[email protected]

After your command you should to run these commands

cp go/bin/plugin .krew/bin/kubectl-ingress_nginx
mkdir -p .krew/store/ingress-nginx/v1.11.4
ln -s /home/$USER/.krew/bin/kubectl-ingress_nginx /home/$USER/.krew/store/ingress-nginx/v1.11.4/ingress-nginx

and after that kubectl ingress-nginx will work

@allanhung
Copy link

allanhung commented Jan 8, 2025

If you want to build it yourself, you can try the following script: (it works for my mac)

brew install goreleaser gsed
git clone https://github.com/kubernetes/ingress-nginx
cd ingress-nginx
gsed -i -e '1i\version: 2' -e "/project_name: ingress-nginx/a\snapshot:\n  version_template: \"{{ .Tag }}-dirty\"" .goreleaser.yaml
gsed -i -e "/linux/d" -e "/windows/d" -e "/amd64/d" .goreleaser.yaml
goreleaser release --snapshot --clean
sudo cp $PWD/dist/ingress-nginx_darwin_arm64_v8.0/kubectl-ingress-nginx /usr/local/bin/kubectl-ingress_nginx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

No branches or pull requests

9 participants