{"id":20475237,"url":"https://github.com/j-p-d-e-v/carapace_lb","last_synced_at":"2026-04-11T06:03:10.941Z","repository":{"id":242979154,"uuid":"810956282","full_name":"j-p-d-e-v/carapace_lb","owner":"j-p-d-e-v","description":"A path based load balancer developed using Cloudflare's Programmable Network System Framework called Pingora.","archived":false,"fork":false,"pushed_at":"2024-06-09T05:50:14.000Z","size":829,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-28T16:55:48.134Z","etag":null,"topics":["alb","application-load-balancer","containerization","docker","docker-compose","load-balancer","pingora","rust","rustlanguage","vue","websocket"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/carapace_lb","language":"Rust","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/j-p-d-e-v.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-05T17:04:08.000Z","updated_at":"2024-07-13T20:56:12.000Z","dependencies_parsed_at":"2025-01-16T03:24:17.777Z","dependency_job_id":null,"html_url":"https://github.com/j-p-d-e-v/carapace_lb","commit_stats":null,"previous_names":["j-p-d-e-v/carapace","j-p-d-e-v/carapace_lb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-p-d-e-v%2Fcarapace_lb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-p-d-e-v%2Fcarapace_lb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-p-d-e-v%2Fcarapace_lb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-p-d-e-v%2Fcarapace_lb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j-p-d-e-v","download_url":"https://codeload.github.com/j-p-d-e-v/carapace_lb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242041993,"owners_count":20062325,"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":["alb","application-load-balancer","containerization","docker","docker-compose","load-balancer","pingora","rust","rustlanguage","vue","websocket"],"created_at":"2024-11-15T15:15:12.472Z","updated_at":"2025-12-30T22:45:22.741Z","avatar_url":"https://github.com/j-p-d-e-v.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Carapace LB - A Path Based Load Balancer\n\nCarapace LB is a path-based load balancer that leverages the [Pingora Framework by Cloudflare](https://github.com/cloudflare/pingora) to manage and route traffic efficiently.\n\n```\nNOTE: I havent included SNI here because I dont have yet a good understanding on how to apply SNI in pingora.\n```\n\n## Configuration\n\nSince the application uses Pingora, it also inherit its configurations. To know more about Pingora related configuration, please refer here:\nhttps://github.com/cloudflare/pingora/blob/main/docs/user_guide/conf.md\n\nThe configuration uses the TOML format. For more details, refer to the [TOML documentation](https://toml.io/en/v1.0.0).\n\n# High Level Diagram\n\n![Diagram](./docs/digram.jpg)\n\n### `[load_balancer]`\nConfigure the load balancer.\n\n| Property     | Description                                                           |\n|--------------|-----------------------------------------------------------------------|\n| `host`       | The address of the load balancer.                                     |\n| `port`       | The port on which the load balancer will listen.                      |\n| `routes_path`| The file where routes will be saved during service discovery updates. |\n| `enable_tls_ssl`| Set to ```true``` to enable TLS/SSL. Set to ```false``` to disable TLS/SSL. |\n| `ca_crt_path`| The certficate path for the .crt file. |\n| `ca_pem_path`| The certficate path for the .pem file. |\n| `allow_file_types_pattern`| The regular expression pattern for matching files in the url path. |\n| `debug`| Set to empty string ```\"\"```. If set to ```\"INFO\"``` it will only print minimal info. such as Upstream Address and the URL Path. If set to ```\"DEBUG\"``` it will only print minimal info. such as Upstream Address and all the request information.   |\n\n#### Example\n```toml\n[load_balancer]\nhost=\"0.0.0.0\"\nport=6170\nroutes_path=\"routes.json\"\nenable_tls_ssl=true\nca_crt_path=\"certs/localhost.crt\"\nca_pem_path=\"certs/localhost.pem\"\nallow_file_types_pattern=\"[0-9|_|-|A-Z|a-z]*\\\\.(js|css|png|jpeg|jpg|ico)\"\ndebug=\"INFO\"\n```\n\n### `[[proxy_services]]`\n\n**When enabling ```use_container``` please make sure that the load balancer has local access to the docker daemon and to the network of the containers.**\n\nConfigure the proxy services for container discovery based on container labels.\n\n| Property               | Description                                                                 |\n|------------------------|-----------------------------------------------------------------------------|\n| `container_label_key`  | The key of the container label (used if `use_container` is set to `true`).  |\n| `container_label_value`| The value of the container label (used if `use_container` is set to `true`).|\n| `path`                 | The URL path to match. If the URL path matches, traffic is routed to this proxy service. |\n| `port`                 | The port on which the proxy service listens.                                |\n| `use_container`        | Set to `true` if upstreams are containers. The load balancer should be containerized and in the same network as the containers. Set to `false` when targeting specific addresses. |\n| `host`                 | The specific addresses to load balance. Useful if applications are on separate machines. |\n\n#### Example\n```toml\n[[proxy_services]]\ncontainer_label_key=\"cbl.dev.nginx\"\ncontainer_label_value=\"groupA\"\npath = \"/\"\nport = 3101\nuse_container=false\nhost = \"0.0.0.0\"\n\n[[proxy_services]]\ncontainer_label_key=\"cbl.dev.nginx\"\ncontainer_label_value=\"groupC\"\npath=\"/\"\nuse_container=false\nport = 3102\nhost = \"0.0.0.0\"\n```\n\n### `[health_check]`\nConfigure health checks and service discovery.\n\nFor more details, refer to the [Pingora LoadBalancer documentation](https://docs.rs/pingora/0.2.0/pingora/lb/struct.LoadBalancer.html#structfield.health_check_frequency).\n\n| Property                | Description                                                             |\n|-------------------------|-------------------------------------------------------------------------|\n| `health_check_frequency`| The interval (in milliseconds) at which health checks are performed.    |\n| `update_frequency`      | The interval (in milliseconds) at which service discovery is performed. |\n| `parallel_health_check` | Set to `false` to perform health checks sequentially.                   |\n\n#### Example\n```toml\n[health_check]\nhealth_check_frequency=1000\nupdate_frequency=1500\nparallel_health_check=false\n```\n\n### Build\n\n```\ncargo build\n```\n\n#### Build Specific Platform\n\n```\ncargo build --target=x86_64-unknown-linux-gnu\n```\n\nSee ```rustup target list``` for the list of platforms.\n\n### Test\n\n```\ncargo test -- --nocapture\n```\n\n### Run\n\n```\ncargo run\n```\n\n# Developer\n- JP Mateo(jpmateo022@gmail.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-p-d-e-v%2Fcarapace_lb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj-p-d-e-v%2Fcarapace_lb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-p-d-e-v%2Fcarapace_lb/lists"}