Skip to content

fix(cneinstance): render TMM resources block in sriov mode - #55

Merged
JLCode-tech merged 1 commit into
release/2.2from
fix/cneinstance-sriov-dataplane
Apr 30, 2026
Merged

JLCode-tech merged 1 commit into
release/2.2from
fix/cneinstance-sriov-dataplane

Conversation

@bonnyr-f5

Copy link
Copy Markdown
Collaborator

Problem

When tmm_data_plane_mode=sriov (DPU/BlueField deployments), the CNEInstance template skips the entire advanced.tmm.resources block. FLO receives an incomplete TMM spec and generates 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

Root Cause

The template only rendered resources inside {% if _is_kernel_mode %}. When sriov mode was active (_is_kernel_mode = false), the tmm: section had env: 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_memory in variables.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

  • Kernel mode (tmm_data_plane_mode=kernel): unchanged, still renders 6Gi resources + Multus annotations
  • Sriov mode (tmm_data_plane_mode=sriov): now renders 4Gi resources (overridable via tmm_memory)
  • tmm_memory has validation: must be valid K8s quantity (e.g., 4Gi, 8192Mi)

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
@JLCode-tech
JLCode-tech merged commit f050dee into release/2.2 Apr 30, 2026
2 checks passed
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.

2 participants