Repository navigation
Conversation
Add gcp_secret_manager as a second vault type next to azure_key_vault, so the controller and listener can read GitHub App or PAT credentials from Google Cloud Secret Manager instead of a Kubernetes Secret. Authentication uses Application Default Credentials (Workload Identity Federation on GKE). - vault/gcpsecretmanager: Secret Manager REST client with CRC32C verification and not-found detection - API: VaultConfig.GCPSecretManager (projectId, version); CRDs regenerated - secret resolver, listener config and resource builder wiring - return an error instead of panicking when a vault type is set without its provider config - gha-runner-scale-set and gha-runner-scale-set-experimental chart support and tests Closes actions#4737
mnacharov
requested review from
a team,
Steve-Glass,
mumoshu,
nikola-jokic,
rentziass and
toast-gear
as code owners
November 18, 2026 12:44
This branch has not been deployed
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.
Closes #4737
This PR adds Google Cloud Secret Manager as a second vault type for
gha-runner-scale-set, alongsideazure_key_vault(#4090). The controller and listener can read GitHub App or PAT credentials from Secret Manager, so the credentials never have to be stored in a Kubernetes Secret.The scope matches #4090: proxy credentials, the listener configuration and runner JIT tokens stay in Kubernetes Secrets. Only the GitHub credentials move to the vault.
Configuration
In the experimental chart, set
secretResolution.type: gcpSecretManagerandsecretResolution.gcpSecretManager.projectId.auth.secretNameis the secret ID.The secret payload uses the same JSON format as Azure Key Vault and is parsed by the existing
appconfig.FromJSONString. It contains eithergithub_app_id,github_app_installation_idandgithub_app_private_key, orgithub_token.Authentication uses Google Application Default Credentials. On GKE this means Workload Identity Federation: grant the controller and listener Kubernetes ServiceAccounts
roles/secretmanager.secretAccessoron the secret. No key files or certificates are mounted. Outside GKE, a credentials file referenced byGOOGLE_APPLICATION_CREDENTIALSworks.Changes
vault/gcpsecretmanager(new). Implementsvault.Vaultusing the Secret Manager REST client.projects/{projectId}/secrets/{name}/versions/{version}.IsNotFoundreports only 404 /NOT_FOUNDas not found, so permission and quota errors are still retried.keyVault.proxyapplies to Secret Manager traffic. Token acquisition (for example from the GKE metadata server) is not proxied.vault. NewVaultTypeGCPSecretManagerconstant.VaultConfig.GCPSecretManager(projectId,version). CRDs regenerated.wrapAzureKeyVaultErroris renamed towrapVaultErrorand also maps GCP not-found errors toErrNotFound.gha-runner-scale-setandgha-runner-scale-set-experimental. Both charts fail to render whenprojectIdis missing.Small fixes found along the way:
azure_key_vaulttoo.keyVaultexample incharts/gha-runner-scale-set/values.yamlused snake_case keys (client_id,tenant_id, …) that the template never read. It now uses the camelCase keys the template expects.Dependencies
This adds
cloud.google.com/go/secretmanagerv1.24.0. It pulls ingoogle.golang.org/api, gRPC, genproto and OpenTelemetry as indirect dependencies, including a pseudo-version ofcloud.google.com/go/auth. Only the REST transport is used at runtime.Testing
vault/gcpsecretmanager:httptestSecret Manager endpoint.Read()tests: missing provider config, invalid config, and dispatch to the GCP client.go test -short ./controllers/actions.github.com/... ./cmd/... ./vault/... ./apis/...passes with envtest, andhelm unittestpasses for the experimental chart.golangci-lint was not run locally;
gofmtandgo vetare clean.Live testing
Tested end to end on a GKE cluster with images and charts built from this branch (commit f40b632):
roles/secretmanager.secretAccessoron the secret for the controller namespace's principalSet. No Google service account and no key files.gha-runner-scale-setreleases in separate namespaces share one Secret Manager secret holding the GitHub App credentials. Both listeners start, register their scale sets, and workflow jobs run to completion.One gotcha found while testing: in the JSON payload,
github_app_installation_idmust be a JSON number. A quoted value fails withjson: cannot unmarshal string into Go struct field AppConfig.github_app_installation_id of type int64. This is existingappconfig.FromJSONStringbehaviour, shared withazure_key_vault. In a Kubernetes Secret the same field is a string, so it's easy to copy it over quoted.Out of scope / possible follow-ups
actions/scalesetalready providesSignerJWTProvider/NewClientWithJWTProviderfor this. That would be a separate change to GitHub auth, not to secret resolution.