Complete specification of Concourse CI charm relations and interfaces
Relations connect Concourse CI units to external services (PostgreSQL, Prometheus) and coordinate between Concourse components (web servers and workers). The Concourse CI Machine Charm defines three relation types: requires (consumes data), provides (exposes data), and peers (coordinates between units).
juju integrate <app1>:<endpoint1> <app2>:<endpoint2> (Juju 3.x) or juju relate (Juju 2.x).
| Relation Name | Type | Interface | Status | Applied To |
|---|---|---|---|---|
postgresql |
requires | postgresql_client |
Required | Web server units |
monitoring |
provides | prometheus_scrape |
Optional | All units |
tsa |
provides | concourse-ci_tsa |
Optional | Web server units |
flight |
requires | concourse-ci_tsa |
Optional | Worker units |
vault-kv |
requires | vault-kv |
Optional | Web server units |
peers |
peer | concourse-ci_peers |
Automatic | All units (same app) |
Description: Provides PostgreSQL database backend for the Concourse web server. Stores pipelines, build metadata, resource versions, and authentication data. Uses Juju secrets API for secure credential management.
Supported PostgreSQL Versions:
postgresql_client interface with Juju secrets supportData Exchanged:
Usage Example:
# Deploy PostgreSQL 16
juju deploy postgresql --channel 16/stable --base ubuntu@24.04
# Deploy Concourse CI
juju deploy concourse-ci-machine concourse-ci --config mode=auto
# Integrate
juju integrate concourse-ci:postgresql postgresql:database
mode=worker) do not require this relation.
Related Configuration: None (credentials managed automatically via relation)
Troubleshooting:
postgresql relation is established and PostgreSQL is readyjuju debug-log --include postgresql) and network connectivityDescription: Exposes Prometheus metrics endpoints for monitoring Concourse CI performance, resource usage, and job statistics. Enables integration with Prometheus and Grafana for observability.
Metrics Endpoints:
enable-metrics=true and concourse-exporter is installed)Data Exchanged:
Usage Example:
# Enable metrics in Concourse
juju config concourse-ci enable-metrics=true
# Deploy Prometheus
juju deploy prometheus-machine prometheus
# Integrate monitoring relation
juju integrate concourse-ci:monitoring prometheus:target
# Access Prometheus UI and query Concourse metrics
# Example PromQL: concourse_jobs_running{team="main"}
Available Metrics (Port 9391):
concourse_builds_*: Build counts, durations, statusesconcourse_workers_*: Worker states, container countsconcourse_db_*: Database connection pool metricsconcourse_steps_*: Pipeline step execution metricsconcourse_http_*: Web server HTTP request metricsAvailable Metrics (Port 9358, requires concourse-exporter):
concourse_job_status: Per-job status (succeeded, failed, errored)concourse_job_last_build_duration: Last build duration per jobRelated Configuration: enable-metrics (boolean, default: false)
enable-metrics. The configuration option controls concourse-exporter installation (port 9358).
Description: Provides TSA (Transportation Security Administration) endpoint for worker registration. TSA is the SSH-based gateway that workers connect to for authenticating and registering with the Concourse web server. Used when deploying separate web and worker applications (mode=web + mode=worker).
Data Exchanged:
Usage Example:
# Deploy web server
juju deploy concourse-ci-machine web --config mode=web
# Deploy workers
juju deploy concourse-ci-machine worker -n 2 --config mode=worker
# Integrate web TSA endpoint with workers
juju integrate web:tsa worker:flight
mode=auto deployments, where TSA keys are distributed via peer relations automatically.
Related Configuration: None (TSA port and keys managed automatically)
Description: Consumes TSA endpoint from web server to retrieve TSA keys and connection details. Worker units use this relation to authenticate and register with the web server's TSA gateway.
Data Exchanged:
Usage Example:
# Workers require TSA endpoint from web server
juju integrate worker:flight web:tsa
mode=worker will enter Blocked status without this relation. Workers cannot function without connecting to a web server's TSA.
Related Configuration: None (worker keys and TSA connection managed automatically)
Description: Connects the Concourse web server to HashiCorp Vault for pipeline credential management. When established, Concourse automatically resolves ((secret-name)) variable references in pipelines by looking them up in the Vault KV store. Credentials are provisioned via AppRole authentication.
Compatible Providers:
vault charm (2.0/stable — ubuntu@24.04)Data Exchanged:
charm-web-concourse (provided by Vault)role-id and role-secret-id (provided by Vault)concourse (provided by requirer)Effect on Concourse Config: When the relation is ready, the following environment variables are written to config.env on the web unit:
CONCOURSE_VAULT_URLCONCOURSE_VAULT_AUTH_BACKEND=approleCONCOURSE_VAULT_AUTH_PARAM=role_id:...,secret_id:...CONCOURSE_VAULT_CA_CERT (written to /etc/concourse/vault-ca.pem)CONCOURSE_VAULT_PATH_PREFIX=/charm-web-concourseIntegration Example:
# Deploy and integrate
juju deploy vault --channel 2.0/stable
juju integrate vault:vault-kv web:vault-kv
# Initialize Vault (save unseal key and root token)
juju ssh vault/leader -- vault operator init -key-shares=1 -key-threshold=1 -format=json
# Unseal
juju ssh vault/leader -- vault operator unseal <unseal-key>
# Authorize the charm
juju add-secret vault-root-token token="<root-token>"
juju grant-secret vault-root-token vault
juju run vault/leader authorize-charm secret-id=<secret-id> --wait 2m
# Verify
juju ssh web/0 -- sudo grep VAULT /var/lib/concourse/config.env
vault-url charm config option when both are set. See the Vault How-To Guide for the complete setup procedure.
Troubleshooting:
| Message | Cause | Solution |
|---|---|---|
| vault blocked "Please initialize Vault" | Vault not initialized | Run vault operator init and vault operator unseal |
| VAULT vars missing from config.env | Charm not authorized | Run juju run vault/leader authorize-charm |
| Pipelines fail with "credential not found" | Secret not in correct KV path | Write secrets to charm-web-concourse/<team>/<pipeline>/<name> |
Description: Automatically coordinates data between units in the same application. Used in mode=auto deployments to distribute TSA keys, worker keys, and admin password across all units. No manual configuration required—Juju creates this relation automatically.
Data Exchanged:
Usage: Automatic—no manual action required.
mode=auto deployments. Workers automatically receive TSA keys from the leader and register without manual SSH key copying.
Related Configuration: None (peer coordination is automatic)
| Relation | mode=auto (leader) | mode=auto (follower) | mode=web | mode=worker |
|---|---|---|---|---|
postgresql |
✅ Required | ❌ N/A | ✅ Required | ❌ N/A |
monitoring |
✅ Optional | ✅ Optional | ✅ Optional | ✅ Optional |
tsa (provides) |
✅ Available | ❌ N/A | ✅ Available | ❌ N/A |
flight (requires) |
❌ N/A | ✅ Auto-connected | ❌ N/A | ✅ Required |
vault-kv |
✅ Optional | ❌ N/A | ✅ Optional | ❌ N/A |
peers |
✅ Automatic | ✅ Automatic | ✅ Automatic | ✅ Automatic |
# Deploy with auto mode (peer relation handles key distribution)
juju deploy concourse-ci-machine concourse-ci -n 3 --config mode=auto
juju integrate concourse-ci:postgresql postgresql:database
juju integrate concourse-ci:monitoring prometheus:target
# All TSA keys distributed automatically via peers relation ✨
# Deploy web and workers as separate apps
juju deploy concourse-ci-machine web --config mode=web
juju deploy concourse-ci-machine worker -n 2 --config mode=worker
# Required relations
juju integrate web:postgresql postgresql:database
juju integrate web:tsa worker:flight # Key exchange between apps
# Optional monitoring
juju integrate web:monitoring prometheus:target
juju integrate worker:monitoring prometheus:target
# Deploy web server
juju deploy concourse-ci-machine web --config mode=web
# Deploy GPU workers
juju deploy concourse-ci-machine gpu-worker \
--config mode=worker \
--config compute-runtime=cuda \
--config tag="cuda,gpu"
# Deploy CPU workers
juju deploy concourse-ci-machine cpu-worker -n 2 \
--config mode=worker \
--config tag="cpu,high-mem"
# Integrate all applications
juju integrate web:postgresql postgresql:database
juju integrate web:tsa gpu-worker:flight
juju integrate web:tsa cpu-worker:flight
juju integrate web:monitoring prometheus:target
juju integrate gpu-worker:monitoring prometheus:target
juju integrate cpu-worker:monitoring prometheus:target
# Deploy web, workers, and Vault
juju deploy concourse-ci-machine web --config mode=web
juju deploy concourse-ci-machine worker -n 2 --config mode=worker
juju deploy vault --channel 2.0/stable
# Wire up relations
juju integrate web:postgresql postgresql:database
juju integrate web:tsa worker:flight
juju integrate vault:vault-kv web:vault-kv
# Initialize and unseal Vault, then authorize the charm
# (see howto/use-vault.html for full procedure)
| Message | Cause | Solution |
|---|---|---|
| "Database not connected" | Web server missing postgresql relation |
juju integrate <app>:postgresql postgresql:database |
| "TSA endpoint not available" | Worker missing flight relation |
juju integrate <worker>:flight <web>:tsa |
| "Waiting for peer relation" | Peer relation not established (rare) | Wait for Juju to establish peer relation (automatic) |
# View all relations for an application
juju status --relations
# View specific relation status
juju show-unit concourse-ci/0 | grep -A 5 "relation-info"
# Debug relation data (for charm developers)
juju run concourse-ci/0 -- relation-get -r <relation-id> - <remote-unit>
# Remove a relation
juju remove-relation concourse-ci:monitoring prometheus:target
# Re-establish if needed
juju integrate concourse-ci:monitoring prometheus:target
postgresql relation from a web server will cause the web service to stop and enter Blocked status. Pipelines and build data remain in the database and will be restored when the relation is re-established.