{"id":48976304,"url":"https://github.com/runityru/anycastd","last_synced_at":"2026-04-18T09:08:11.957Z","repository":{"id":242377949,"uuid":"808743011","full_name":"runityru/anycastd","owner":"runityru","description":"Simple daemon to make BGP announces if service is alive","archived":false,"fork":false,"pushed_at":"2026-02-16T05:47:55.000Z","size":354,"stargazers_count":21,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-16T13:27:35.091Z","etag":null,"topics":["anycast","bgp","high-availability","liveness-detection","load-balancing","loadbalancing","networking"],"latest_commit_sha":null,"homepage":"","language":"Go","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/runityru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-31T18:07:40.000Z","updated_at":"2026-02-16T05:47:56.000Z","dependencies_parsed_at":"2024-06-19T03:13:47.982Z","dependency_job_id":"40e3a4f0-27d9-4fa9-8c2d-8e402fbb9412","html_url":"https://github.com/runityru/anycastd","commit_stats":null,"previous_names":["teran/anycastd","runityru/anycastd"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/runityru/anycastd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runityru%2Fanycastd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runityru%2Fanycastd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runityru%2Fanycastd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runityru%2Fanycastd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/runityru","download_url":"https://codeload.github.com/runityru/anycastd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runityru%2Fanycastd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31962894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["anycast","bgp","high-availability","liveness-detection","load-balancing","loadbalancing","networking"],"created_at":"2026-04-18T09:08:10.345Z","updated_at":"2026-04-18T09:08:11.947Z","avatar_url":"https://github.com/runityru.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# anycastd\n\n[![Verify](https://github.com/runityru/anycastd/actions/workflows/verify.yml/badge.svg?branch=master)](https://github.com/runityru/anycastd/actions/workflows/verify.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/runityru/anycastd)](https://goreportcard.com/report/github.com/runityru/anycastd)\n[![Go Reference](https://pkg.go.dev/badge/github.com/runityru/anycastd.svg)](https://pkg.go.dev/github.com/runityru/anycastd)\n\nanycastd is aimed to bring new age approaches to classic applications by allowing\nto announce virtual addresses via BGP w/ service-level checks.\n\nLet's imaging you gonna create your own DNS/HTTP/whatever else service so how\nto utilize L3 load balancing and remove announce when something goes wrong on\nparticular node? anycastd is exactly for that! No bunch of dedicated services\nand stateful control on BGP routes and no semi-tested Python scripts anymore!\n\n## Usage\n\nanycastd is written as a pretty compact daemon like application so it could\nrun in two main ways: via systemd or via docker/podman/any other container\nengine so that's why there's a container image in packages is available in\nparallel with traditional Go binaries.\n\nFor monitoring purposes anycastd listens HTTP socket with Prometheus metrics\nendpoint so once routes are removed from the announce SRE's could go and check\nwhy that happened.\n\n## Configuration\n\nanycastd longs to follow [12factor](https://12factor.net) principles however\nit's not always possible to encode complex data structures into environment\nvariable. So configuration is divided into two ways:\n\n### Environment\n\nanycastd allows to set the following options via environment variables:\n\n* `CONFIG_PATH` (string, default: `/config.yaml`) - path to the configuration file\n* `LOG_LEVEL` (ENUM, default: `WARN`) - logging verbosity level, could one of the:\n  * `TRACE`\n  * `DEBUG`\n  * `INFO`\n  * `WARNING`\n  * `ERROR`\n  * `FATAL`\n  * `PANIC`\n\n### Configuration file\n\nConfiguration file contains service configuration, i.e. how to announce,\nwhere to announce, checks to perform before announce. JSON and YAML formats\nfor the same data structure is supported. Example:\n\n```yaml\n---\nannouncer:\n  router_id: 10.3.3.3\n  local_address: 10.0.0.1\n  local_asn: 65999\n  routes:\n    - 10.0.0.128/32\n  peers:\n    - name: some_router_1\n      remote_address: 10.0.0.252\n      remote_asn: 65000\n    - name: some_router_2\n      remote_address: 10.0.0.253\n      remote_asn: 65000\n      enable_multihop: true\n      multihope_ttl: 3\nservices:\n  - name: http\n    check_interval: 10s\n    checks:\n      - kind: dns_lookup\n        spec:\n          query: google.com\n          resolver: 127.0.0.1:53\n          tries: 3\n          interval: 100ms\n          timeout: 3s\n      - kind: http_2xx\n        spec:\n          url: http://127.0.0.1:8080/test-path\n          method: GET\n          headers:\n            Host: example.com\n          payload: ping\n          tries: 3\n          interval: 100ms\n          timeout: 2s\n      - kind: tls_certificate\n        spec:\n          local:\n            path: /etc/ssl/pki/cert.pem\n          common_name: Test certificate\n          dns_names:\n            - site.example.org\n          ip_addresses:\n            - 127.0.0.1\n          issuer: Test Issuer\n      - kind: assigned_address\n        spec:\n          interface: dummy0\n          ipv4: 33.22.11.0\n      - kind: icmp_ping\n        spec:\n          static:\n            host: google.com\n          tries: 3\n          interval: 100ms\n          timeout: 5s\n      - kind: tftp_rrq\n        spec:\n          url: tftp://127.0.0.1:69/lpxelinux.0\n          tries: 3\n          interval: 100ms\n          timeout: 5s\n      - kind: ntpq\n        spec:\n          server: 0.ru.pool.ntp.org\n          src_addr: 192.168.0.1\n          tries: 3\n          offset_threshold: 125ms\n          interval: 100ms\n          timeout: 5s\nmetrics:\n  enabled: true\n  address: 127.0.0.1:9090\n```\n\n## Available checks\n\nCheck (implemented via Checker interface) is core concept in anycastd, allows\nto write well-tested piece of code to enable or disable announce. In anycastd\nmost of checks could be written without any shell invocations i.e. in pure Go\nwhich is a preferable way. That's why there's no exec command check ;)\n\nFor now the following checks are available:\n\n* assigned_address - ensures the address is assigned on interface\n* dns_lookup - performs DNS lookup\n* http_2xx - performs HTTP check and expects 2xx code\n* icmp_ping - performs ICMP ping to the specified host\n* tftp_rrq - performs TFTP GET request to specified URL\n* ntpq - performs NTP query to ntp server from specific addr, checking offset\n* tls_certificate - performs TLS certificate validation \u0026 provide expiration\n  date via metrics\n\n## Metrics\n\nA special part of anycastd is a Prometheus-compatible metrics allows monitoring\nsystems to notify operators about any changes in their service.\n\nFor now anycastd provides the following metrics:\n\n| Metric name | Labels  | Description                                    |\n| ----------- | ------- | ---------------------------------------------- |\n| anycastd_up | version | Application liveness status (must always be 1) |\n\n### Service\n\nService could provide their metrics in order to aggregate current statuses.\n\n| Metric name         | Labels         | Description                             |\n| ------------------- | -------------- | --------------------------------------- |\n| anycastd_service_up | service, check | Service liveness status based on checks |\n\n### Checks\n\nCheck running engine provides the following metrics.\n\n| Metric name                     | Labels         | Description                            |\n| ------------------------------- | -------------- | -------------------------------------- |\n| anycastd_check_duration_seconds | service, check | Duration of check execution in seconds |\n\nIn addition some checkers could provide their own metrics the list of them is bellow:\n\n#### tls_certificate check\n\n| Metric name                    | Labels      | Description                                  |\n| ------------------------------ | ----------- | -------------------------------------------- |\n| certificate_expires_in_seconds | check, path | Time the certificate expires in (in seconds) |\n\n#### icmp_ping check\n\n| Metric name                                      | Labels      | Description                                |\n| ------------------------------------------------ | ----------- | ------------------------------------------ |\n| anycastd_check_avg_rtt_seconds                   | check, host | Avg RTT of ICMP checks                     |\n| anycastd_check_loss_percent                      | check, host | Percent of packet loss                     |\n| anycastd_check_max_rtt_seconds                   | check, host | Max RTT of ICMP checks                     |\n| anycastd_check_min_rtt_seconds                   | check, host | Min RTT of ICMP checks                     |\n| anycastd_check_packets_received_duplicates_total | check, host | Total amount of duplicate packets received |\n| anycastd_check_packets_received_total            | check, host | Total amount of packets received           |\n| anycastd_check_packets_sent_total                | check, host | Total amount of packets sent               |\n| anycastd_check_std_dev_rtt_seconds               | check, host | Standard deviation RTT of ICMP checks      |\n\n#### ntpq check\n\n| Metric name                           | Labels      | Description                                                                   |\n| ------------------------------------- | ----------- | ----------------------------------------------------------------------------- |\n| anycastd_check_last_ntp_offset_ms     | check, host | The estimated offset of the local system clock relative to the server's clock |\n| anycastd_check_last_ntp_rtt_ms        | check, host | An estimate of the round-trip-time delay between the client and the server    |\n| anycastd_check_ntp_packets_sent_total | check, host | Total amount of ntp packets sent                                              |\n\n### GoBGP\n\nThe core of anycastd for BGP communication is GoBGP which allows so gather\nsome details about peers, sessions and announces.\n\n| Metric name                                      | Labels          | Description                                                                                         |\n| ------------------------------------------------ | --------------- | --------------------------------------------------------------------------------------------------- |\n| anycastd_gobgp_peer_admin_state                  | router_id, peer | Peer state 0=up, 1=down, 2=pfx_ct                                                                   |\n| anycastd_gobgp_peer_count                        | router_id       | Total amount of peers configured for the GoBGP instance                                             |\n| anycastd_gobgp_peer_flops_count                  | router_id, peer | Peer flops count                                                                                    |\n| anycastd_gobgp_peer_out_queue_count              | router_id, peer | Peer outgoing messages queue                                                                        |\n| anycastd_gobgp_peer_password_set_flag            | router_id, peer | Whether the peer have peer password set flag set                                                    |\n| anycastd_gobgp_peer_remove_private_flag          | router_id, peer | Whether the peer have remove private flag set                                                       |\n| anycastd_gobgp_peer_send_community_flag          | router_id, peer | Whether the peer have send community flag set                                                       |\n| anycastd_gobgp_peer_session_state                | router_id, peer | Peer session state 0=unknown, 1=idle, 2=connect, 3=active, 4=opensent, 5=openconfirm, 6=established |\n| anycastd_gobgp_peer_type                         | router_id, peer | Peer type 0=internal, 1=external                                                                    |\n| anycastd_gobgp_received_messages_keepalive       | router_id, peer | Number of Keepalive messages received from the peer                                                 |\n| anycastd_gobgp_received_messages_notification    | router_id, peer | Number of Notification messages received from the peer                                              |\n| anycastd_gobgp_received_messages_open            | router_id, peer | Number of Open messages received from the peer                                                      |\n| anycastd_gobgp_received_messages_refresh         | router_id, peer | Number of Refresh messages received from the peer                                                   |\n| anycastd_gobgp_received_messages_total           | router_id, peer | Total number of messages received from the peer                                                     |\n| anycastd_gobgp_received_messages_update          | router_id, peer | Number of Update messages received from the peer                                                    |\n| anycastd_gobgp_received_messages_withdraw_update | router_id, peer | Number of Withdraw Update messages received from the peer                                           |\n| anycastd_gobgp_sent_messages_keepalive           | router_id, peer | Number of Keepalive messages sent to the peer                                                       |\n| anycastd_gobgp_sent_messages_notification        | router_id, peer | Number of Notification messages sent to the peer                                                    |\n| anycastd_gobgp_sent_messages_open                | router_id, peer | Number of Open messages sent to the peer                                                            |\n| anycastd_gobgp_sent_messages_refresh             | router_id, peer | Number of Refresh messages sent to the peer                                                         |\n| anycastd_gobgp_sent_messages_total               | router_id, peer | Total number of messages sent to the peer                                                           |\n| anycastd_gobgp_sent_messages_update              | router_id, peer | Number of Update messages sent to the peer                                                          |\n| anycastd_gobgp_sent_messages_withdraw_prefix     | router_id, peer | Number of Withdraw Prefix messages sent to the peer                                                 |\n| anycastd_gobgp_sent_messages_withdraw_update     | router_id, peer | Number of Withdraw Update messages sent to the peer                                                 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunityru%2Fanycastd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunityru%2Fanycastd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunityru%2Fanycastd/lists"}