akuity / guestbook-deploy

Deployment manifests for the guestbook app
2 stars 10 forks source link

Guestbook Deploy Repository

Overview

This repository is a reference GitOps deployment repository containing multiple deploy environments. This example utilizes the technique of "rendered YAML branches" for GitOps deployment.

Details

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.

Why this approach?

Advantages:

Disadvantages:

Environments

Environment Status
Dev App Status
Stage App Status
Prod App Status

Configuration Management

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:

Details 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.