-
Notifications
You must be signed in to change notification settings - Fork 14
operator: implement Console controller #1105
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
Conversation
Refactor the redpanda console integration to first convert `redpanda.RenderState` into a `StaticConfiguration`. The `StaticConfiguration` is then transformed into a `PartialConsoleValues` which is then merged into the subchart values to perform the final rendering. This is done to allow allow the charts' integration to be leveraged by the upcoming console controller. Notable changes include: - Using the bootstrap user for console's auth instead of the first listed SASL user. - Generating a partial version of Console's config to add typing to the configuration code. - The introduction of `operator/pkg/ir` to host non-user facing datastructures. These structs may evolve without impact to our public APIs and help resolve cyclic imports.
This commit adds a standalone `Console` CR and its controller. Unlike the console stanza in the redpanda chart, this CR deploys console V3. This commit does NOT include a migration from the subchart to the new CR. That will be implemented later.
6b6c26d to
1c1ce11
Compare
| return nil | ||
| } | ||
|
|
||
| jwtSigningKey := state.Values.Secret.Authentication.JWTSigningKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic has been lifted into the chart specific entry point.
| { buildGoModule, lib, fetchFromGitHub }: | ||
|
|
||
| buildGoModule rec { | ||
| pname = "goverter"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goverter is used to generate the conversion between console CRDs and console values. It's much nicer to work with than conversion-gen and supports better customization. Attempting to share types is otherwise a headache and the ergonomics of CRDs and helm values don't match up anyhow.
RafalKorepta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| // Reconcile the console a few times to ensure determinism. | ||
| for range 3 { | ||
| _, err = consoleCtrl.Reconcile(t.Context(), ctrl.Request{NamespacedName: kube.AsKey(console)}) | ||
| require.NoError(t, err) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: This assertion does not ensure determinism, only reconciliation without error. In my humble opinion the resources that are created as part of the reconciliation could be asserted or compared that they don't change even if reconciliation is run 3 times would match the comment.
| manifest, err := yaml.Marshal(objects) | ||
| require.NoError(t, err) | ||
|
|
||
| golden.AssertGolden(t, testutil.YAML, tc.name, manifest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Inside golden file I don't see kind and apiVersion. That at lest to me make it harder to read the resources.
58668bc to
8493983
Compare
|
I accidentally made this PR unrecoverable by deleting the base branch. New PR here: #1113 |
This commit adds a standalone
ConsoleCR and its controller. Unlike the console stanza in the redpanda chart, this CR deploys console V3.This commit does NOT include a migration from the subchart to the new CR. That will be implemented later.
While this is a draft, I don't foresee much of it changing. All that's left is a bit of documentation, a changelog, and finishing up the acceptance tests.