Cluster Repository Setup¶
After generating your cluster configuration with launchpad_create_cluster and deploying the infrastructure, you need to configure the cluster repository for GitHub Actions and ArgoCD. This guide walks through secrets, environment variables, workflows, and ArgoCD repository connection.
Overview¶
The cluster repository contains:
- Terraform infrastructure code
- Instance configurations (
instances/<name>/) - GitHub Actions workflows for instance lifecycle and image builds
To use these workflows and allow ArgoCD to sync from the repository, you must:
- Push the repository to GitHub
- Configure GitHub Actions secrets
- Set up the ArgoCD project and connect the repository
Pushing the Repository to GitHub¶
The launchpad_create_cluster command initializes a git repository and adds a remote. Complete the setup:
-
Create an empty repository in your GitHub organization (e.g.
your-org/launchpad-production-cluster). -
Push the cluster repository:
cd launchpad-production-cluster
git push -u origin main
Configuring GitHub Actions Secrets¶
Workflows read sensitive values from repository secrets. Configure them before running Create Instance, Build, or Delete Instance workflows.
Where to Add Secrets¶
- Open your cluster repository on GitHub.
- Go to Settings -> Secrets and variables -> Actions.
- Click New repository secret.
- Enter the Name and Value for each secret.
Required Secrets¶
| Secret | Required for | Description |
|---|---|---|
TERRAFORM_SECRETS |
Create Instance, Delete Instance | HCL content for secrets.auto.tfvars (see below) |
LAUNCHPAD_DOCKER_REGISTRY_CREDENTIALS |
Create Instance | Base64-encoded username:token for pulling images |
LAUNCHPAD_MYSQL_HOST |
Create Instance, Delete Instance | MySQL server hostname |
LAUNCHPAD_MYSQL_PORT |
Create Instance, Delete Instance | MySQL port (default: 3306) |
LAUNCHPAD_MYSQL_ROOT_USER |
Create Instance, Delete Instance | MySQL admin username |
LAUNCHPAD_MYSQL_ROOT_PASSWORD |
Create Instance, Delete Instance | MySQL admin password |
LAUNCHPAD_MYSQL_PROVIDER |
Delete Instance | MySQL deprovision provider: direct_sql or digitalocean_api |
LAUNCHPAD_MYSQL_CLUSTER_ID |
Delete Instance | DigitalOcean MySQL cluster UUID (required when provider is digitalocean_api) |
LAUNCHPAD_MONGODB_HOST |
Create Instance, Delete Instance | MongoDB hostname. On AWS and UpCloud, the Atlas SRV address from output mongodb_host. |
LAUNCHPAD_MONGODB_PORT |
Create Instance, Delete Instance | MongoDB port (default: 27017) |
LAUNCHPAD_MONGODB_PROVIDER |
Create Instance, Delete Instance | digitalocean_api or atlas |
LAUNCHPAD_MONGODB_CLUSTER_ID |
Create Instance, Delete Instance | DigitalOcean MongoDB cluster ID. Required only when LAUNCHPAD_MONGODB_PROVIDER=digitalocean_api. |
LAUNCHPAD_MONGODB_REPLICA_SET |
Create Instance, Delete Instance | MongoDB replica set name |
LAUNCHPAD_MONGODB_AUTH_SOURCE |
Create Instance, Delete Instance | MongoDB auth source (default: admin) |
LAUNCHPAD_DIGITALOCEAN_TOKEN |
Create Instance, Delete Instance | DigitalOcean API token for provider-managed database cleanup. Leave empty on UpCloud. |
LAUNCHPAD_ATLAS_PUBLIC_KEY |
Create Instance, Delete Instance | Atlas public API key. Required when LAUNCHPAD_MONGODB_PROVIDER=atlas. |
LAUNCHPAD_ATLAS_PRIVATE_KEY |
Create Instance, Delete Instance | Atlas private API key. Required when LAUNCHPAD_MONGODB_PROVIDER=atlas. |
LAUNCHPAD_ATLAS_PROJECT_ID |
Create Instance, Delete Instance | Atlas project ID. AWS and UpCloud Terraform output atlas_project_id. |
LAUNCHPAD_ATLAS_CLUSTER_NAME |
Create Instance, Delete Instance | Atlas cluster name. AWS and UpCloud Terraform output atlas_cluster_name. |
LAUNCHPAD_STORAGE_TYPE |
Create Instance, Delete Instance | s3 or spaces. UpCloud uses s3 with LAUNCHPAD_STORAGE_HOST. |
LAUNCHPAD_STORAGE_REGION |
Create Instance, Delete Instance | Region written to S3_REGION. UpCloud uses the object storage region, for example us-1, not the zone. |
LAUNCHPAD_STORAGE_HOST |
Create Instance, Delete Instance | Optional S3 hostname. Set to Terraform output object_storage_endpoint_hostname for UpCloud. |
LAUNCHPAD_STORAGE_ACCESS_KEY_ID |
Create Instance, Delete Instance | Written to OPENEDX_AWS_ACCESS_KEY (also used by bucket workflows) |
LAUNCHPAD_STORAGE_SECRET_ACCESS_KEY |
Create Instance, Delete Instance | Written to OPENEDX_AWS_SECRET_ACCESS_KEY |
TERRAFORM_BACKEND_CONFIG |
Create Instance, Delete Instance | Optional backend.hcl contents. Required for UpCloud, whose state endpoint is not in the Terraform files. |
SSH_PRIVATE_KEY |
Create Instance, Build, Build All, Delete Instance, Update Instance | Private SSH key for cloning the cluster repo and private dependencies |
Storage secrets seed tutor-contrib-s3 config
LAUNCHPAD_STORAGE_* populate Tutor S3_* / OPENEDX_AWS_* keys in the instance config.yml at create time. After that, those Tutor keys are the source of truth for Open edX and for bucket create/delete (provider is Spaces when S3_HOST contains digitaloceanspaces.com). Set LAUNCHPAD_STORAGE_HOST to the Managed Object Storage hostname on UpCloud. Bucket workflows use --endpoint-url whenever S3_HOST is set, and they skip versioning and public-bucket API calls for that endpoint. See Object Storage.
TERRAFORM_SECRETS Format¶
TERRAFORM_SECRETS is the exact content that would go in infrastructure/secrets.auto.tfvars. The workflow writes it to that file for Terraform/OpenTofu.
DigitalOcean:
access_token = "dop_v1_your_digitalocean_token"
access_key_id = "your_spaces_access_key_id"
secret_access_key = "your_spaces_secret_access_key"
AWS:
aws_access_key_id = "AKIA..."
aws_secret_access_key = "your_aws_secret_key"
atlas_public_key = "atlas-public-key"
atlas_private_key = "atlas-private-key"
Set atlas_project_id in infrastructure/config.tf. It is not a credential.
atlas_cidr_block in config.tf is the Atlas network container (192.168.248.0/21) and must not overlap the VPC (10.0.0.0/16). The Atlas region is the AWS region with hyphens replaced by underscores and uppercased, so us-east-1 becomes US_EAST_1. Peering adds that CIDR to the VPC private route tables. MySQL is Amazon RDS. Deprovision uses LAUNCHPAD_MYSQL_PROVIDER=direct_sql with mysql_host, mysql_port, mysql_root_user, and mysql_root_password. MongoDB uses LAUNCHPAD_MONGODB_PROVIDER=atlas. LAUNCHPAD_MONGODB_HOST is the Atlas SRV address from output mongodb_host. LAUNCHPAD_ATLAS_CLUSTER_NAME is output atlas_cluster_name, and LAUNCHPAD_ATLAS_PROJECT_ID is output atlas_project_id. The same AWS keys are used for Velero, so they must be allowed to use the backup bucket and its KMS key. kubeconfig_content contains a short-lived EKS token from the AWS provider. Run tofu apply again to refresh it. It expires after about 15 minutes.
UpCloud:
upcloud_token = "your-upcloud-token"
upcloud_autoscaler_token = "your-token-for-autoscaling"
atlas_public_key = "atlas-public-key"
atlas_private_key = "atlas-private-key"
Set atlas_project_id in infrastructure/config.tf. atlas_region_name follows the zone: US_EAST_1 for US zones, EU_CENTRAL_1 for European zones, AP_SOUTHEAST_2 for au-syd1, and AP_SOUTHEAST_1 for sg-sin1.
Zone us-nyc1 uses object storage region us-1. Zone de-fra1 uses europe-1. Set object_storage_region_override in config.tf to europe-2 or europe-3 to override that European default. European zones use Atlas region EU_CENTRAL_1. MySQL deprovision uses LAUNCHPAD_MYSQL_PROVIDER=direct_sql with the MySQL host, port, and root credentials from Terraform outputs. MongoDB uses LAUNCHPAD_MONGODB_PROVIDER=atlas. LAUNCHPAD_MONGODB_CLUSTER_ID is only for digitalocean_api. LAUNCHPAD_MONGODB_HOST is the Atlas SRV address from output mongodb_host. LAUNCHPAD_ATLAS_CLUSTER_NAME is output atlas_cluster_name, and LAUNCHPAD_ATLAS_PROJECT_ID is output atlas_project_id.
UpCloud tofu init in GitHub Actions reads TERRAFORM_BACKEND_CONFIG. Store the same backend.hcl contents there, including endpoints.s3, bucket, region, access_key, and secret_key. The state bucket must exist before the first init.
Generating Common Secrets¶
Docker registry credentials (for LAUNCHPAD_DOCKER_REGISTRY_CREDENTIALS):
# GitHub Container Registry
echo -n "github_username:ghp_your_personal_access_token" | base64
# Docker Hub
echo -n "dockerhub_username:dockerhub_token" | base64
Use a GitHub PAT with read:packages for GHCR.
SSH private key (for SSH_PRIVATE_KEY):
# Generate a new deploy key (if you don't have one)
ssh-keygen -t ed25519 -C "github-actions-deploy" -f deploy_key -N ""
# Add deploy_key.pub as a Deploy Key in your repo (Settings -> Deploy keys)
# Paste the contents of deploy_key (private key) as the SSH_PRIVATE_KEY secret
cat deploy_key
The same key is used for cloning the cluster repository and any private dependencies (e.g. edx-platform forks, Tutor plugins).
GitHub Actions Workflows¶
The cluster repository includes reusable workflows that you trigger manually.
Workflow Overview¶
| Workflow | Trigger | Purpose |
|---|---|---|
| Create Instance | Manual (workflow_dispatch) | Creates a new instance: config, provision workflows, ArgoCD Application |
| Build Image | Manual | Builds a single service image (openedx or mfe) for an instance |
| Build All Images | Manual | Builds both openedx and mfe images for an instance |
| Delete Instance | Manual | Removes an instance and runs deprovision workflows |
| Update Instance | Manual | Merges JSON config into an instance's config.yml |
| pre-commit | On push/PR | Runs linting and formatting |
How to Trigger Workflows¶
- Open your cluster repository on GitHub.
- Go to the Actions tab.
- Select the workflow from the left sidebar (e.g. "Create Instance").
- Click Run workflow.
- Fill in the inputs and run.
Common Workflow Inputs¶
| Input | Workflows | Description |
|---|---|---|
| INSTANCE_NAME | Create, Build, Build All, Delete, Update | Instance identifier (DNS-compliant, e.g. my-instance) |
| STRAIN_REPOSITORY_BRANCH | Build, Build All | Branch to use for the strain (default: main). The strain is the cluster repo; this is the branch containing instances/<name>/ |
| SERVICE | Build | Service to build: openedx or mfe |
| LAUNCHPAD_CLI_VERSION | Create, Build, Build All, Delete | Git ref (branch/tag/SHA) of launchpad-cluster-template for the CLI (default: main) |
| RUNNER_WORKFLOW_LABEL | All | GitHub Actions runner label (default: ubuntu-latest). Use self-hosted for self-hosted runners |
| PICASSO_VERSION | Build, Build All | Git ref of Picasso for image builds |
| LAUNCHPAD_OPENCRAFT_MANIFESTS_VERSION | Delete | Git ref for OpenCraft manifests (default: main) |
| EDX_PLATFORM_VERSION | Create | edX Platform branch/tag (default: release/ulmo) |
| TUTOR_VERSION | Create | Tutor version (default from cluster template) |
| INSTANCE_TEMPLATE_VERSION | Create | Instance template version (default: main) |
| CONFIG | Update | JSON object to merge into instance config (e.g. {"KEY": "value"}) |
Strain and Repository¶
The strain is the cluster repository itself. The branch (STRAIN_REPOSITORY_BRANCH) determines which branch of the cluster repo is used when building images. For instance my-instance, the build uses instances/my-instance/ from that branch.
ArgoCD Project and Repository Connection¶
ArgoCD must be able to clone the cluster repository to sync applications. Configure it after installing ArgoCD and Argo Workflows.
Step 1: Create or Use the Default Project¶
ArgoCD applications use a project (e.g. launchpad-production). The default project may already exist. To create one:
- Log into the ArgoCD UI.
- Go to Settings -> Projects.
- Create a project or use the default.
Step 2: Connect the Repository¶
- In ArgoCD, go to Settings -> Repositories.
- Click Connect Repo.
- Choose the connection method:
GitHub (SSH Deploy Key)¶
- Connection method: Via SSH
- Repository URL:
git@github.com:your-org/launchpad-production-cluster.git - SSH private key: Paste the private key (same content as
SSH_PRIVATE_KEYif you use it for GitHub Actions)
To add the SSH key to GitHub as a Deploy Key:
- Go to your cluster repo -> Settings -> Deploy keys.
- Add the public key (
.pubfile).
For read-only access, you can create a deploy key with only clone permission. For write access (e.g. if ArgoCD writes back), enable write access.
GitHub (HTTPS with Personal Access Token)¶
- Connection method: Via HTTPS
- Repository URL:
https://github.com/your-org/launchpad-production-cluster.git - Username: Your GitHub username (or
x-access-tokenfor fine-grained PATs) - Password: GitHub Personal Access Token with
reposcope
Step 3: Verify Connection¶
After adding the repository, ArgoCD should show it as connected. Applications that reference this repo will be able to sync.
Step 4: Project Configuration¶
Ensure the project allows the repository:
- Go to Settings -> Projects -> your project.
- Under Source Repositories, add your cluster repository URL.
- Under Destinations, add the cluster (e.g.
https://kubernetes.default.svc).
Related Documentation¶
- Infrastructure Provisioning - Cluster creation and ArgoCD installation
- Instance Provisioning - Creating instances
- Instance Configuration - config.yml, object storage, and manifests
- Object Storage - Bucket provisioning vs Tutor S3 plugins
- Instance Docker Images - Building images with Picasso