{"id":13780828,"url":"https://github.com/sous-chefs/etcd","last_synced_at":"2025-04-08T03:19:58.792Z","repository":{"id":9951907,"uuid":"11971520","full_name":"sous-chefs/etcd","owner":"sous-chefs","description":"Development repository for the etcd cookbook","archived":false,"fork":false,"pushed_at":"2024-09-26T20:03:20.000Z","size":686,"stargazers_count":79,"open_issues_count":3,"forks_count":77,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-10-29T21:26:46.867Z","etag":null,"topics":["chef","chef-cookbook","chef-resource","etcd","hacktoberfest","managed-by-terraform"],"latest_commit_sha":null,"homepage":"https://supermarket.chef.io/cookbooks/etcd","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sous-chefs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"sous-chefs"}},"created_at":"2013-08-08T08:21:59.000Z","updated_at":"2024-08-12T19:22:45.000Z","dependencies_parsed_at":"2024-04-12T14:37:21.093Z","dependency_job_id":"a7937c31-19a7-4e84-9221-3262619b1e24","html_url":"https://github.com/sous-chefs/etcd","commit_stats":{"total_commits":608,"total_committers":44,"mean_commits":"13.818181818181818","dds":0.7713815789473684,"last_synced_commit":"513d7562129c9f971d7871c35f0d5cae2809b519"},"previous_names":[],"tags_count":90,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fetcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fetcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fetcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fetcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sous-chefs","download_url":"https://codeload.github.com/sous-chefs/etcd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247014513,"owners_count":20869376,"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":["chef","chef-cookbook","chef-resource","etcd","hacktoberfest","managed-by-terraform"],"created_at":"2024-08-03T18:01:20.188Z","updated_at":"2025-04-08T03:19:58.761Z","avatar_url":"https://github.com/sous-chefs.png","language":"Ruby","readme":"# Etcd Cookbook\n\n[![Cookbook Version](https://img.shields.io/cookbook/v/etcd.svg)](https://supermarket.chef.io/cookbooks/etcd)\n[![CI State](https://github.com/sous-chefs/etcd/workflows/ci/badge.svg)](https://github.com/sous-chefs/etcd/actions?query=workflow%3Aci)\n[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers)\n[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)\n[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)\n\nThe Etcd Cookbook is a library cookbook that provides custom resources for use in recipes.\n\n## Scope\n\nThis cookbook is concerned with the [Etcd](https://coreos.com/etcd/) distributed key/value store as distributed by CoreOS, Inc.\n\n## Maintainers\n\nThis cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit [sous-chefs.org](https://sous-chefs.org/) or come chat with us on the Chef Community Slack in [#sous-chefs](https://chefcommunity.slack.com/messages/C2V7B88SF).\n\n## Requirements\n\n- Chef Infra Client 16+\n- Network accessible web server hosting the etcd binary.\n\n## Platform Support\n\nThe following platforms have been tested with Test Kitchen. It will most likely work on other platforms as well\n\n```text\n|---------------+--------+\n|               | 3.2.15 |\n|---------------+--------+\n| amazonlinux 2 |   X    |\n|---------------+--------+\n| centos-7      |   X    |\n|---------------+--------+\n| debian-9      |   X    |\n|---------------+--------+\n| debian-10     |   X    |\n|---------------+--------+\n| fedora        |   X    |\n|---------------+--------+\n| ubuntu-16.04  |   X    |\n|---------------+--------+\n| ubuntu-18.04  |   X    |\n|---------------+--------+\n| ubuntu-20.04  |   X    |\n|---------------+--------+\n| opensuse-leap |   X    |\n|---------------+--------+\n```\n\n## Cookbook Dependencies\n\n- [docker](https://supermarket.chef.io/cookbooks/docker)\n\n## Usage\n\n- Add `depends 'etcd'` to your cookbook's metadata.rb\n- Use the resources shipped in cookbook in a recipe, the same way you'd use core Chef resources (file, template, directory, package, etc).\n\n```ruby\netcd_service 'etcd0' do\n  advertise_client_urls 'http://127.0.0.1:2379'\n  listen_client_urls 'http://0.0.0.0:2379'\n  initial_advertise_peer_urls 'http://127.0.0.1:2380'\n  listen_peer_urls 'http://0.0.0.0:2380'\n  initial_cluster_token 'etcd-cluster-1'\n  initial_cluster 'etcd0=http://127.0.0.1:2380,etcd1=http://127.0.0.1:3380,etcd2=http://127.0.0.1:4380'\n  initial_cluster_state 'new'\n  action :start\n  ignore_failure true # required for the first cluster build\nend\n\netcd_service 'etcd1' do\n  advertise_client_urls 'http://127.0.0.1:3379'\n  listen_client_urls 'http://0.0.0.0:3379'\n  initial_advertise_peer_urls 'http://127.0.0.1:3380'\n  listen_peer_urls 'http://0.0.0.0:3380'\n  initial_cluster_token 'etcd-cluster-1'\n  initial_cluster 'etcd0=http://127.0.0.1:2380,etcd1=http://127.0.0.1:3380,etcd2=http://127.0.0.1:4380'\n  initial_cluster_state 'new'\n  action :start\n  ignore_failure true\nend\n\netcd_service 'etcd2' do\n  advertise_client_urls 'http://127.0.0.1:4379'\n  listen_client_urls 'http://0.0.0.0:4379'\n  initial_advertise_peer_urls 'http://127.0.0.1:4380'\n  listen_peer_urls 'http://0.0.0.0:4380'\n  initial_cluster_token 'etcd-cluster-1'\n  initial_cluster 'etcd0=http://127.0.0.1:2380,etcd1=http://127.0.0.1:3380,etcd2=http://127.0.0.1:4380'\n  initial_cluster_state 'new'\n  action :start\n  ignore_failure true\nend\n```\n\nBy default reosource creates `etcd-NODE_NAME` unit file name. Sometimes it's not comfortable.\n\nIf you don't run multi etcd service in node, you can change this action to default service name.\n\n```ruby\netcd_service 'etcd' do\n  action :start\n  default_service_name true\n...\nend\n```\n\n## Test Cookbooks as Examples\n\nThe cookbooks ran under test-kitchen make excellent usage examples.\n\nThe test recipes are found at:\n\n```ruby\ntest/cookbooks/etcd_test/\n```\n\n## Resources Overview\n\n- `etcd_service`: composite resource that uses etcd_installation and etcd_service_manager\n- `etcd_installation`: automatically selects an installation method\n- `etcd_service_manager`: automatically selects a service manager\n- `etcd_key`: manages keys in etcd\n- `etcd_installation_binary`: copies a pre-compiled etcd binary onto disk\n- `etcd_installation_docker`: pulls a docker image to the DOCKER_HOST\n- `etcd_service_manager_systemd`: manage etcd daemon with systemd unit files\n- `etcd_service_manager_docker`: starts a docker process on the DOCKER_HOST\n\n## Resources Details\n\n### etcd_installation\n\nThe `etcd_installation` resource auto-selects one of the below resources with the provider resolution system. Defaults to binary installation.\n\n#### Example\n\n```ruby\netcd_installation 'default' do\n  action :create\nend\n```\n\n### etcd_installation_binary\n\nThe `etcd_installation_binary` resource copies the precompiled Go binary onto the disk.\n\n#### Example\n\n```ruby\netcd_installation_binary 'default' do\n  version '3.2.6'\n  source 'https://my.computers.biz/dist/etcd'\n  checksum '90aff7364caa43932fd46974825af20e0ecb70fe7e01981e2d3a496106f147e7'\n  action :create\nend\n```\n\n### etcd_installation_docker\n\nThe `etcd_installation_docker` resource uses the `docker_image` resource to pull an image to the DOCKER_HOST.\n\n#### Properties\n\n- `repo` - The image name to pull. Defaults to 'quay.io/coreos/etcd'\n- `tag` - The image tag to pull.\n- `version` - String used to calculate tag string when tag is omitted. Defaults to '2.3.7'\n\n### etcd_service_manager\n\nThe `etcd_service_manager` resource auto-selects one of the below resources with the provider resolution system. The `etcd_service` family all share a common set of properties, which are listed under the `etcd_service` composite resource.\n\n#### Warning\n\netcd startup behavior is a bit quirky. etcd loops indefinitely on startup until quorum can be established. Due to this the first nodes service start will fail unless all nodes come up at the same time. Due to this there is an ignore_failure property for the systemd service managers which allows you to continue on in the chef run if the service fails to start. systemd will automatically keep restarting the service until all nodes are up and the cluster is healthy. For sys-v init you're on your own.\n\n#### Example\n\n```ruby\netcd_service_manager 'default' do\n  action :start\nend\n```\n\n#### properties\n\n- ignore_failure - Ignore failures starting the etcd service. Before quorum is established nodes will loop indefinitely and never successfully start. This can help ensure all instances are up when init systems can handle restart on failure. Default: false\n\n### etcd_service_manager_systemd\n\n#### Example\n\n```ruby\netcd_service_manager_systemd 'default' do\n  action :start\nend\n```\n\n#### properties\n\n- service_timeout - The time in seconds before the service start fails. Default: 120\n- ignore_failure - Ignore failures starting the etcd service. Before quorum is established nodes will loop indefinitely and never successfully start. This can help ensure all instances are up when init systems can handle restart on failure. Default: false\n\n### etcd_service_manager_docker\n\n#### Example\n\n```ruby\netcd_service_manager_docker 'default' do\n  action :start\nend\n```\n\n#### properties\n\n- repo - defaults to 'quay.io/coreos/etcd'\n- tag - default calculated from version\n- version - defaults to '3.2.15',\n- container_name - defaults to resource name\n- port - defaults to ['2379/tcp4:2379', '2380/tcp4:2380']\n- host_data_path - Path to store data locally on the host, which will be mounted into the container\n\n### etcd_service\n\nThe `etcd_service`: resource is a composite resource that uses `etcd_installation` and `etcd_service_manager` resources to install and manage the etcd service.\n\n- The `:create` action uses an `etcd_installation`\n- The `:delete` action uses an`etcd_installation`\n- The `:start` action uses an `etcd_service_manager`\n- The `:stop` action uses an `etcd_service_manager`\n\nThe service management strategy for the host platform is dynamically chosen based on platform, but can be overridden.\n\n#### Properties\n\nThe `etcd_service` resource property list corresponds to the options found in\n\n[Etcd Configuration Flags documentation](https://coreos.com/etcd/docs/3.2.15/op-guide/configuration.html)\n\n##### Member properties\n\n- `source`\n- `node_name`\n- `data_dir`\n- `wal_dir`\n- `snapshot_count` snapshot to disk.\n- `heartbeat_interval`\n- `election_timeout`\n- `listen_peer_urls`\n- `listen_client_urls`\n- `max_snapshots`\n- `max_wals`\n- `cors`\n- `quota_backend_bytes`\n\n##### Clustering properties\n\n- `initial`\n- `initial_advertise_peer_urls`\n- `initial_cluster`\n- `initial_cluster_state`\n- `initial_cluster_token`\n- `advertise_client_urls`\n- `discovery`\n- `discovery_srv`\n- `discovery_fallback`\n- `discovery_proxy`\n- `strict_reconfig_check`\n- `auto_compaction_retention`\n- `enable_v2`\n\n##### Proxy properties\n\n- `proxy`\n- `proxy_failure_wait`\n- `proxy_refresh_interval`\n- `proxy_dial_timeout`\n- `proxy_write_timeout`\n- `proxy_read_timeout`\n\n##### Security properties\n\n- `cert_file`\n- `key_file`\n- `client_cert_auth`\n- `trusted_ca_file`\n- `auto_tls`\n- `peer_cert_file`\n- `peer_key_file`\n- `peer_client_cert_auth`\n- `peer_trusted_ca_file`\n- `peer_cert_allowed_cn`\n- `peer_auto_tls`\n- `etcdctl_client_cert_file`\n- `etcdctl_client_key_file`\n- `experimental_peer_skip_client_san_verification`\n\n##### Logging properties\n\n- `debug`\n- `log_package_levels`\n\n##### Profiling properties\n\n- `enable_pprof`\n- `metrics`\n- `listen-metrics-urls`\n\n##### Auth Flpropertiesags\n\n- `auth_token`\n\n##### Unsafe properties\n\n- `force_new_cluster`\n\n##### Misc properties\n\n- `http_proxy`\n- `https_proxy`\n- `no_proxy`\n- `auto_restart`\n\n### etcd_key\n\nThe `etcd_key` resource sets, watches and deletes keys in etcd.\n\n#### Actions\n\n- The `:set` action sets a key\n- The `:delete` action deletes a key\n- The `:watch` action waits for a key to update\n\n##### Properties\n\n- `key` - The key name\n- `value` - The desired value\n- `ttl` - The ttl for the key (optional)\n- `host` - The hostname of the etcd server, defaults to `127.0.0.1`\n- `port` - The port that etcd is listening on, defaults to `2379`\n\n#### Examples\n\n```ruby\netcd_key \"/test\" do\n  value \"a_test_value\"\n  action :set\nend\n```\n\n## Contributors\n\nThis project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890\u0026button=false)\n\n### Additional Contributors\n\n- [Jesse Nelson](https://github.com/spheromak)\n- [Soulou](https://github.com/Soulou)\n- [Aaron O'Mullan](https://github.com/AaronO)\n- [Anthony Scalisi](https://github.com/scalp42)\n- [Robert Coleman](https://github.com/rjocoleman)\n- [James Gregory](https://github.com/jagregory)\n- [Sean OMeara](https://github.com/someara)\n\n### Backers\n\nThank you to all our backers!\n\n![https://opencollective.com/sous-chefs#backers](https://opencollective.com/sous-chefs/backers.svg?width=600\u0026avatarHeight=40)\n\n### Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website.\n\n![https://opencollective.com/sous-chefs/sponsor/0/website](https://opencollective.com/sous-chefs/sponsor/0/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/1/website](https://opencollective.com/sous-chefs/sponsor/1/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/2/website](https://opencollective.com/sous-chefs/sponsor/2/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/3/website](https://opencollective.com/sous-chefs/sponsor/3/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/4/website](https://opencollective.com/sous-chefs/sponsor/4/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/5/website](https://opencollective.com/sous-chefs/sponsor/5/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/6/website](https://opencollective.com/sous-chefs/sponsor/6/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/7/website](https://opencollective.com/sous-chefs/sponsor/7/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/8/website](https://opencollective.com/sous-chefs/sponsor/8/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/9/website](https://opencollective.com/sous-chefs/sponsor/9/avatar.svg?avatarHeight=100)\n","funding_links":["https://opencollective.com/sous-chefs"],"categories":["Cookbooks"],"sub_categories":["Service Discovery"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsous-chefs%2Fetcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsous-chefs%2Fetcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsous-chefs%2Fetcd/lists"}