Skip to content

ci(deploy): reach GKE via Connect Gateway + WIF - #64

Merged
kimo-ice merged 2 commits into
mainfrom
chore/tack-deploy-connect-gateway
Jun 24, 2026
Merged

kimo-ice merged 2 commits into
mainfrom
chore/tack-deploy-connect-gateway

Conversation

@kimo-ice

Copy link
Copy Markdown
Collaborator

Why

The target GKE cluster's public control-plane endpoint is now IP-restricted (master-authorized-networks, security finding C-01). This deploy workflow used get-gke-credentials against the public endpoint from GitHub-hosted runners, which the restriction blocks.

Change

  • get-gke-credentials: add use_connect_gateway: "true" so deploys route through Google's Connect Gateway (not the public endpoint). gha-tack-gke-deployer already has roles/gkehub.gatewayEditor and the cluster is fleet-registered.

Related: WIF migration (B-02)

Repo secrets GCP_WORKLOAD_IDENTITY_PROVIDER + GCP_SERVICE_ACCOUNT are now set; this workflow already prefers WIF over GCP_CREDENTIALS_JSON. The JSON key is kept as a fallback until a deploy confirms WIF works, then the key + secret are removed.

Test plan

  • Trigger a deploy; confirm auth step picks mode=wif and get-gke-credentials succeeds via Connect Gateway.
  • After a green run: remove GCP_CREDENTIALS_JSON secret and delete the gha-tack-gke-deployer key.

🤖 Generated with Claude Code

The target cluster's public control-plane endpoint is now IP-restricted
(master-authorized-networks). Use get-gke-credentials with
use_connect_gateway: true so deploys go through Google's Connect Gateway
proxy. gha-tack-gke-deployer already has roles/gkehub.gatewayEditor and the
cluster is fleet-registered.

Pairs with the move to Workload Identity Federation (GCP_WORKLOAD_IDENTITY_PROVIDER
+ GCP_SERVICE_ACCOUNT secrets now set; GCP_CREDENTIALS_JSON retained as fallback
until WIF is verified).
@kimo-ice
kimo-ice requested a review from ggonzalez94 as a code owner June 24, 2026 16:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39733028fe

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

# the public endpoint. Requires roles/gkehub.gatewayEditor on the SA
# (already granted to gha-tack-gke-deployer) and the cluster registered
# to the fleet.
use_connect_gateway: "true"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Provide the fleet membership or viewer role

With only use_connect_gateway set, google-github-actions/get-gke-credentials@v3 falls back to auto-discovering the fleet membership; its fleet_membership_name input defaults to discovery, and the implementation lists projects/<project>/locations/global/memberships before writing kubeconfig. In the environment documented by this new comment, the deploy SA is only called out as having roles/gkehub.gatewayEditor, which grants membership get but not membership list, so the credentials step will 403 before Helm runs unless the workflow supplies fleet_membership_name or the SA also gets a role such as roles/gkehub.viewer that includes gkehub.memberships.list.

Useful? React with 👍 / 👎.

@kimo-ice

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39733028fe

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

# the public endpoint. Requires roles/gkehub.gatewayEditor on the SA
# (already granted to gha-tack-gke-deployer) and the cluster registered
# to the fleet.
use_connect_gateway: "true"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the Hub viewer permission for gateway discovery

When use_connect_gateway is enabled without fleet_membership_name, get-gke-credentials@v3 auto-discovers the membership by listing GKE Hub memberships; the Connect Gateway setup docs also require roles/gkehub.viewer in addition to a gateway role. The only role documented here is roles/gkehub.gatewayEditor, whose IAM permissions include gkehub.memberships.get but not gkehub.memberships.list, so a deploy SA configured as described will fail in the Get GKE credentials step before Helm runs. Add roles/gkehub.viewer to the deploy SA or pass an explicit fleet_membership_name.

Useful? React with 👍 / 👎.

get-gke-credentials with use_connect_gateway auto-discovers the fleet
membership via gkehub.memberships.list, which gatewayEditor lacks. The SA
has been granted roles/gkehub.viewer to fix the 403; document it.
@kimo-ice

Copy link
Copy Markdown
Collaborator Author

Good catch (P1) — fixed by granting roles/gkehub.viewer to gha-tack-gke-deployer (it now has gatewayEditor + viewer, so gkehub.memberships.list works for membership auto-discovery). Comment updated to document it.

@kimo-ice
kimo-ice merged commit 24a5daf into main Jun 24, 2026
3 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.

1 participant