Git Product home page Git Product logo

guestbook-deploy's Introduction

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:

  • Easily understandable change history/diff - change is not obfuscated by config tooling
  • Use different policies per environment - e.g. automated commit/deployment to dev/stage, PR approval process and protected branch for prod
  • Upgrading Argo CD + baked-in toolchain (kustomize) is no longer a risk - templating done in CI, not by Argo CD
  • Better security - No longer at risk from vulnerabilities in tooling (helm, kustomize)
  • Safer change management - Change to a kustomize base will not immediately affect all environments
  • Improved Argo CD performance - expensive templating process (kustomize build) is no longer performed by Argo CD

Disadvantages:

  • Additional CI automation requirements (e.g. GitHub action)
  • Does not support tools which render plain-text secrets (e.g. Kustomize + SOPS)

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:

  • For the env/dev and env/stage branches, the change will be automatically pushed to the environment branch resulting in immediate deployment
  • For the env/prod branch, a PR will be created against the branch for manual approval

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.

guestbook-deploy's People

Contributors

jessesuen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.