Skip to content

chore(vm): memory limits on Pod for projects with quotas#2309

Merged
diafour merged 1 commit into
mainfrom
chore/vm/fix-memory-auto-limits-when-resource-quotas-present
May 6, 2026
Merged

chore(vm): memory limits on Pod for projects with quotas#2309
diafour merged 1 commit into
mainfrom
chore/vm/fix-memory-auto-limits-when-resource-quotas-present

Conversation

@diafour
Copy link
Copy Markdown
Member

@diafour diafour commented May 4, 2026

Description

  • Set proper memory limits when Project has quotas.

See also: deckhouse/3p-kubevirt#108

Why do we need it, and what problem does it solve?

Fix regression: kubevirt set increased memory limits after enabling memory hotplug in #2110.

What is the expected result?

Before:

VM:
spec.memory.size: 4096Mi

Pod:
    Labels:    resource-quota-overrides.deckhouse.io/discount-memory=361Mi
    ...					  
    Limits:
      memory:                                         9344909314    <- requests x2
    Requests:
      memory:                                         4672454657

4672454657 == 4456Mi
4096 + 361 = 4457

After:

VM:
spec.memory.size: 4096Mi

Pod:
    Labels:    resource-quota-overrides.deckhouse.io/discount-memory=361Mi
    ...					  
    Limits:
      memory:                                         4672454657    <- equal to requests, as intended
    Requests:
      memory:                                         4672454657

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

@diafour diafour added this to the v1.9.0 milestone May 4, 2026
@diafour diafour force-pushed the chore/vm/fix-memory-auto-limits-when-resource-quotas-present branch 2 times, most recently from 297d267 to 68edad3 Compare May 5, 2026 17:06
@diafour diafour marked this pull request as ready for review May 5, 2026 17:18
@diafour diafour requested review from LopatinDmitr and eofff and removed request for Isteb4k, nevermarine and universal-itengineer May 5, 2026 18:16
- Calculate discount quota from Pod limits.
- Update 3p-kubevirt to fix regressions:
  1) Set proper memory limits when namespace has quotas.
  2) Add 60Mi extra to memory limits when cores fraction is specified.

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
@diafour diafour force-pushed the chore/vm/fix-memory-auto-limits-when-resource-quotas-present branch from 170dfe7 to a0b6ab3 Compare May 6, 2026 13:15
@diafour diafour merged commit 6adacce into main May 6, 2026
26 of 28 checks passed
@diafour diafour deleted the chore/vm/fix-memory-auto-limits-when-resource-quotas-present branch May 6, 2026 13:24
@diafour
Copy link
Copy Markdown
Member Author

diafour commented May 6, 2026

/backport 1.8

@deckhouse-BOaTswain
Copy link
Copy Markdown
Contributor

Failure: cherry-pick commit 6adacce to the branch release-1.8 failed. See Job for details.

diafour added a commit that referenced this pull request May 6, 2026
…2309)

- Calculate discount quota from Pod limits.
- Update 3p-kubevirt to fix regressions:
 1) Set proper memory limits when namespace has quotas.
 2) Add 60Mi extra to memory limits when cores fraction is specified.

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
diafour added a commit that referenced this pull request May 6, 2026
…2309) (#2326)

- Calculate discount quota from Pod limits.
- Update 3p-kubevirt to fix regressions:
 1) Set proper memory limits when namespace has quotas.
 2) Add 60Mi extra to memory limits when cores fraction is specified.

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants