Skip to content

config: Add versioned operator configuration through a CRD - #203

Open
HarshwardhanPatil07 wants to merge 14 commits into
bootc-dev:mainfrom
HarshwardhanPatil07:issue-92-configmap-config
Open

HarshwardhanPatil07 wants to merge 14 commits into
bootc-dev:mainfrom
HarshwardhanPatil07:issue-92-configmap-config

Conversation

@HarshwardhanPatil07

@HarshwardhanPatil07 HarshwardhanPatil07 commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Administrators currently need to edit operator workload arguments to change settings and preserve those edits during upgrades. Add an optional, administrator-owned, cluster-scoped BootcOperatorConfig using the versioned node.bootc.dev/v1alpha1 API. The resource may have any valid Kubernetes name, but the controller and daemon require at most one instance at startup.

The API exposes controller insecure-registry policy and image-tag resolution period, plus the daemon fallback status-poll period. Kubernetes validates types and positive whole-second periods. Both processes make one bounded, uncached list request at startup: zero instances use existing defaults, one supplies settings, and multiple instances or API errors stop startup with a contextual error. Explicit CLI flags take precedence, including false and fractional durations. Changes require a manual restart of the affected workload. Both service accounts receive only list permission for this resource.

The bink workflow now installs the CRD, waits for it, creates or updates its local-registry configuration, and only then deploys workloads. Install and Helm manifests include the CRD and permissions without creating or overwriting administrator configuration. Releases publish an optional, editable operator-config.yaml separately from install.yaml. Documentation covers precedence, restarts, revert and upgrade behavior, and Helm CRD upgrade ordering. Live updates, operator status reporting, and feature gates from #181 remain deferred.

Closes #92.

@alicefr

alicefr commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

I personally prefer a new CRD over a configmap. Mostly for 2 reasons, first it is versioned, secondly eventually we could use the crd status for reporting the operator status. The second point right now isn't used so the motivation isn't that strong.

I'd love also @cheesesashimi's opinion

@HarshwardhanPatil07 HarshwardhanPatil07 changed the title config: Support operator configuration through an optional ConfigMap config: Add versioned operator configuration through a CRD Sep 30, 2026
@HarshwardhanPatil07
HarshwardhanPatil07 force-pushed the issue-92-configmap-config branch 5 times, most recently from 16f3e66 to 19361d9 Compare September 30, 2026 11:24
@HarshwardhanPatil07

Copy link
Copy Markdown
Member Author

updated PTAL

Comment thread api/v1alpha1/bootcoperatorconfig_types.go Outdated
Comment thread internal/config/config.go Outdated
Comment thread Makefile Outdated
Comment thread test/e2e/config_test.go Outdated
Comment thread test/e2e/config_test.go Outdated

// TestOperatorConfig changes shared operator configuration and must remain
// serial. Run it on a dedicated test cluster, like the other lifecycle tests.
func TestOperatorConfig(t *testing.T) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this test really necessary, it adds a lot of complexity for little gain imo. Cannot we cover with unit test?

@alicefr

alicefr commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

We should also probably generate a cr as part of the release with some good defaults. This is at least how kubevirt is doing it

@HarshwardhanPatil07
HarshwardhanPatil07 force-pushed the issue-92-configmap-config branch 6 times, most recently from bfbeb93 to e2740b9 Compare October 6, 2026 07:48
@HarshwardhanPatil07

Copy link
Copy Markdown
Member Author

PTAL

resources:
- bootcoperatorconfigs
verbs:
- list

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

isn't get also required?

Comment thread Makefile Outdated
@alicefr

alicefr commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

@HarshwardhanPatil07 it looks great many thanks for doing this. Few last comment and this requires a rebase

Give administrators a typed cluster-scoped API for controller and daemon settings without editing workloads. Keep naming flexible; startup selection enforces that only one instance is used.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Prove API-server defaulting and rejection of invalid period, type, and field values before the startup path depends on the resource.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Preserve existing CLI behavior while allowing administrators to supply defaults through the resource. Explicit false values and fractional CLI durations continue to take precedence.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Read the administrator resource before informer caches exist. Treat missing CRDs, permission failures, API errors, and multiple instances as actionable startup errors while an absent instance keeps defaults.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Exercise absent, custom-named, updated, conflicting, and missing-CRD resources through envtest so the loader behavior is covered beyond mocked HTTP responses.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Make registry policy and tag resolution configurable on controller startup without changing explicit CLI overrides. Grant its service account only the list permission needed to select the singleton.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Let each daemon load the same administrator-owned resource at startup while preserving explicit CLI overrides. Give the daemon service account the list permission needed for the read.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Bink needs local registry settings at the controller first startup. Wait for the CRD, create or update the one resource, then deploy; preserve the redeploy restart that refreshes the latest image.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
The release upgrade test temporarily removes current CRDs, which also deletes configuration. Snapshot and restore the optional resource during cleanup and restart workloads so later tests observe the original settings.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Give administrators a concrete example and document the single-instance rule, CLI precedence, manual restarts, and upgrade-safe ownership before they adopt the new API.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Helm does not upgrade CRDs in the chart automatically. Explain how to establish the new CRD before workloads restart and read the optional configuration.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Provide an editable example without putting an administrator-owned instance into install.yaml, so routine installs and upgrades cannot overwrite configuration.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Keep the downloadable example aligned with API defaults and ensure install.yaml ships the CRD without creating a configuration instance. Run the checks on every PR.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Make the versioned API discoverable alongside each release. Validate both assets before publishing and direct administrators to check for an existing instance before applying the example.

Refs: bootc-dev#92

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
@HarshwardhanPatil07
HarshwardhanPatil07 force-pushed the issue-92-configmap-config branch from e2740b9 to 7a4ebda Compare October 9, 2026 10:15

This branch has not been deployed

No deployments
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.

Support a configmap-backed config dir for configuring the bootc-operator

2 participants