Skip to content

Conversation

@frobware
Copy link
Contributor

Summary

This PR restructures the Config API to support configurable images for the bpfman daemon's init container and CSI driver registrar sidecar. This enables downstream distributions (e.g., OpenShift) to substitute alternative base images via kustomize overlays without carrying patches to upstream manifests.

Changes

  • Introduce DaemonSpec struct mirroring the existing AgentSpec pattern
  • Move image and logLevel from spec to spec.daemon
  • Add two new optional fields under spec.daemon:
    • bpffsInitImage: overrides the init container image (default: quay.io/fedora/fedora-minimal:39)
    • csiRegistrarImage: overrides the CSI node driver registrar image (default: quay.io/bpfman/csi-node-driver-registrar:v2.13.0)

API Structure

spec:
  agent:
    image: quay.io/bpfman/bpfman-agent:latest
    logLevel: info
    healthProbePort: 8175
  daemon:
    image: quay.io/bpfman/bpfman:latest
    logLevel: info
    bpffsInitImage: ""      # optional
    csiRegistrarImage: ""   # optional

Test plan

Verified on KIND cluster that optional image fields work correctly and revert to defaults when removed:

1. Initial state (defaults from daemonset.yaml):

node-driver-registrar: quay.io/bpfman/csi-node-driver-registrar:v2.13.0
mount-bpffs: quay.io/fedora/fedora-minimal:39

2. Patch Config CR with custom images:

kubectl patch config bpfman-config --type=merge -p \
  '{"spec":{"daemon":{"bpffsInitImage":"docker.io/library/test-init:v1","csiRegistrarImage":"docker.io/library/test-csi:v1"}}}'

3. DaemonSet updated to custom images:

node-driver-registrar: docker.io/library/test-csi:v1
mount-bpffs: docker.io/library/test-init:v1

4. Remove custom image fields:

kubectl patch config bpfman-config --type=json -p \
  '[{"op":"remove","path":"/spec/daemon/bpffsInitImage"},{"op":"remove","path":"/spec/daemon/csiRegistrarImage"}]'

5. DaemonSet reverted to defaults:

node-driver-registrar: quay.io/bpfman/csi-node-driver-registrar:v2.13.0
mount-bpffs: quay.io/fedora/fedora-minimal:39
  • Unit tests pass
  • CI passes

@frobware frobware force-pushed the configurable-csi-and-findmnt branch from d2ef5b8 to af74b42 Compare December 23, 2025 09:44
Introduce a DaemonSpec struct to hold bpfman daemon configuration,
mirroring the existing AgentSpec pattern. This restructures the Config
API to move image and logLevel fields under spec.daemon, and adds two
new optional fields:

- bpffsInitImage: allows overriding the init container image that
  mounts bpffs (defaults to quay.io/fedora/fedora-minimal:39)
- csiRegistrarImage: allows overriding the CSI node driver registrar
  sidecar image (defaults to quay.io/bpfman/csi-node-driver-registrar)

This enables downstream distributions to substitute alternative base
images (e.g., UBI-based images for OpenShift) via kustomize overlays
without carrying patches to upstream manifests.

Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
Run controller-gen to regenerate deepcopy methods for the new
DaemonSpec type and update the Config CRD schema to reflect the
restructured API with the daemon field.

Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
Update configureBpfmanDs to apply optional image overrides from the
Config CR's daemon spec. When bpffsInitImage or csiRegistrarImage are
specified, the controller uses those values; otherwise it preserves the
defaults from the static daemonset manifest.

Also update reconcileCM to reference logLevel from the new daemon spec
path.

Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
@frobware frobware force-pushed the configurable-csi-and-findmnt branch 2 times, most recently from ba852b7 to 561ee47 Compare December 23, 2025 10:14
Adjust test fixtures to use the restructured Config API, moving image
and logLevel fields under the daemon spec.

Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
Migrate Config CR definitions and kustomize patches to use the new
daemon spec structure, moving image and logLevel fields accordingly.

Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
Update the ClusterServiceVersion and Config CRD bundle manifests to
reflect the restructured API with the daemon spec.

Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
Move Image and LogLevel fields into the Daemon spec in the integration
test fixture to match the restructured Config API.

Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
@frobware frobware force-pushed the configurable-csi-and-findmnt branch from e4bd904 to 1c64776 Compare December 23, 2025 12:07
@frobware frobware requested a review from dave-tucker December 23, 2025 12:19
Test the image override logic in configureBpfmanDs to ensure:
- default images from daemonset.yaml are preserved when optional fields
  are empty
- bpffsInitImage overrides the init container image when set
- csiRegistrarImage overrides the CSI registrar container image when set
- both can be overridden simultaneously

Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
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.

1 participant