-
Notifications
You must be signed in to change notification settings - Fork 24
Add configurable daemon images to Config API #488
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
Open
frobware
wants to merge
8
commits into
bpfman:main
Choose a base branch
from
frobware:configurable-csi-and-findmnt
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d2ef5b8 to
af74b42
Compare
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>
ba852b7 to
561ee47
Compare
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>
e4bd904 to
1c64776
Compare
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>
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
DaemonSpecstruct mirroring the existingAgentSpecpatternimageandlogLevelfromspectospec.daemonspec.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
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):
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:
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: