How alphagov/paas-cf works
Main Components and Their Roles
• Concourse Pipelines: Under the “concourse” directory are many YAML pipeline definitions and scripts that drive the deployment tasks (e.g. “create-cloudfoundry.yml”, various tasks, and supporting scripts). These pipelines handle the orchestration of deployments and various operational jobs.
• Terraform Configurations: The “terraform” directory contains configurations for provisioning AWS infrastructure (networks, load balancers, databases, security groups, and VPC peering, among others). This is a key component that interacts with AWS services.
• BOSH Manifests and CF Deployment: The “manifests” directory holds different pieces of the Cloud Foundry deployment – notably “cf-manifest” for BOSH manifest generation (including custom operations) and “prometheus” manifests for monitoring setup.
• Configuration Files and Templates: The “config” directories (for billing, logit, etc.) provide configuration templates and scripts for dynamic configuration generation.
• Tools and Tests: The “tools”, “common-go”, and “platform-tests” directories include supporting tools (for buildpack emails, metrics exporters, etc.) and a suite of automated tests to validate deployments.
• Utility Scripts: There is an abundance of scripts for managing secrets, updating buildpacks, and handling other operational tasks found in the “scripts” directory.
Relationships and Interactions Between Components
• The Concourse pipelines are the “orchestrator” that invoke tasks in other components. For instance:
– A pipeline (found in concourse/pipelines) can trigger Terraform runs for provisioning AWS resources.
– After infrastructure provisioning, pipelines run BOSH deployment jobs and then interact with the “manifests” that define the Cloud Foundry deployment.
• Concourse jobs also run utility scripts and tests (found under “platform-tests”, “tools”, and “scripts”) to validate configuration, perform health checks, and update auxiliary services.
• Terraform is responsible for managing the AWS environment (networks, load balancers, RDS, etc.), which is then used by the BOSH and CF deployment processes.
• The configuration directories (like “config/billing” or “config/logit”) feed into manifest generation steps, often executed by Concourse tasks to produce environment-specific configuration.
• In addition, integration with external tools (e.g., GDS CLI, CredHub, cf CLI) enables secure access and secret management, which in turn influence pipeline operations.
Architectural Patterns and Design Principles
• Separation of Concerns: Different directories are clearly responsible for distinct areas such as infrastructure provisioning (Terraform), deployment configuration (manifests), orchestration (Concourse pipelines), and testing (platform-tests and specs).
• Infrastructure as Code: The heavy use of Terraform and declarative manifest templates shows adherence to immutable, reproducible configurations.
• Pipeline-driven Automation: Modular Concourse pipelines are used to tie together provisioning, configuration, and testing.
• Extensibility: The “tools” and “scripts” directories provide smaller, targeted utilities that can be extended as needed.
Specific Elements
• Concourse (pipeline definitions, tasks, scripts)
• Terraform (infrastructure provisioning to AWS resources: VPC, Load Balancers, Databases, IAM, DNS)
• BOSH/Manifests (CF-manifest for Cloud Foundry deployment, including operations customizations)
• Tools & Utility Scripts (e.g., billing configuration generator, metrics exporter, buildpacks updater)
• External Systems (AWS services, CredHub, Github authentication, cf CLI, and GDS CLI)
• From Concourse to Terraform (to trigger provisioning) and then from Terraform to AWS.
• From Concourse to BOSH, indicating that after infrastructure is provisioned the manifest generated from “manifests” is pushed to the BOSH director.
• From Concourse to utility scripts/tests to indicate running of tests and updates.
• External integrations to the Concourse system (authentication, CLI commands, etc.).