{"id":37162450,"url":"https://github.com/dmathieu/dice","last_synced_at":"2026-01-14T19:20:03.838Z","repository":{"id":54981728,"uuid":"150105286","full_name":"dmathieu/dice","owner":"dmathieu","description":"Roll all instances within a kubernetes cluster, using a zero-downtime strategy.","archived":true,"fork":false,"pushed_at":"2022-01-26T14:51:23.000Z","size":6655,"stargazers_count":51,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T13:45:18.478Z","etag":null,"topics":["aws","kubernetes"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/dmathieu/dice","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmathieu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-24T13:16:37.000Z","updated_at":"2023-05-08T22:02:19.000Z","dependencies_parsed_at":"2022-08-14T08:01:14.487Z","dependency_job_id":null,"html_url":"https://github.com/dmathieu/dice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dmathieu/dice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmathieu%2Fdice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmathieu%2Fdice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmathieu%2Fdice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmathieu%2Fdice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmathieu","download_url":"https://codeload.github.com/dmathieu/dice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmathieu%2Fdice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28432437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aws","kubernetes"],"created_at":"2026-01-14T19:20:03.125Z","updated_at":"2026-01-14T19:20:03.829Z","avatar_url":"https://github.com/dmathieu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dice\n\n**Project Status**: This project is archived because I am not using it in production anymore, and have therefore not been updating it to the latest Kubernetes APIs.  \nUpgrading the dependencies would require essentially rewriting it entirely, and I do not wish to do so at the moment.\n\nDice will roll all instances within a kubernetes cluster, using a zero-downtime strategy.\n\nWhenever running the process, it will:\n\n* Flag all running instances as `dice=roll`. All those instances will be rolled.\n* Evict all pods from the number of parallel instances required.\n* Listen for all pods stopping on a node.\n  * When a node has no pods anymore, it will delete it.\n* Listen for all new nodes arriving on the cluster.\n  * When a new node comes up, it will move on to evicting the pods on another one.\n\nDice assumes the cluster has an auto-scaler running, so when a node is deleted, another one can be booted.\n\n## Supported Providers\n\nOnly AWS is currently supported\n\n## Usage\n\n### In Cluster\n\nIn order to run dice within the cluster, kubernetes needs to be able to delete AWS instances. That can be done with the following IAM policy:\n\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ec2:TerminateInstances\"\n            ],\n            \"Resource\": \"*\"\n        }\n    ]\n}\n```\n\n#### As a one-off\n\nRunning dice as a one-off is a good use case when you have changed the boot\nconfiguration for your instances for examples, and you need new ones with the\nappropriate config.\n\n```\nkubeclt apply -f examples/dice-aws.yaml\n```\n\n#### Regularly roll instances\n\nYou may want to regularly roll instances if they are too old. This allows rolling out the fleet on a regular cadence.\n\n```\nkubeclt apply -f examples/loop-aws.yaml\n```\n\n### Out of Cluster\n\nYou can run dice from your own machines (good for testing, but it shouldn't be used on production workloads).\n\n```\ngo get -u github.com/dmathieu/dice\ndice run -c aws\n```\n\nNote: you can run the permanent loop out of the cluster with the `dice loop -c aws` command.\nThis is not recommended however, as you would then need to have the process running permanently.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmathieu%2Fdice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmathieu%2Fdice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmathieu%2Fdice/lists"}