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

Upgrade to latest version of kubebuilder #29

Merged
merged 4 commits into from
Apr 12, 2024
Merged

Conversation

dethi
Copy link
Collaborator

@dethi dethi commented Apr 9, 2024

  • Stop using operator-sdk, as we don't use any of the additional feature and it makes it harder to upgrade
  • Switch to go/v4 plugin: this change a bit the layout of the project. go/v4 is the only supported version and ensure that we will support newer version of Go and Kubernetes.
  • Enabling the pprof endpoint is now directly part of the manager
  • Namespace cannot be specified anymore. This makes the controller watch for the CRD in all namespaces. Future changes are needed to support managing multiple clusters from the same controller.
  • Upgrade gohbase to the latest version available.

@pidren pidren self-requested a review April 10, 2024 00:04
@pidren
Copy link
Collaborator

pidren commented Apr 10, 2024

Namespace cannot be specified anymore. This makes the controller watch for the CRD in all namespaces.

Why are we even upgrading then?

@dethi
Copy link
Collaborator Author

dethi commented Apr 10, 2024

Because it never made sense to hardcode the namespace in the operator anyway. Now the operator can be deployed in any namespace, like hbase-system if wanted, and is able to react to the CRD being used in another namespace, like hbase. All the ressources managed by the operator itself will be deployed in the same namespace as the CRD. That's what every operator is doing.

The only limitation right now of this operator is that it takes the zookeeper config as an argument instead of being part of the CRD, which means it can only manage one CRD/HBase cluster at a time. I intend to change that in a follow-up PR.

@dethi
Copy link
Collaborator Author

dethi commented Apr 10, 2024

As for why upgrading:

  • kubebuilder and controller-runtime generally only support a specific version of Go, in that case the previous version was not supporting Go >1.19. This meant that there are dependencies I couldn't even upgrade.
  • They also support a set of Kubernetes version. If you want to be able to use newer feature of Kubernetes, you have to upgrade to newer version.
  • etc

ABU

@pidren
Copy link
Collaborator

pidren commented Apr 11, 2024

Let me clarify my point:

This makes the controller watch for the CRD in all namespaces.

This will not work on the larger production clusters. It's inherently a worse setup than what we have today.

@dethi
Copy link
Collaborator Author

dethi commented Apr 11, 2024

Having the operator watch for its own CRD in one namespace or all namespaces ultimately shouldn't change anything, since it is still watching only its own CRD type and thus if there is only one instance of that CRD, the usage should be the same.

This makes it easier to upgrade kubebuilder, as kubebuilder upgrade
requires to manually update the file or regenerate them with the CLI and
integrating our own change in them.
- Stop using operator-sdk, as we don't use any of the additional feature
  and it makes it harder to upgrade
- Switch to go/v4 plugin[1]: this change a bit the layout of the
  project. go/v4 is the only supported version and ensure that we will
  support newer version of Go and Kubernetes.
- Enabling the pprof endpoint is now directly part of the manager
- Namespace cannot be specified anymore. This makes the controller watch
  for the CRD in all namespaces. Future changes are needed to support
  managing multiple clusters from the same controller.
- Upgrade gohbase to the latest version available.

[1] https://book.kubebuilder.io/migration/v3vsv4#tldr-of-the-new-gov4-plugin
@dethi
Copy link
Collaborator Author

dethi commented Apr 11, 2024

That being said, I added back the flag (the option has moved in the manager to the cache). This way it can be enabled/disabled like before. And multi instance of the CRD setup is not something that works today anyway, but something I may address in a follow-up PR.

@dethi dethi merged commit 43a961b into timoha:main Apr 12, 2024
1 check passed
@dethi dethi deleted the upgrade branch April 12, 2024 22:06
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.

2 participants