feat(scripts): Add GCP onboarding support - #2269
Merged
Merged
Conversation
jefchien
reviewed
Sep 3, 2026
jefchien
reviewed
Sep 4, 2026
MarcoDN
force-pushed
the
gcp-setup-scripts
branch
from
September 11, 2026 09:43
1aba4de to
c1e1849
Compare
jefchien
reviewed
Sep 15, 2026
MarcoDN
force-pushed
the
gcp-setup-scripts
branch
4 times, most recently
from
September 21, 2026 15:19
3b2cb9b to
c4a337c
Compare
Extends the onboarding scripts to GCE instances (gcp_gce) and GKE clusters (gcp_gke): aws/setup.sh gains the two trust branches (gcp_gce federates accounts.google.com directly, pinning the aud, sub, and oaud condition keys; gcp_gke registers the cluster's OIDC issuer as an IAM OIDC provider), gcp/setup.sh discovers the GCP-side identity and pushes the install, install.sh accepts CWAGENT_CLOUD=gcp, and the dispatcher and README cover the new platforms.
MarcoDN
force-pushed
the
gcp-setup-scripts
branch
from
September 21, 2026 15:36
c4a337c to
0c2b1d2
Compare
jefchien
force-pushed
the
gcp-setup-scripts
branch
from
September 21, 2026 20:28
1fe54ca to
67749e2
Compare
EduVencovsky
approved these changes
Sep 21, 2026
sky333999
approved these changes
Sep 21, 2026
Contributor
Binary Size Reportlinux/amd64
linux/arm64
windows/amd64
Investigating size changesUse go-size-analyzer to compare binaries: GOEXPERIMENT=jsonv2 go install github.com/Zxilly/go-size-analyzer/cmd/gsa@latest
gsa diff --old <baseline-binary> --new <new-binary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the issue
The onboarding setup scripts cover AWS and Azure platforms. The agent now supports GCE (auto-detected host mode) and GKE (
RUN_IN_GKEvia the Helm chart), but there is no scripted onboarding for GCP workloads.Description of changes
Extends the onboarding scripts to GCE VMs (
gcp_gce) and GKE clusters (gcp_gke), mirroring the Azure split:aws/setup.sh:gcp_gcetrust federates the IAM role directly withaccounts.google.com(no OIDC provider resource; Google is a built-in web-identity provider), pinning all three Google condition keys: the service account unique ID (:sub), thests.amazonaws.comaudience (:oaud), and the authorized party (:aud, the unique ID again on service-account tokens) - the trust policy form recommended for Google-issued tokens (AWS Security Blog). The audience condition matches the audience the agent requests for its identity tokens and rejects tokens minted for other services being replayed against STS, mirroring how the Azure trust policies pin their requested audience.gcp_gkeregisters the cluster's OIDC issuer as an IAM OIDC provider and trusts theamazon-cloudwatch/cloudwatch-agentservice account.gcp/setup.sh: new GCP-side script with the two-mode design keyed onCWAGENT_AWS_ROLE_ARN. Identity discovery is read-only: the VM's service account unique ID, or the cluster's OIDC issuer URL (constructed underlocations/for zonal and regional clusters alike). A VM install pushesinstall.shovergcloud compute sshbehind a reachability probe, printing the command when SSH cannot reach the VM. A GKE install runs the CloudWatch Observability Helm chart withk8sMode=GKEwhenhelm,kubectl, andgke-gcloud-auth-pluginare present, printing the commands otherwise.install.sh: acceptsCWAGENT_CLOUD=gcpthrough the same web-identity branch as azure (set-env CWAGENT_ROLE_ARNandAWS_REGION, thenfetch-config -m auto).setup.sh: dispatcher chaingcp/setup.sh(identity) ->aws/setup.sh(trust) ->gcp/setup.sh(install), with the same cross-shell resume flow as Azure.README.md: documents the new platforms and flow.License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
sh -nandshellcheckclean on all touched scripts;make fmt-shclean.GCE Tests
gcp/setup.sh Windows VM
gcp/setup.sh Linux VM
aws/setup.sh GCE
GKE Tests
gcp/setup.sh GKE
aws/setup.sh GKE
Requirements
make fmt-shrun