Skip to content

Conversation

@chrisseto
Copy link
Contributor

@chrisseto chrisseto commented Sep 22, 2025

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.

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.

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.
return nil
}

jwtSigningKey := state.Values.Secret.Authentication.JWTSigningKey
Copy link
Contributor Author

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";
Copy link
Contributor Author

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.

Copy link
Contributor

@RafalKorepta RafalKorepta left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +153 to +157
// 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)
}
Copy link
Contributor

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)
Copy link
Contributor

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.

@chrisseto chrisseto force-pushed the chris/p/redpanda-console-refactor branch from 58668bc to 8493983 Compare September 24, 2025 17:13
@chrisseto chrisseto deleted the branch chris/p/redpanda-console-refactor September 24, 2025 18:37
@chrisseto chrisseto closed this Sep 24, 2025
@chrisseto
Copy link
Contributor Author

I accidentally made this PR unrecoverable by deleting the base branch. New PR here: #1113

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.

3 participants