{"id":17927155,"url":"https://github.com/kostis-codefresh/argo-rollouts-stateful-example","last_synced_at":"2025-04-11T04:10:55.984Z","repository":{"id":211068564,"uuid":"718720072","full_name":"kostis-codefresh/argo-rollouts-stateful-example","owner":"kostis-codefresh","description":"Using the the Kubernetes Downward API with Argo Rollouts for stateful workloads.","archived":false,"fork":false,"pushed_at":"2024-06-28T13:39:21.000Z","size":86,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T02:13:41.833Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kostis-codefresh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-14T16:59:42.000Z","updated_at":"2025-01-28T19:34:38.000Z","dependencies_parsed_at":"2023-12-20T13:15:42.560Z","dependency_job_id":"088bb6ef-f2ad-49ad-af5d-2daf4d95b1ed","html_url":"https://github.com/kostis-codefresh/argo-rollouts-stateful-example","commit_stats":null,"previous_names":["kostis-codefresh/downward-api-rollouts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kostis-codefresh%2Fargo-rollouts-stateful-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kostis-codefresh%2Fargo-rollouts-stateful-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kostis-codefresh%2Fargo-rollouts-stateful-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kostis-codefresh%2Fargo-rollouts-stateful-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kostis-codefresh","download_url":"https://codeload.github.com/kostis-codefresh/argo-rollouts-stateful-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339224,"owners_count":21087215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T21:01:02.288Z","updated_at":"2025-04-11T04:10:55.960Z","avatar_url":"https://github.com/kostis-codefresh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Argo Rollouts with stateful services\n\nExample with Argo Rollouts with two services that use a queue (RabbitMQ in our case).\nWe want to do a blue/green deployment without affecting the production queue.\n\n## Local development\n\nThis is the workflow when you need to change the source code.\n\n### Run RabbitMQ locally\n\nInstall Docker \n\n```\ndocker run --name some-rabbit -p 5672:5672 -p 5673:5673 -p 15672:15672 rabbitmq:3-management\n```\nYou can visit the dashboard at `http://localhost:15672`.\nUsername and password are `guest:guest`\n\n### Run the worker manually\n\nInstall [GoLang](https://go.dev/) locally\n\n```\ncd source/worker\nAPP_VERSION=1.2  go run .\n```\nYou can now access the worker at `http://localhost:8080`\n\nClick the button to test RabbitMQ connection - the worker sends\nmessages to itself\n\n### Run the tester/producer locally\n\n```\ncd source/tester\ngo run .\n```\nYou can now access the producer at `http://localhost:7000`\n\nClick the *Production* button to send messages to the worker\n\n\n### Run all services at the same time\n\nInstall [Docker compose](https://docs.docker.com/compose/) (no need for local GoLang installation)\n\n```\ncd src\ndocker compose up\n```\n\nAnd now you can use \n\n* `http://localhost:15672` for RabbitMQ\n* `http://localhost:8000` for Stable worker\n* `http://localhost:9000` for Preview Worker\n\n\n### Deploy on Kubernetes\n\n```\ncd manifests/stateful-rollout\nkubectl apply -f . \nkubectl port-forward svc/rabbitmq 15672:15672\nkubectl port-forward svc/rabbitmq 5672:5672\nkubectl port-forward svc/worker-active 8000:8080 \nkubectl port-forward svc/worker-preview 9000:8080 for preview worker\n```\n\nAnd now you can use \n\n* `http://localhost:15672` for RabbitMQ\n* `http://localhost:8000` for Stable worker\n* `http://localhost:9000` for preview worker\n\n\n## Start a rollout\n\nTo see what the rollout is doing\n\n```\nkubectl-argo-rollouts get rollout my-worker \n```\n\nEdit the file worker.yml and update the env version at line 43\nto 2.0. Save the file and re-apply with kubectl\n\nPromote the rollout when ready with\n\n```\nkubectl-argo-rollouts promote my-worker \n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkostis-codefresh%2Fargo-rollouts-stateful-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkostis-codefresh%2Fargo-rollouts-stateful-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkostis-codefresh%2Fargo-rollouts-stateful-example/lists"}