Skip to content

fix: Create a separate controller for generating availability/pricing metrics#7898

Merged
jonathan-innis merged 1 commit intoaws:mainfrom
jonathan-innis:fix-availability-metrics
Mar 18, 2025
Merged

fix: Create a separate controller for generating availability/pricing metrics#7898
jonathan-innis merged 1 commit intoaws:mainfrom
jonathan-innis:fix-availability-metrics

Conversation

@jonathan-innis
Copy link
Copy Markdown
Contributor

@jonathan-innis jonathan-innis commented Mar 13, 2025

Fixes #7758

Description

This updates our pricing and availability metrics to be generated by a separate controller. This controller polls every minute, pulls all NodePools on the cluster, and unions their results to generate the pricing and availability information globally.

Note that this now means that if no NodePool selects on a specific subnet through their referenced EC2NodeClasses, that that offering will now report as unavailable. Pricing data should be consistent across NodePools and will continue to be reported regardless if the offering is available or not.

How was this change tested?

make presubmit
/karpenter snapshot

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2025

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit 5de23f0
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/67d9c17cf4730e0009cc939c

@jonathan-innis jonathan-innis force-pushed the fix-availability-metrics branch 7 times, most recently from e42e584 to 2636fee Compare March 13, 2025 22:43
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 13, 2025

Pull Request Test Coverage Report for Build 13931262486

Details

  • 64 of 75 (85.33%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 66.74%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controllers/controllers.go 0 1 0.0%
pkg/controllers/metrics/controller.go 44 54 81.48%
Totals Coverage Status
Change from base Build 13930011851: -0.3%
Covered Lines: 6710
Relevant Lines: 10054

💛 - Coveralls

@jonathan-innis jonathan-innis force-pushed the fix-availability-metrics branch 8 times, most recently from 42ac2e5 to 6e85fc4 Compare March 17, 2025 00:43
@jonathan-innis jonathan-innis changed the title fix: Create a separate controller for generating availability metrics fix: Create a separate controller for generating availability/pricing metrics Mar 17, 2025
@jonathan-innis jonathan-innis marked this pull request as ready for review March 17, 2025 00:45
@jonathan-innis jonathan-innis requested a review from a team as a code owner March 17, 2025 00:45
@jonathan-innis jonathan-innis requested a review from bwagner5 March 17, 2025 00:45
@jonathan-innis jonathan-innis force-pushed the fix-availability-metrics branch from 6e85fc4 to c5e1766 Compare March 17, 2025 00:46
Copy link
Copy Markdown
Contributor Author

@jonathan-innis jonathan-innis left a comment

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-c5e1766c957926bb4f20ab1fe2dfe6e96ec65524.
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-c5e1766c957926bb4f20ab1fe2dfe6e96ec65524" --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

@jonathan-innis jonathan-innis force-pushed the fix-availability-metrics branch 2 times, most recently from 0b45f58 to 6e28c43 Compare March 17, 2025 01:04
Copy link
Copy Markdown
Contributor Author

@jonathan-innis jonathan-innis left a comment

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-6e28c43e6700612914332cfd103d14c972b556c4.
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-6e28c43e6700612914332cfd103d14c972b556c4" --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

@jonathan-innis jonathan-innis enabled auto-merge (squash) March 17, 2025 22:46
@jonathan-innis jonathan-innis force-pushed the fix-availability-metrics branch 7 times, most recently from 446236e to 8863fb1 Compare March 18, 2025 17:09
@jonathan-innis jonathan-innis force-pushed the fix-availability-metrics branch 3 times, most recently from 2279bb2 to 2a3ae49 Compare March 18, 2025 18:43
@jonathan-innis jonathan-innis force-pushed the fix-availability-metrics branch from 2a3ae49 to 5de23f0 Compare March 18, 2025 18:54
Copy link
Copy Markdown
Contributor

@rschalo rschalo left a comment

Choose a reason for hiding this comment

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

lgtm

@jonathan-innis jonathan-innis merged commit 173f7a0 into aws:main Mar 18, 2025
17 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.

karpenter_cloudprovider_instance_type_offering_available is returning the wrong data

3 participants