Skip to content

Correct Kubebuilder Multi-Group Statement #26

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

Merged
merged 1 commit into from
Feb 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions docs/code-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,11 @@ isn't deploying an "application" that needs to have a controlled deployment
plan. Instead, ASO is a controller that facilitates creation and management of
various AWS service objects using Kubernetes CRD instances.

kubebuilder is the recommended upstream tool for generating CRDs and controller
`kubebuilder` is the recommended upstream tool for generating CRDs and controller
stub code. It is a Go binary that creates the scaffolding for CRDs and
controller Go code. Unfortunately, it doesn't really handle multiple API groups
in the same source code repository, and we need that for ASO. For example, we
will have an `s3.service-operator.aws` and an `iam.service-operator.aws` API
group with CRDs representing those different API objects and interfaces.

That said, much of kubebuilder simply sets up some templates and then runs the
`controller-gen` binary from the sigs.kubernetes.io/controller-tools repository
to generate Go code.
controller Go code. It has support for multiple API groups (e.g. `s3.amazonaws.com`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, I see what you did here :) Nice inclusion of your preferred API namespace! ;P

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂 It's the namespace we used for our internal controller, so it's a habit at this point

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good in the hood. :)

and `dynamodb.amazonaws.com`) in a single code repository, so allows for sensible
separation of code.

Our final option was to build a hybrid custom code generator that used
controller-runtime under the hood but allowed us to generate controller stub
Expand Down