Repository navigation
Reach the e2e GKE cluster through the Connect gateway - #850
wallrj-cyberark wants to merge 1 commit into
Conversation
- The CI project's org policy now also forbids the DNS-based control-plane endpoint (custom.disableGkeDnsEndpoint), so cluster creation fails. - Register the cluster to the project's fleet and fetch credentials for the Connect gateway instead. The control plane keeps no public IP and no DNS endpoint, which the policy allows. Co-Authored-By: Claude <[email protected]> Signed-off-by: Richard Wall <[email protected]>
|
The gcloud services enable gkehub.googleapis.com connectgateway.googleapis.com \
--project machineidentitysecurity-jsci-e
gcloud projects add-iam-policy-binding machineidentitysecurity-jsci-e \
--member serviceAccount:gke-cluster-creation@machineidentitysecurity-jsci-e.iam.gserviceaccount.com \
--role roles/gkehub.admin
gcloud projects add-iam-policy-binding machineidentitysecurity-jsci-e \
--member serviceAccount:gke-cluster-creation@machineidentitysecurity-jsci-e.iam.gserviceaccount.com \
--role roles/gkehub.gatewayEditorThe role bindings may already be covered by the account's existing roles. The run has not got far enough to tell. After that, re-run the We will not know whether the org policy accepts this cluster until the API is enabled. GKE checks the fleet first. Error from run 39775167645https://github.com/jetstack/jetstack-secure/actions/runs/39775167645/job/119812147262 |
4c32bf1 to
139191c
Compare
|
Thanks for enabling the API. The re-run got further, but cluster creation now fails on a third org policy, and only an org policy admin can fix it: A GKE cluster with a private control plane reaches it through a Private Service Connect endpoint in our VPC. That endpoint points at a service attachment in a Google-owned GKE project (346361970074 here). The policy does not allow that producer, so GKE cannot create the endpoint. This policy is also new. The nightlies created clusters with the same Please ask whoever owns the org policies to let this project create PSC endpoints to GKE's producer. That can be an exception for What I tried that did not work
|
The nightly GKE e2e test fails because the CI project now forbids the DNS-based control-plane endpoint that #845 relies on. This PR reaches the cluster through the Connect gateway instead.
What is broken
Since the 2026-10-21 nightly,
gcloud container clusters createinhack/e2e/test.shfails with:The 2026-10-20 nightly passed on the same commit, so the policy is new. Failing run: https://github.com/jetstack/jetstack-secure/actions/runs/39709299106/job/119596540932
The project now forbids all three ways a GitHub-hosted runner could reach the API server directly: public nodes, a public control-plane IP and the DNS endpoint.
What this changes
--enable-fleetinstead of--enable-dns-access. This registers it as a fleet membership in the same project.gcloud container fleet memberships get-credentials, sokubectlandhelmgo through the Connect gateway. Access is authorised with IAM.The script uses no
exec,port-forwardorattach, which the gateway may not support.kubectl logs --followandkubectl waitare plain streaming requests.What might still need doing in the project
I could not test this before pushing: I do not have access to the CI project. If the
test-e2erun fails, the likely causes are:gkehub.googleapis.com,connectgateway.googleapis.com) are not enabled.gke-cluster-creationservice account lacksroles/gkehub.admin(to register the cluster) orroles/gkehub.gatewayEditorandroles/gkehub.viewer(to use the gateway).The run log will say which. Someone with project admin rights will then need to grant it.
Testing
The
test-e2elabel on this PR runs the GKE job. I will link the result here.[with Claude]