ArgoCD Deployments
This tutorial demonstrates how to deploy Platform Applications using ArgoCD for GitOps-based continuous deployment.
If you are using the kubectl deployment approach, we will be working within a single file, so you can skip ahead of this tutorial. However, this is a great resource to come back to when you are ready to setup a production application and transition to a GitOps workflow with ArgoCD.
How It Works
The platform uses ArgoCD to automate deployments:
- Your Application Repository: Contains your source code, application configuration, and a GitHub Actions workflow to trigger image updates in the .platform repository
- The .platform Repository: Stores Kustomize references for your application per environment
- ArgoCD: Watches the .platform repository with an ApplicationSet and automatically deploys any changes to the cluster
The GitHub Action platform-application-manifest-dispatch is used to update the .platform repository with new image digests and configuration whenever you trigger a deployment.
Main Components
Since this tutorial focuses on only deploying a container image, we will be skipping over "building" the image. In a real application, you would typically build and push your container image as part of your CI/CD pipeline.
Application Repository .platform folder
In your application repository, create a .platform folder the structure and example files can be found in the Platform Folder Anatomy documentation.
Since this tutorial will only be deploying to the dev environment, we will not be creating further overlays, but you can add those later as needed.
.platform Repository
The .platform repository in your GitHub organization contains the Kustomize references for your application per environment where each application is deployed. For a more detailed explanation, check out the Platform Repository Anatomy page.
ArgoCD ApplicationSet
The ArgoCD ApplicationSet is configured to watch the .platform repository and automatically deploy any changes to the cluster.
It does this by using a Git generator to scan the .platform repository for application overlays, and creating an ArgoCD Application for each one it finds.
Setup
Now that we've covered the main components and their interactions, let's go talk about what it takes to setup a new repository for deploys.
- Create the '.platform' folder in your application repository and populate it with base configuration and a dev overlay.
- More information on the structure can be found in the Platform Folder Anatomy documentation.
- Add the GitHub Actions workflow to dispatch updates to the .platform repository in your application repository
- More information on the workflow can be found in the Platform Dispatch Action documentation.
- Commit and push the changes to your application repository
- Trigger the GitHub Actions workflow to update the .platform repository (if not triggered automatically on push)
- Update your application repository with more changes as needed.
Check out our ArgoCD Cheat Sheet for tips on interacting with ArgoCD
Next Steps
Now that you understand the ArgoCD workflow, proceed with:
- Basic Deployment - Learn the Platform Application manifest structure
- Ingress Configuration - Expose your application to external traffic
- Configuration Management - Add environment variables
- Secret Injection - Manage sensitive data
Related Documentation
- ArgoCD Documentation - ArgoCD core concepts and usage
- ApplicationSet Documentation - Dynamic application creation
- GitOps Best Practices - GitOps methodology
- GitHub Actions Documentation - Workflow automation
- platform-application-manifest-dispatch - GitHub Action for updating manifests