Skip to content

backport [release-v1.11.x]: feat: expose subnet refresh interval as configurable setting (#9150) - #9521

Open
DerekFrank wants to merge 2 commits into
aws:release-v1.11.xfrom
DerekFrank:backport-9150-subnet-refresh-1.11
Open

backport [release-v1.11.x]: feat: expose subnet refresh interval as configurable setting (#9150)#9521
DerekFrank wants to merge 2 commits into
aws:release-v1.11.xfrom
DerekFrank:backport-9150-subnet-refresh-1.11

Conversation

@DerekFrank

@DerekFrank DerekFrank commented Aug 19, 2026

Copy link
Copy Markdown
Member

Backport of #9150 onto `release-v1.11.x`.

Adds `SUBNET_REFRESH_INTERVAL` (`--subnet-refresh-interval`, default `1m`) to control how often Karpenter refreshes subnet data from EC2, letting operators running large fleets in shared accounts reduce DescribeSubnets API call volume by accepting longer subnet staleness. All three subnet provider caches (subnet list, available IP counts, public IP association) are populated from a single DescribeSubnets response — the list cache uses the interval directly; the IP / public-IP caches use `max(interval, original TTL)`.

Backport notes

Cherry-picked from commit `01c0508c8d2c91f744a115fa69c8ecc03d3a37d2`. Conflicts resolved against 1.11:

  • 1.11 does not contain `amiRefreshInterval` or `enableZonalShift` (both landed on `main` after 1.11 was cut), so only the `subnetRefreshInterval` additions were kept.
  • Added the `time` import to `options.go`, `options_validation.go`, `test/options.go`, and `suite_test.go` (in `main` these files already imported `time` via the AMI-refresh feature).

Testing

  • `go build ./...` (affected pkgs + `./cmd/...`) ✅
  • `go vet` on affected pkgs ✅
  • `go test ./pkg/operator/options/...` ✅

Adds SUBNET_REFRESH_INTERVAL (--subnet-refresh-interval, default 1m)
to control how often Karpenter refreshes subnet data from EC2. This
allows operators running large fleets in shared accounts to reduce
DescribeSubnets API call volume by accepting longer subnet staleness.

All three subnet provider caches (subnet list, available IP counts,
and public IP association) use the same interval since they are all
populated from a single DescribeSubnets response.
(cherry picked from commit 01c0508)
Backport of aws#9150 onto release-v1.11.x (subnetRefreshInterval only; amiRefreshInterval/enableZonalShift not present in 1.11).
@DerekFrank
DerekFrank requested a review from a team as a code owner August 19, 2026 22:00

@DerekFrank DerekFrank left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions

Copy link
Copy Markdown
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-ac4264efeb52af83a3fd7af74c69bc3256c2f386.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-ac4264efeb52af83a3fd7af74c69bc3256c2f386" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Adds SECURITY_GROUP_REFRESH_INTERVAL (--security-group-refresh-interval,
default 1m) to control how often Karpenter refreshes security group data
from EC2, mirroring the subnet-refresh-interval knob. Operators running
large fleets in shared accounts can raise this to reduce
DescribeSecurityGroups API call volume by accepting longer staleness.

The security group provider uses a single cache; its TTL is now driven by
the configured interval instead of the fixed DefaultTTL. Validated >= 1m.

Companion to the subnet-refresh-interval backport (aws#9150) on release-v1.11.x.

@DerekFrank DerekFrank left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions

Copy link
Copy Markdown
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-6c67fa2acdb1325601a04e1d143417e9e7d3a00a.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-6c67fa2acdb1325601a04e1d143417e9e7d3a00a" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

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