Skip to content

test: Add e2etests for checking metrics #7915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

jonathan-innis
Copy link
Contributor

Fixes #N/A

Description

Add e2etests for validating that a minimum number of metrics are returned back from Karpenter. This would have prevented the regression that was fixed in #7877.

The testing port-forwards the pods and directly hits their metrics endpoints, parsing the metrics, and ensuring the count of metrics is over a certain amount (which is estimated from the number of instance types/subnets that we support).

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.

@jonathan-innis jonathan-innis requested a review from a team as a code owner March 17, 2025 20:42
@jonathan-innis jonathan-innis requested a review from bwagner5 March 17, 2025 20:42
Copy link

netlify bot commented Mar 17, 2025

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit 8c399f4
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/67d889371b566000087ce38f

Copy link

netlify bot commented Mar 17, 2025

Deploy Preview for karpenter-docs-prod canceled.

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

Copy link
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

@coveralls
Copy link

coveralls commented Mar 17, 2025

Pull Request Test Coverage Report for Build 13934307754

Details

  • 0 of 68 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.5%) to 66.291%

Changes Missing Coverage Covered Lines Changed/Added Lines %
test/pkg/environment/common/expectations.go 0 68 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/providers/instance/instance.go 1 91.97%
Totals Coverage Status
Change from base Build 13934189882: -0.5%
Covered Lines: 6710
Relevant Lines: 10122

💛 - Coveralls

Copy link
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-4a2611c55c8b6e59bc33cca6e86d21b856038eee.
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-4a2611c55c8b6e59bc33cca6e86d21b856038eee" --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 metrics-e2etesting branch 3 times, most recently from 07f54c6 to d7c9b15 Compare March 17, 2025 20:51
Copy link
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

Copy link
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-d7c9b15e66a55ad459b877aea6f3998cc09f8941.
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-d7c9b15e66a55ad459b877aea6f3998cc09f8941" --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 18, 2025 00:17
@jonathan-innis jonathan-innis force-pushed the metrics-e2etesting branch 2 times, most recently from 2c18f7c to f710962 Compare March 18, 2025 21:52
Copy link
Contributor

@jmdeal jmdeal 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 0a8251d into aws:main Mar 18, 2025
19 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.

3 participants