Skip to content
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

fix: BREAKING put karpenter_ignored_pod_count metric under scheduler subsystem #2015

Merged

Conversation

olegy2008
Copy link
Contributor

Fixes #1992

Description
Put karpenter_ignored_pod_count metric under scheduler subsystem, new metric name is: karpenter_scheduler_ignored_pod_count.

How was this change tested?
1 . Made temporary changes:

diff --git a/Makefile b/Makefile
index 3029f80..ffe428d 100644
--- a/Makefile
+++ b/Makefile
@@ -67,13 +67,11 @@ delete: ## Delete the controller from your ~/.kube/config cluster
 	helm uninstall karpenter --namespace $(KARPENTER_NAMESPACE)
 
 test: ## Run tests
-	go test ./pkg/... \
+	go test ./pkg/controllers/provisioning \
 		-race \
 		-timeout 20m \
-		--ginkgo.focus="${FOCUS}" \
 		--ginkgo.randomize-all \
-		--ginkgo.v \
-		-cover -coverprofile=coverage.out -outputdir=. -coverpkg=./...
+		--ginkgo.v
 
 deflake: ## Run randomized, racing tests until the test fails to catch flakes
 	ginkgo \
diff --git a/pkg/controllers/provisioning/suite_test.go b/pkg/controllers/provisioning/suite_test.go
index 1174ef9..46d34a7 100644
--- a/pkg/controllers/provisioning/suite_test.go
+++ b/pkg/controllers/provisioning/suite_test.go
@@ -1631,7 +1631,7 @@ var _ = Describe("Provisioning", func() {
 		BeforeEach(func() {
 			storageClass = test.StorageClass(test.StorageClassOptions{Zones: []string{"test-zone-2", "test-zone-3"}})
 		})
-		It("should not schedule if invalid pvc", func() {
+		FIt("should not schedule if invalid pvc", func() {
 			ExpectApplied(ctx, env.Client, test.NodePool())
 			pod := test.UnschedulablePod(test.PodOptions{
 				PersistentVolumeClaims: []string{"invalid"},
diff --git a/pkg/test/expectations/expectations.go b/pkg/test/expectations/expectations.go
index 060ec78..b459422 100644
--- a/pkg/test/expectations/expectations.go
+++ b/pkg/test/expectations/expectations.go
@@ -567,6 +567,7 @@ func FindMetricWithLabelValues(name string, labelValues map[string]string) (*pro
 func ExpectMetricGaugeValue(collector opmetrics.GaugeMetric, expectedValue float64, labels map[string]string) {
 	GinkgoHelper()
 	metricName := ExpectMetricName(collector.(*opmetrics.PrometheusGauge))
+	fmt.Println("metricName is:", metricName)
 	metric, ok := FindMetricWithLabelValues(metricName, labels)
 	Expect(ok).To(BeTrue(), "Metric "+metricName+" should be available")
 	Expect(lo.FromPtr(metric.Gauge.Value)).To(Equal(expectedValue), "Metric "+metricName+" should have the expected value")
  1. Executed:
make test
  1. Result (truncated):
metricName is: karpenter_scheduler_ignored_pod_count

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

Copy link

linux-foundation-easycla bot commented Feb 20, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Feb 20, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @olegy2008!

It looks like this is your first PR to kubernetes-sigs/karpenter 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/karpenter has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @olegy2008. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 20, 2025
@coveralls
Copy link

coveralls commented Feb 20, 2025

Pull Request Test Coverage Report for Build 13447868904

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 81.388%

Files with Coverage Reduction New Missed Lines %
pkg/controllers/provisioning/scheduling/nodeclaim.go 3 86.98%
Totals Coverage Status
Change from base Build 13443153828: 0.1%
Covered Lines: 9253
Relevant Lines: 11369

💛 - Coveralls

Copy link
Member

@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.

Thanks for contributing! Just one comment!

@jonathan-innis jonathan-innis changed the title fix: put karpenter_ignored_pod_count metric under scheduler subsystem BREAKING: put karpenter_ignored_pod_count metric under scheduler subsystem Feb 21, 2025
@jonathan-innis
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 21, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jonathan-innis, olegy2008

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 21, 2025
@jonathan-innis jonathan-innis changed the title BREAKING: put karpenter_ignored_pod_count metric under scheduler subsystem fix: BREAKING put karpenter_ignored_pod_count metric under scheduler subsystem Feb 21, 2025
@k8s-ci-robot k8s-ci-robot merged commit afbc15b into kubernetes-sigs:main Feb 21, 2025
15 of 16 checks passed
@olegy2008 olegy2008 deleted the update-ignored-pod-count-subsystem branch February 21, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

karpenter_ignored_pod_count is not put under a subsystem
4 participants