Sitelet https://github.com/kubernetes/kops/pull/18537
Skip to content

Expose GCP project as PROJECT env for ClusterLoader2 on GCE - #18537

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes:masterfrom
rifelpet:gce-set-project-env-for-cl2
Jul 5, 2026
Merged

kubernetes-prow[bot] merged 1 commit into
kubernetes:masterfrom
rifelpet:gce-set-project-env-for-cl2

Conversation

@rifelpet

@rifelpet rifelpet commented Jul 5, 2026

Copy link
Copy Markdown
Member

What

In the kubetest2-kops deployer, export PROJECT alongside GCP_PROJECT (both from d.GCPProject) when running the test command on GCE.

Why

ClusterLoader2's managed Prometheus client (clusterloader2/pkg/prometheus/clients/gcp_managed.go) reads the GCP project from the PROJECT env var to build the Cloud Monitoring query URL:

uri: fmt.Sprintf("https://monitoring.googleapis.com/v1/projects/%s/location/global/prometheus/api/v1/query", os.Getenv("PROJECT"))

The deployer only exported GCP_PROJECT, so for scalability jobs that enable the "Quotas total usage" measurement (via preset-e2e-scalability-common's CL2_ENABLE_QUOTAS_USAGE_MEASUREMENT=true) the query URL had an empty project and Cloud Monitoring rejected it with HTTP 400 INVALID_ARGUMENT, failing the load test.

Setting PROJECT in the deployer (rather than in run-test.sh) is required because these jobs acquire their project from boskos, so GCP_PROJECT is empty at scenario start — d.GCPProject is where the resolved project value is guaranteed populated.

Failing job

ci-kubernetes-kops-gce-small-scale-kindnet-using-cl2 fails on the Quotas total usage measurement:

https://prow.k8s.io/view/gs/kubernetes-ci-logs/logs/ci-kubernetes-kops-gce-small-scale-kindnet-using-cl2/2073413226502033408

E0704 15:04:51 prometheus_measurement.go:112] Quotas total usage gathering error:
  query error: response failed with status code 400 [body: {"status": "INVALID_ARGUMENT"}]

ClusterLoader2's managed Prometheus client
(clusterloader2/pkg/prometheus/clients/gcp_managed.go) reads the GCP
project from the PROJECT env var to build the Cloud Monitoring query
URL. The kubetest2-kops deployer only exported GCP_PROJECT, so for
scalability jobs that enable the "Quotas total usage" measurement
(via preset-e2e-scalability-common's CL2_ENABLE_QUOTAS_USAGE_MEASUREMENT)
the query URL had an empty project and Cloud Monitoring rejected it
with HTTP 400 INVALID_ARGUMENT, failing the load test.

Also export PROJECT alongside GCP_PROJECT so the measurement can query
the correct project. This is set from d.GCPProject, which is populated
even when the project is acquired from boskos.
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubernetes-prow kubernetes-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 5, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from olemarkus and zetaab July 5, 2026 02:42
@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 5, 2026
@rifelpet

rifelpet commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

/test pull-kops-gce-master-scale-kindnet-performance-100

@rifelpet
rifelpet marked this pull request as ready for review July 5, 2026 10:06
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 5, 2026
@rifelpet

rifelpet commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

/cc @hakman

@kubernetes-prow
kubernetes-prow Bot requested a review from hakman July 5, 2026 10:07
@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 5, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

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

The pull request process is described here

Details 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

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 5, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit b855a65 into kubernetes:master Jul 5, 2026
28 checks passed
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. 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.

2 participants