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

[docs]: How does remote development work now? #742

Closed
ian-buse opened this issue Apr 5, 2024 · 5 comments
Closed

[docs]: How does remote development work now? #742

ian-buse opened this issue Apr 5, 2024 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@ian-buse
Copy link
Contributor

ian-buse commented Apr 5, 2024

Describe the missing piece of documentation

Prior to v 8.x, there was good documentation on how to get your operator up and running, how to create and install webhooks, etc. Running the install and then webhooks install commands worked well. I skipped upgrading to 8.x, and move straight to 9.0.0.

With 9.0.0, there seems to be missing or out of date documentation for developing the operator, especially in regard to webhooks. The webhook commands are missing, and the CLI documentation references commands that as far as I can tell no longer exist.

In a somewhat related problem, the webhook example Program.cs seems to reference a RegisterComponents() method that no longer exists, with the error 'IOperatorBuilder' does not contain a definition for 'RegisterComponents' and no accessible extension method 'RegisterComponents' accepting a first argument of type 'IOperatorBuilder' could be found (are you missing a using directive or an assembly reference?)

Part of these issues were brought up in #740, but I wanted to make sure this gets seen. I have so far been unable to get my operator with webhooks working.

As a side note, I'd be happy to help contribute to documentation when I get things working again, if needed.

@ian-buse ian-buse added the documentation Improvements or additions to documentation label Apr 5, 2024
@SGStino
Copy link

SGStino commented Apr 17, 2024

If i'm correct, the RegisterComponents was doing assembly scanning to find all the required components.

Now you can register all components explicitly:

services.AddKubernetesOperator()
 .AddController<MyController, MyControlledResource>()
 .AddFinalizer<MyFinalizer, MyControlledResource>("my-finalizer-identifier");

@buehler
Copy link
Owner

buehler commented Apr 18, 2024

Hey @ian-buse

If you do not use source generators (KubeOps.Generator), then you do not have the RegisterComponents method. However, if the generator is in place, it will create the required method for "register components" and as such, all things are getting registered.

You can see the code that is generated in the test files (https://github.com/buehler/dotnet-operator-sdk/tree/main/test/KubeOps.Generator.Test).

The webhook install command and other commands regarding webhooks are no longer required. When creating the kustomize configs with the kubeops.cli, the cli detects if you have webhooks installed. If you do, it creates a self signed certificate (now without the help of the external tool) and the required resources.

https://buehler.github.io/dotnet-operator-sdk/src/KubeOps.Operator.Web/README.html#installing-in-the-cluster

@buehler
Copy link
Owner

buehler commented Apr 19, 2024

@ian-buse as an addition to your question in #740:
The CLI does not "determine" commands. All implemented commands should (™️) be available at all the times.

Which currently includes:

  • version
  • generate operator
  • install (crds)
  • uninstall (crds)

There is nothing more "needed" by this time. If any of these commands are missing, the implmementation of this console thingy has a bug.

@SGStino
Copy link

SGStino commented Apr 19, 2024

No, the help is talking about much more than just these, which might confuse people :)

@ian-buse
Copy link
Contributor Author

I see now how this works now, thank you. I've opted not to use RegisterComponents() and do the registration manually.

This still leaves a small problem with the documentation because it talks about a few commands that don't exist anymore. I'd be happy to remove the old commands from the documentation if you're okay with that.

ian-buse added a commit to dh2i-devs/dotnet-operator-sdk that referenced this issue May 14, 2024
ian-buse added a commit to dh2i-devs/dotnet-operator-sdk that referenced this issue May 14, 2024
buehler added a commit that referenced this issue May 15, 2024
Quick fix for #742.

Related to #756. That PR has added documentation for development
webhooks.

Co-authored-by: Christoph Bühler <buehler@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants