Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Example with Canary deployments for Argo Rollouts and Prometheus

License

NotificationsYou must be signed in to change notification settings

codefresh-contrib/argo-rollout-canary-sample-app

Repository files navigation

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

Graphana Dashboard

Original code modified fromhttps://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 visithttp://localhost:8080 orhttp://localhost:8080/metrics

To use with Argo Rollouts

To install the controller

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

To create the first deployment

kubectl create ns canarykubectl 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 canarykubectl 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 acodefresh.yaml for easy usage with theCodefresh CI/CD platform.

More details can be found inCodefresh documentation

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

Enjoy!

About

Example with Canary deployments for Argo Rollouts and Prometheus

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp