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

Update controller-tools to latest version #406

Open
e-volusian opened this issue Jun 10, 2024 · 7 comments
Open

Update controller-tools to latest version #406

e-volusian opened this issue Jun 10, 2024 · 7 comments

Comments

@e-volusian
Copy link

Main is on controller-tools version 0.13.0. On that version, I get error from make install:

# make install
test -s /mnt/vdb/root/repos/mercari/tortoise/bin/kustomize || { curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- 3.8.7 /mnt/vdb/root/repos/mercari/tortoise/bin; }
/mnt/vdb/root/repos/mercari/tortoise/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa0de0f]
<snip>
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 1
	/mnt/vdb/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:260 +0x1c5
make: *** [Makefile:43: manifests] Error 2

Fixed in v0.15.0

@sanposhiho
Copy link
Collaborator

Well, it's not reproducible for me.
Instead of make install, you may want to use Yaml files in https://github.com/mercari/tortoise/tree/main/manifests directly.

@toasahi
Copy link

toasahi commented Jun 13, 2024

I am in the same situation.
Environment
mac m1 : v14.4.1
docker-desktop : v4.30.0
kubernetes: v1.29.2

Verification command: make install
make install

test -s /Users/kubernetes/tortoise/bin/kustomize || { curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- 3.8.7 /Users/kubernetes/tortoise/bin; }
/Users/kubernetes/tortoise/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1047f0fb0]

@e-volusian
Copy link
Author

@toasahi -- I'm not sure if your comment means that you did or did not get it working. Regardless, the fix is to change:

CONTROLLER_TOOLS_VERSION ?= v0.13.0

to

CONTROLLER_TOOLS_VERSION ?= v0.15.0

on line 130 of Makefile. After I did this, tortoise built, installed, and is working and currently GatheringData.

@toasahi
Copy link

toasahi commented Jun 13, 2024

Thank you, @e-volusian
"CONTROLLER_TOOLS_VERSION ? = v0.15.0" but the error still occurs.

test -s /Users/kubernetes/tortoise/bin/kustomize || { curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- 3.8.7 /Users/kubernetes/tortoise/bin; }
/Users/kubernetes/tortoise/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1047f0fb0]

@e-volusian
Copy link
Author

According to my notes, these are the three things I had to do to make the install work on a brand new kind cluster:

  1. Make sure cert-manager installed
  2. Make sure the namespace system exists
  3. Upgrade controller-tools version to v0.15.0

Not sure if those will help you, but....that's all I got. 🤷

@sanposhiho
Copy link
Collaborator

sanposhiho commented Jun 13, 2024

Instead of make install, you may want to use Yaml files in https://github.com/mercari/tortoise/tree/main/manifests directly

Again, this workaround should work for everyone. Applying yaml files in https://github.com/mercari/tortoise/tree/main/manifests equals make install and make deploy. Try out this way if you still get into trouble.

@toasahi
Copy link

toasahi commented Jun 13, 2024

Instead of make install, you may want to use Yaml files in https://github.com/mercari/tortoise/tree/main/manifests directly

Again, this workaround should work for everyone. Applying yaml files in https://github.com/mercari/tortoise/tree/main/manifests equals make install and make deploy. Try out this way if you still get into trouble.

Thank you, @e-volusian @sanposhiho
I was able to solve the problem!

The procedure is left here.

  1. kubectl create ns system
  2. kubectl apply -f . /crd
  3. kubectl apply -f . /default
Error from server (NotFound): error when creating "default/apps_v1_deployment_tortoise-controller-manager.yaml": namespaces "tortoise-system" not found
Error from server (NotFound): error when creating "default/cert-manager.io_v1_certificate_tortoise-serving-cert.yaml": namespaces "tortoise-system" not found
Error from server (NotFound): error when creating "default/cert-manager.io_v1_issuer_tortoise-selfsigned-issuer.yaml": namespaces "tortoise-system" not found
Error from server (NotFound): error when creating "default/rbac.authorization.k8s.io_v1_role_tortoise-leader-election-role.yaml": namespaces "tortoise-system" not found
Error from server (NotFound): error when creating "default/rbac.authorization.k8s.io_v1_rolebinding_tortoise-leader-election-rolebinding.yaml": namespaces "tortoise-system" not found
Error from server (NotFound): error when creating "default/v1_configmap_tortoise-manager-config.yaml": namespaces "tortoise-system" not found
  1. kubectl apply -f . /default

This procedure has been used to deploy tortoise.

@e-volusian e-volusian changed the title Upgdate controller-tools to latest version Update controller-tools to latest version Jun 17, 2024
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

No branches or pull requests

3 participants