fix(cneinstance): render TMM resources block in sriov mode - #55
Merged
Merged
Conversation
When tmm_data_plane_mode=sriov (DPU/BlueField), the CNEInstance template skipped the entire advanced.tmm.resources block. FLO received an incomplete TMM spec and generated a DaemonSet with empty resource name keys: DaemonSet.apps 'f5-tmm' is invalid: spec.template.spec.containers[0].resources.limits[]: Invalid value: : name part must be non-empty Add an else branch so sriov mode also produces concrete memory limits (default 4Gi). Declare tmm_memory in variables.tf so it can be overridden as a module input. Scope: - bnk/cneinstance/manifests/cneinstance.yaml — sriov resources block - bnk/cneinstance/variables.tf — tmm_memory variable declaration
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
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.
Problem
When
tmm_data_plane_mode=sriov(DPU/BlueField deployments), the CNEInstance template skips the entireadvanced.tmm.resourcesblock. FLO receives an incomplete TMM spec and generates a DaemonSet with empty resource name keys:Root Cause
The template only rendered resources inside
{% if _is_kernel_mode %}. When sriov mode was active (_is_kernel_mode = false), thetmm:section hadenv:but no resources block. FLO's internal sizing logic tried to inject SR-IOV device resources but had no base resources to merge with, generating empty keys.Fix
Added an
{% else %}block that renders a valid resources block for sriov mode (4Gi memory, no PCI env vars). Both code paths now always produce concrete memory limits.Also declared
tmm_memoryinvariables.tf— the variable was referenced in the template via Jinja defaults but had no Terraform declaration, making it impossible to override as a module input.Scope
bnk/cneinstance/manifests/cneinstance.yaml— 7 lines added (sriov resources block)bnk/cneinstance/variables.tf— 12 lines added (tmm_memory variable declaration with validation)Testing
tmm_data_plane_mode=kernel): unchanged, still renders 6Gi resources + Multus annotationstmm_data_plane_mode=sriov): now renders 4Gi resources (overridable viatmm_memory)tmm_memoryhas validation: must be valid K8s quantity (e.g., 4Gi, 8192Mi)