This repository is a reference GitOps deployment repository containing multiple deploy environments. This example utilizes the technique of "rendered YAML branches" for GitOps deployment.
The technique of using "rendered YAML branches" removes the responsibility of config templating from Argo CD, to the CI/CD pipeline. In this example, a GitHub Action automates the config management templating (e.g. kustomize build
) such that fully rendered Kubernetes manifests are outputted to an environment specific branch (e.g. env/stage
, env/prod
). Argo CD applications are configured to deploy the manifests from the environment branch, as opposed to a directory in the main
branch.
The application source repository is located at https://github.com/akuity/guestbook and has a CI/CD Pipeline which builds new container images and automatically commits the new image tags to the kustomize environments contained in this repository.
Environment | Status |
---|---|
Dev | |
Stage | |
Prod |
This respository utilizes kustomize for configuration management of multiple environments. A common kustomize base is shared between all environments. Environments are organized into individual env
directories, structured in the following manner:
.
├── base
│ ├── guestbook-deploy.yaml
│ ├── guestbook-ing.yaml
│ ├── guestbook-svc.yaml
│ └── kustomization.yaml
└── env
├── dev
│ └── kustomization.yaml
├── prod
│ └── kustomization.yaml
└── stage
└── kustomization.yaml
Any changes to the kustomize configuration in main
branch will result in the following:
env/dev
and env/stage
branches, the change will be automatically pushed to the environment branch resulting in immediate deploymentenv/prod
branch, a PR will be created against the branch for manual approvalDetails of how this is accomplished can be seen in the GitHub Action.
The source code for this repository is located at https://github.com/akuity/guestbook-deploy.