|
| 1 | +<div align="center"> |
| 2 | + <a href="https://github.com/codeshelldev/servdiscovery/releases"> |
| 3 | + <img |
| 4 | + src="https://img.shields.io/github/v/release/codeshelldev/servdiscovery?sort=semver&logo=github&label=Release" |
| 5 | + alt="GitHub release" |
| 6 | + > |
| 7 | + </a> |
| 8 | + <a href="https://github.com/codeshelldev/servdiscovery/stargazers"> |
| 9 | + <img |
| 10 | + src="https://img.shields.io/github/stars/codeshelldev/servdiscovery?style=flat&logo=github&label=Stars" |
| 11 | + alt="GitHub stars" |
| 12 | + > |
| 13 | + </a> |
| 14 | + <a href="https://github.com/codeshelldev/servdiscovery/pkgs/container/servdiscovery"> |
| 15 | + <img |
| 16 | + src="https://ghcr-badge.egpl.dev/codeshelldev/servdiscovery/size?color=%2344cc11&tag=latest&label=Image+Size&trim=" |
| 17 | + alt="Docker image size" |
| 18 | + > |
| 19 | + </a> |
| 20 | + <a href="https://github.com/codeshelldev/servdiscovery/pkgs/container/servdiscovery"> |
| 21 | + <img |
| 22 | + src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fghcr-badge.elias.eu.org%2Fapi%2Fcodeshelldev%2Fservdiscovery%2Fservdiscovery&query=downloadCount&label=Downloads&color=2344cc11" |
| 23 | + alt="Docker image Pulls" |
| 24 | + > |
| 25 | + </a> |
| 26 | + <a href="./LICENSE"> |
| 27 | + <img |
| 28 | + src="https://img.shields.io/badge/License-MIT-green.svg" |
| 29 | + alt="License: MIT" |
| 30 | + > |
| 31 | + </a> |
| 32 | +</div> |
| 33 | + |
1 | 34 | # ServDiscovery |
2 | 35 |
|
3 | | -ServDiscovery is a Discovery Service that keeps an Endpoint updated with active Hosts (of Services). |
| 36 | +**ServDiscovery** is a dynamic **Discovery Service** that keeps your endpoints in sync with active hosts of your services — perfect for modern, containerized environments. Think of it as the bridge between your services and your reverse proxy, ensuring traffic always finds the right destination. |
4 | 37 |
|
5 | 38 | ## Installation |
6 | 39 |
|
7 | | -> [!NOTE] |
8 | | -> ServDiscovery only works with Traefik and not with **any** other Reverse Proxy due to `traefik.http.routers.router.rule` label |
| 40 | +> [!IMPORTANT] |
| 41 | +> ServDiscovery works **only with Traefik**. It will **not** work with other reverse proxies due to using traefik labels to determine routes. |
9 | 42 |
|
10 | | -Get the latest `docker-compose.yaml` file: |
| 43 | +Get the latest `docker-compose.yaml`: |
11 | 44 |
|
12 | 45 | ```yaml |
13 | 46 | {{{ #://docker-compose.yaml }}} |
14 | 47 | ``` |
15 | 48 |
|
| 49 | +Then spin it up: |
| 50 | + |
16 | 51 | ```bash |
17 | 52 | docker compose up -d |
18 | 53 | ``` |
19 | 54 |
|
| 55 | +Your discovery service is now live! 🎉 |
| 56 | + |
20 | 57 | ## Usage |
21 | 58 |
|
22 | | -Take this little `whoami` Container as an Example: |
| 59 | +Let's take a simple `whoami` container as an example: |
23 | 60 |
|
24 | 61 | ```yaml |
25 | 62 | {{{ #://examples/whoami.docker-compose.yaml }}} |
26 | 63 | ``` |
27 | 64 |
|
28 | | -Whenever a new **Host-Rule** gets added / modified ServDiscovery will update the set Endpoint to notify of any new changes. |
29 | | -This way the Endpoint can correctly route to different Hosts based on **SNI / Hostnames**. |
| 65 | +Whenever a new **Host-Rule** is added or updated, ServDiscovery will **automatically notify the configured endpoint**. |
| 66 | +This ensures the endpoint can correctly route traffic based on **SNI / Hostnames**. |
30 | 67 |
|
31 | | -## Endpoint |
| 68 | +## Endpoint Integration |
32 | 69 |
|
33 | | -ServDiscovery sends requests to the Endpoint as a **JSON HTTP Request**: |
| 70 | +ServDiscovery communicates with your endpoint via **JSON HTTP Requests**: |
34 | 71 |
|
35 | 72 | ```json |
36 | 73 | {{{ #://examples/payload.json }}} |
37 | 74 | ``` |
38 | 75 |
|
39 | | -This example tell the Endpoint that... |
| 76 | +Example explanation: |
40 | 77 |
|
41 | | -| Available | Unavailable | |
| 78 | +| ✅ Available | ❌ Unavailable | |
42 | 79 | | -------------------- | --------------------------- | |
43 | 80 | | whoami.mydomain.com | whoami-backup.mydomain.com | |
44 | 81 | | website.mydomain.com | website-backup.mydomain.com | |
45 | 82 | | auth.mydomain.com | auth-backup.mydomain.com | |
46 | 83 |
|
47 | | -This way (if the Endpoint is used by a LoadBalancer) the Owner of the Endpoint can now delete the `*-backup.mydomain.com` records from a Registry, |
48 | | -thus updating the list of routable Containers / Services. |
| 84 | +This allows the endpoint (e.g., a load balancer) to remove `\*-backup` records from your registry and **update routable containers/services automatically**. |
| 85 | + |
| 86 | +### Integrations |
| 87 | + |
| 88 | +You can find example integrations inside of [examples/](./examples). |
49 | 89 |
|
50 | 90 | ## Configuration |
51 | 91 |
|
52 | | -### ENDPOINT_KEY |
| 92 | +### `ENDPOINT_KEY` |
| 93 | + |
| 94 | +The endpoint key is used in the `Authorization` header (Bearer token) when ServDiscovery sends POST requests. |
| 95 | +If no key is provided, the header is omitted. |
| 96 | + |
| 97 | +### `DISCOVERY_INTERVAL` |
53 | 98 |
|
54 | | -The Endpoint Key is provided in the Authorization Header (via Bearer) during the POST request between the Endpoint and ServDiscovery. |
55 | | -If no Key is provided ServDiscovery will leave out the Authorization Header. |
| 99 | +Time (in seconds) between updates to your endpoint. |
| 100 | +**Default:** `60` seconds |
56 | 101 |
|
57 | | -### DISCOVERY_INTERVAL |
| 102 | +### `ALIVE_INTERVAL` |
58 | 103 |
|
59 | | -The Discovery Interval sets the Interval of which ServDiscovery will update the Endpoint, etc. |
| 104 | +Time (in seconds) between full alive discoveries. ServDiscovery sends a **complete update** of all active containers in the `added` JSON key. |
| 105 | +**Default:** `120` seconds |
60 | 106 |
|
61 | 107 | ## Contributing |
62 | 108 |
|
63 | | -Found a bug or have new ideas or enhancements for this Project? |
64 | | -Feel free to open up an issue or create a Pull Request! |
| 109 | +Found a bug or have a brilliant idea? Contributions are welcome! Open an **issue** or create a **pull request** — your help makes this project better. |
65 | 110 |
|
66 | 111 | ## License |
67 | 112 |
|
68 | | -[MIT](https://choosealicense.com/licenses/mit/) |
| 113 | +This project is licensed under the [MIT License](./LICENSE). |
0 commit comments