Giter Site home page Giter Site logo

kargo-advanced's Introduction

Kargo Advanced Example

This is a GitOps repository of an Kargo example that showcases advanced Kargo techniques and features. This example will create multiple Argo CD Applications and Kargo Stages with a pipeline to progress both git and images changes through multiple Stages.

Features

  • A Warehouse which monitors both a container repository for new images and manifest changes in git
  • Stage deploy pipeline with A/B testing
  • Git + Image tag promotion
  • Verification with analysis of an HTTP REST endpoint
  • Argo CD Application Syncing
  • Control Flow Stage to coordinate promotion to multiple Stages
  • Rendered Branches

Requirements

  • Kargo v0.5 (for older Kargo versions, switch to the release-X.Y branch)
  • Argo CD instance
  • GitHub git and container repository

Instructions

  1. Fork this repo, then clone it locally (from your fork).
  2. Run the personalize.sh to customize the manifests to use your GitHub username and Argo CD destination.
./personalize.sh
  1. git commit the personalized changes
git commit -a -m "personalize manifests"
git push
  1. Create a guestbook container image repository in your GitHub account.

The easiest way to create a new ghcr.io image repository, is by retagging/pushing an existing image with your github username:

docker buildx imagetools create \
    ghcr.io/akuity/guestbook:latest \
    -t ghcr.io/<yourgithubusername>/guestbook:v0.0.1

You will now have a guestbook container image repository. e.g.:

https://github.com/yourgithubusername/guestbook/pkgs/container/guestbook

  1. Change guestbook container image repository to public.

In the GitHub UI, navigate to the "guestbook" container repository, Package settings, and change the visibility of the package to public. This will allow Kargo to monitor this repository for new images, without requiring you to configuring Kargo with container image repository credentials.

change-package-visibility

  1. Download and install the latest CLI from Kargo Releases and Argo CD:
./download-cli.sh /usr/local/bin/kargo
  1. Login to Kargo and Argo CD
kargo login https://<kargo-url> --admin
argocd login <argocd-hostname>
  1. Create the Argo CD guestbook Project and Applications
argocd proj create -f ./argocd/appproj.yaml
argocd appset create ./argocd/appset.yaml
  1. Create the Kargo resources
kargo apply -f ./kargo
  1. Add git repository credentials to Kargo (replace <yourgithubusername> with your username).
kargo create credentials github-creds \
    --project kargo-advanced \
    --git \
    --username <yourgithubusername> \
    --repo-url https://github.com/<yourgithubusername>/kargo-advanced.git

As part of the promotion process, Kargo requires privileges to commit changes to your git repository, as well as the ability to create pull requests. Ensure that the given token has these privileges.

  1. Promote the image!

You now have a Kargo Pipeline which promotes images from the guestbook container image repository, through a multi-stage deploy pipeline. Visit the kargo-advanced Project in the Kargo UI to see the deploy pipeline.

pipeline

To promote, click the target icon to the left of the dev Stage, select the detected Freight, and click Yes to promote. Once promoted, the freight will be qualified to be promoted to downstream Stages (staging, prod).

Simulating a release

To simulate a release, simply retag an image with a newer semantic version. e.g.:

docker buildx imagetools create \
    ghcr.io/akuity/guestbook:latest \
    -t ghcr.io/<yourgithubusername>/guestbook:v0.0.2

Then refresh the Warehouse in the UI to detect the new Freight.

Promoting Manifest Changes

To promote a manifest change, edit the contents under the base directory. For example, you modify guestbook-deploy.yaml with an additional environment variable.

        env:
        - name: FOO
          value: bar

Kargo will promote the environment variable in the same manner as with image tags.

kargo-advanced's People

Contributors

jessesuen avatar vojtechmares 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.