Skip to content

Conversation

@tallaxes
Copy link
Collaborator

@tallaxes tallaxes commented Dec 25, 2025

Description

Add an integration test that validates Karpenter correctly schedules pods with ZRS (Zone Redundant Storage) persistent volumes when the pod targets a specific zone.

This test validates the fix in kubernetes-sigs/karpenter#2743 which ensures Karpenter considers ALL PV node affinity terms during scheduling, not just the first one. ZRS disks are accessible in all zones of a region, so the PV node affinity includes multiple zone terms. Without the fix, pods targeting zone 2 would fail because only the first zone term was considered.

Changes:

  • Add ZRS PV multi-zone scheduling test with VolumeBindingImmediate StorageClass
  • Verify pod with zone 2 node selector schedules correctly on a zone 2 node
  • Add EventuallyExpectPVCBound() helper function

Note: This PR references tallaxes/[email protected] which contains the fix for considering all PV node affinity terms during scheduling. This dependency will need to be updated when kubernetes-sigs/karpenter#2743 lands in core.

How was this change tested?

Does this change impact docs?

  • No

Release Note

@tallaxes tallaxes marked this pull request as draft December 25, 2025 05:44
@tallaxes tallaxes self-assigned this Dec 26, 2025
- add test validating pod with ZRS PV schedules correctly in zone 2
- add SupportsZones() method to skip test in non-zonal regions
- add EventuallyExpectPVCBound() helper function
- integrate zone provider in test environment
@tallaxes tallaxes force-pushed the tallaxes/e2e-multi-zone-pv branch from 60e8a55 to 9e6cb45 Compare December 26, 2025 22:07
@tallaxes tallaxes changed the base branch from main to tallaxes/e2e/storage December 26, 2025 22:08
@tallaxes tallaxes added area/storage Issues or PRs related to storage area/e2e-testing labels Dec 26, 2025
@tallaxes tallaxes force-pushed the tallaxes/e2e-multi-zone-pv branch from 9e6cb45 to 6b393df Compare December 26, 2025 22:33
@tallaxes tallaxes changed the title test(integration): add ZRS PV multi-zone scheduling test test(e2e): add ZRS PV multi-zone scheduling test Dec 26, 2025
@tallaxes tallaxes marked this pull request as ready for review December 31, 2025 00:24
@tallaxes tallaxes marked this pull request as draft December 31, 2025 00:26
sigs.k8s.io/karpenter v1.6.2
)

replace sigs.k8s.io/karpenter => github.com/tallaxes/karpenter-core v0.0.0-20251221063144-7863910ee631
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont forget to remove before merge.

// considers ALL PV node affinity terms (not just the first), we intentionally
// schedule the pod in zone 2. Without the sigs.k8s.io/karpenter fix, this would fail
// because the scheduler only looked at the first zone.
zone2 := utils.MakeAKSLabelZoneFromARMZone(env.Region, zones[1])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it guaranteed that zones is always either len 0 or len 2? It can't be len 1?

If it's length 1, we'd get here and panic

@tallaxes tallaxes added area/core Issues related with karpenter-core/upstream area/test Issues or PRs related to testing labels Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related with karpenter-core/upstream area/storage Issues or PRs related to storage area/test Issues or PRs related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants