Giter Site home page Giter Site logo

shaisrin000 / argo-rollout-canary-sample-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codefresh-contrib/argo-rollout-canary-sample-app

0.0 1.0 0.0 137 KB

Example with Canary deployments for Argo Rollouts and Prometheus

Home Page: https://codefresh.io/docs/docs/ci-cd-guides/progressive-delivery/

License: MIT License

Dockerfile 14.77% Go 78.65% HTML 5.63% CSS 0.96%

argo-rollout-canary-sample-app's Introduction

Example Canary Deployment with Argo rollouts and Codefresh

This is an example Go application that exposes Prometheus metrics. It is compiled using Codefresh.

Graphana Dashboard

Original code modified from https://gabrieltanner.org/blog/collecting-prometheus-metrics-in-golang

How to build

Run:

  • go build to get the executable OR
  • docker build . -t example-app to create a container image if you prefer docker instead or don't have access to a Go dev environment

How to run the application on its own

  • go run . OR
  • docker run -p 8080:8080 example-app

Then visit http://localhost:8080 or http://localhost:8080/metrics

To use with Argo Rollouts

To install the controller

kubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts -f https://raw.githubusercontent.com/argoproj/argo-rollouts/stable/manifests/install.yaml

To create the first deployment

kubectl create ns canary
kubectl apply -f ./canary-manual-approval -n canary

To monitor the status

kubectl argo rollouts get rollout golang-sample-app-deployment --watch -n canary

To create a new color

kubectl argo rollouts set image golang-sample-app-deployment golang-sample-app-container=kostiscodefresh/argo-rollouts-canary-sample-app:9c7732e -n canary

To promote the color

kubectl argo rollouts promote golang-sample-app-deployment -n canary

To reject or undo the deployment

kubectl argo rollouts abort canary-sample-app-deployment -n canary
kubectl argo rollouts undo canary-sample-app-deployment -n canary

To get the IP and port of the preview service

kubectl get svc  rollout-canary-preview -n canary -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
kubectl get svc  rollout-canary-preview -n canary -o jsonpath='{.spec.ports[0].port}'

To use this project in Codefresh

There is also a codefresh.yaml for easy usage with the Codefresh CI/CD platform.

More details can be found in Codefresh documentation

You can also import graphana/graphana-dashboard.json as a premade dashboard

Enjoy!

argo-rollout-canary-sample-app's People

Contributors

kostis-codefresh avatar

Watchers

James Cloos 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.