π How to Deploy Secrets#
Deploying secrets to your GitOps repo is straightforward! Hereβs how to do it manually with a GitHub Actions workflow.
1. ποΈ Manual Deployment#
This workflow generates deployment files (CRs) for secrets based on a tenant and environment you provide. It updates your GitOps repo (watched by ArgoCD) on the deployment branch.
π€ Automatic Deployment (Auto-generate Deployments)#
This workflow automatically creates a deployment pull-request when changes are merged to the main branch in this repository. It scans for changes in kubernetes/** and automatically launches the deployment generation workflow if changes are detected.
Permissions:
contents: write: Needed to clone the repository.actions: write: Needed to execute the other workflows in the repository.
1.1 π How to Use The Manual Workflow#
Update Values
- Go to your repoβs main/master branch.
- Edit the “values” files (e.g., in
secrets/<tenant>/<environment>/secret.yaml) with the desired changes. - Create a PR, wait for the
PR Verifycompletion β and merge it intomain/master. - Example secrets claim:
--- kind: SecretsClaim lifeciycle: production system: test version: 1.0 providers: external_secrets: pushSecrets: # This array generates a PushSecret per item # The push secret will create a secret into the key vault (azure) # or parameter store (aws) - secretName: my-postgres # you can set the 'refreshInterval' to null in case # you donΒ΄t want to refresh the secret value in the key vault # or parameter store (aws) refreshInterval: null generator: # Points to a generator custom resource, # see: https://external-secrets.io/latest/api/generator/password/ name: pg-generator externalSecrets: # Filling the key 'externalSecrets', a ExternalSecret will be created, # and the system will access to the key vault (azure) or parameter store (aws), # and create a secret into the kubernetes cluster # that can be referenced from the TFWorkspaceClaim refreshInterval: 10m secrets: - secretName: rds_conn - secretName: my_test
Head to Your Repo
- Go to the “Actions” tab on GitHub.
Locate the Workflow
- Find
Generate secrets deploymentin the list.
- Find
Launch It
- Click “Run workflow”.
- Fill in:
tenant(e.g.,customer1).environment(e.g.,prod).
- Hit “Run workflow” to start.
1.2 π What You Get#
- Updated Repo: New deployment files (CRs) for secrets land in a PR against the
deploymentbranch. - Summary: Check the workflow logs on GitHub for details.
- Deploy: Merge the PR, and ArgoCD will sync the secrets to your system.
1.3 π οΈ Troubleshooting#
- Fails? Check the logs or summary in GitHub Actions. Verify your
tenantandenvironmentinputs. - No PR? Ensure the inputs match a valid secrets path (e.g.,
secrets/customer1/prod).
π Quick Tip#
- Use this workflow to manually deploy secrets for a specific tenant and environment. Once the PR is merged, ArgoCD handles the rest!