Deploying code is the process of pushing code to an Astro Private Cloud (APC) Deployment. A code deploy can include an entire Astro project as a Docker image, or just the Dags in your project. APC supports several methods for deploying code to a Deployment:Documentation Index
Fetch the complete documentation index at: https://astronomer-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Deploy project images or Dags only using the Astro CLI
- Deploy Dags using an NFS volume
- Deploy Dags using Git sync
Deployment methods comparison
| Method | Use Case | Downtime | Dependencies | Requirements |
|---|---|---|---|---|
| CLI - Full Image | Production deployments with OS dependencies | Brief restart | Supports all | Docker, CLI |
| CLI - Dag Only | Quick Dag updates | None | Dags only | Docker, CLI |
| NFS Volume | Shared filesystem environments | None | Dags only | NFS server |
| Git Sync | GitOps workflows | None | Dags only | Git repository |
Astro CLI deploys
Full image deploy
By default, deploy code by building it into a Docker image and pushing to the Astronomer Registry using the CLI. This mechanism builds your Dags into a Docker image alongside all other files in your Astro project directory:- Python packages (
requirements.txt) - OS-level packages (
packages.txt) - Dockerfile customizations
- Plugins and include files
astro deploy, your project is rebuilt into a new image and containers are restarted.
When to use
- Python or OS dependency updates
- Custom Dockerfile modifications
- Initial deployment setup
- Major version changes
Dag-only deploy
For faster iteration, enable Dag-only deploys to deploy just yourdags directory without rebuilding the Docker image.
When to use
- Frequent Dag changes
- No dependency changes
- Development workflows
- Quick fixes
You still need Docker access to authenticate to APC before deploying Dags.
NFS volume-based Dag deploys
For teams deploying Dag changes frequently, APC supports NFS volume-based Dag deploys. Using this mechanism, deploy Dags by adding Python files to a shared filesystem on your network. Compared to image-based deploys, NFS enables:- Zero downtime deployments
- Continuous deployment workflows
- Shared Dag storage across environments
When to use
- Enterprise environments with existing NFS infrastructure
- High-frequency Dag updates
- Shared Dag development across teams
Requirements
- NFS server accessible from Kubernetes cluster
- Platform-level configuration enabled
- Read access for UID/GID 50000
Git-sync Dag deploys
For Git-based workflows, APC supports git-sync deployments. Configure a Git repository to sync with your Deployment. When you push changes to the repository, Dags automatically sync with no downtime.Sync modes
- Polling: Periodically checks for changes (default: every 60 seconds)
- Webhook: Triggers sync on push events
When to use
- GitOps deployment workflows
- Version-controlled Dag management
- CI/CD pipeline integration
- Branch-based deployment strategies
Choose a deployment method
Decision tree
Combine methods
You can combine deployment methods:- Use CLI Full Image for dependency updates
- Use CLI Dag-Only for quick Dag iterations
- Use Git Sync for automated production deployments
NFS and Git Sync are mutually exclusive with CLI deploys for the same Deployment. Once configured, a Deployment uses only that mechanism.
CI/CD integration
All deployment methods integrate with CI/CD pipelines:| Method | CI/CD Approach |
|---|---|
| CLI Full Image | astro deploy in pipeline |
| CLI Dag-Only | astro deploy --dags in pipeline |
| NFS Volume | Copy files to NFS mount |
| Git Sync | Push to configured branch |