You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Converts the Kubernetes deploy path of this pipeline to keyless credentials (GitHub OIDC -> HashiCorp Vault), retiring the two org admin secrets KUBECONFIG_DEV and KUBECONFIG_PROD. No long-lived kubeconfig is stored in GitHub after this.
The Vault + RBAC backend is already provisioned and verified:
jwt auth mount github-actions, role gha-website (audience https://github.com/SupportTools)
Kubernetes creds path kubernetes-onprem/creds/website mints a 1h token for SA website-ci-deployer, scoped to get/patch only the six ArgoCD Applications supporttools-{mst,dev,qas,tst,stg,prd} in the argocd namespace.
What changed
Applied identically to both K8s deploy jobs (Deploy-NonProd [matrix mst/dev/qas/tst] and Deploy-Prod [matrix stg/prd]):
Added permissions: { contents: read, id-token: write } (mint the GitHub OIDC token).
Replaced the Setup Kubeconfig step that base64-decoded secrets.KUBECONFIG_DEV / secrets.KUBECONFIG_PROD with two steps:
A run: step that mints the short-lived, namespace-scoped Kubernetes token from kubernetes-onprem/creds/website (guards non-empty/!= null, masks it) and builds the kubeconfig file targeting https://kubernetes.default.svc:443 with the in-cluster SA CA.
Removed all secrets.KUBECONFIG_DEV / secrets.KUBECONFIG_PROD references. The same keyless token serves every env (one a1-ops-prd cluster; there is no separate dev cluster).
Removed the Deploy ArgoCD Project step (kubectl apply -f argocd/project.yaml) from both jobs and left a one-line comment: the AppProject is cluster-services-managed, and the scoped token cannot apply AppProjects. All six Applications already exist, so only the patch branch of the deploy block fires.
Downstream deploy + health-poll steps are unchanged — they keep using kubectl --kubeconfig kubeconfig, which now points at the runtime-minted kubeconfig.
runs-on
No change — both deploy jobs were already self-hosted-linux (in-cluster ARC runner in arc-runners-supporttools), which is required for the keyless kubeconfig (in-cluster apiserver + SA CA) to work.
Not touched
The image build/push (Build job, DockerHub supporttools/website, DOCKER_USERNAME/DOCKER_PASSWORD), Helm packaging, and BOT_TOKEN helm-chart push are all left exactly as-is.
on: triggers unchanged (workflow_dispatch, push on main, nightly schedule).
Note
This is a draft PR. After merge, the org admin secrets KUBECONFIG_DEV and KUBECONFIG_PROD can be deleted.
The reason will be displayed to describe this comment to others. Learn more.
Grant create before keeping the bootstrap branch
This kubeconfig is now sourced from the Vault-issued least-privilege token, but the deploy script still treats a missing supporttools-${ENVIRONMENT} Application as recoverable by piping argocd/${ENVIRONMENT}.yaml into kubectl apply below. The new role is scoped for the existing get/patch path, so if one of the six Applications is deleted or a cluster is rebuilt, this branch now fails with an RBAC error instead of recreating it as the old kubeconfig did; the same pattern exists in Deploy-Prod. Either give the token create on those Applications or replace the branch with a clear precondition failure.
Useful? React with 👍 / 👎.
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
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.
Summary
Converts the Kubernetes deploy path of this pipeline to keyless credentials (GitHub OIDC -> HashiCorp Vault), retiring the two org admin secrets
KUBECONFIG_DEVandKUBECONFIG_PROD. No long-lived kubeconfig is stored in GitHub after this.The Vault + RBAC backend is already provisioned and verified:
github-actions, rolegha-website(audiencehttps://github.com/SupportTools)kubernetes-onprem/creds/websitemints a 1h token for SAwebsite-ci-deployer, scoped to get/patch only the six ArgoCD Applicationssupporttools-{mst,dev,qas,tst,stg,prd}in theargocdnamespace.What changed
Applied identically to both K8s deploy jobs (
Deploy-NonProd[matrix mst/dev/qas/tst] andDeploy-Prod[matrix stg/prd]):permissions: { contents: read, id-token: write }(mint the GitHub OIDC token).Setup Kubeconfigstep that base64-decodedsecrets.KUBECONFIG_DEV/secrets.KUBECONFIG_PRODwith two steps:hashicorp/vault-action@v3JWT login (path: github-actions,role: gha-website,jwtGithubAudience: https://github.com/SupportTools,exportToken: true).run:step that mints the short-lived, namespace-scoped Kubernetes token fromkubernetes-onprem/creds/website(guards non-empty/!= null, masks it) and builds thekubeconfigfile targetinghttps://kubernetes.default.svc:443with the in-cluster SA CA.secrets.KUBECONFIG_DEV/secrets.KUBECONFIG_PRODreferences. The same keyless token serves every env (onea1-ops-prdcluster; there is no separate dev cluster).Deploy ArgoCD Projectstep (kubectl apply -f argocd/project.yaml) from both jobs and left a one-line comment: the AppProject is cluster-services-managed, and the scoped token cannot apply AppProjects. All six Applications already exist, so only the patch branch of the deploy block fires.kubectl --kubeconfig kubeconfig, which now points at the runtime-minted kubeconfig.runs-onNo change — both deploy jobs were already
self-hosted-linux(in-cluster ARC runner inarc-runners-supporttools), which is required for the keyless kubeconfig (in-cluster apiserver + SA CA) to work.Not touched
Buildjob, DockerHubsupporttools/website,DOCKER_USERNAME/DOCKER_PASSWORD), Helm packaging, andBOT_TOKENhelm-chart push are all left exactly as-is.on:triggers unchanged (workflow_dispatch,pushonmain, nightlyschedule).Note
This is a draft PR. After merge, the org admin secrets
KUBECONFIG_DEVandKUBECONFIG_PRODcan be deleted.