feat: IPv6 dual-stack support for server bind addresses#864
feat: IPv6 dual-stack support for server bind addresses#864soheilkhan wants to merge 2 commits intoagentic-community:mainfrom
Conversation
|
Thanks for the PR, @soheilkhan! Great work enabling IPv6 dual-stack support. The approach of using Requesting the following changes before merge: 1. Add
|
…unity#863) Change default bind address from 0.0.0.0/127.0.0.1 to :: (dual-stack) across all server components, enabling deployment on IPv6-only Kubernetes clusters (e.g. EKS in hybrid VPC where pods have only IPv6 addresses). Binding to :: on Linux accepts both IPv4 and IPv6 connections by default, so existing IPv4-only deployments continue to work without changes. Closes agentic-community#863 Made-with: Cursor
Document BIND_HOST, expose bind host in Helm and Terraform ECS, keep local CurrentTime binds on localhost by default, and show bind_host in the admin configuration panel. Made-with: Cursor
663ebfb to
189133c
Compare
|
Thanks for the review. Updated in commit Checklist:
Validation run:
Note: |
Summary
Resolves #863
All server components currently hard-code their bind address to
0.0.0.0or default to127.0.0.1, which prevents deployment on IPv6-only Kubernetes clusters (e.g. EKS in a hybrid VPC where pods are assigned only IPv6 addresses).This PR makes deployment bind addresses configurable and uses
::(dual-stack) for containerized/managed deployments. On Linux,::accepts both IPv4 and IPv6 connections by default (via IPv4-mapped IPv6 addresses), so existing IPv4-only deployments continue to work without any changes.Changes
registry/core/config.pybind_host: str = "::"setting (configurable viaBIND_HOSTenv var)registry/main.pysettings.bind_hostinstead of hardcoded127.0.0.1docker/registry-entrypoint.shBIND_HOSTenv var with::default, passed to uvicorndocker/auth-entrypoint.shBIND_HOSTpattern for the auth server.env.exampleBIND_HOSTand the Linux dual-stack assumptioncharts/mcpgw/values.yamlapp.bindHost: "::"charts/mcpgw/templates/deployment.yamlHOSTfromapp.bindHostinstead of hardcoding itservers/currenttime/server.py127.0.0.1; Docker/Helm/ECS can setHOST=::explicitlyterraform/aws-ecs/*bind_hostvariable and passesBIND_HOST/HOSTto ECS servicesregistry/api/config_routes.pybind_hostin the admin config panelBackward compatibility
::on Linux is dual-stack by default (net.ipv6.bindv6only=0on all major distros) -- IPv4 clients continue to connect normallynet.ipv6.bindv6only=1, IPv4 clients will not reach services bound only to::; operators can setBIND_HOST=0.0.0.0orHOST=0.0.0.0for IPv4-only bindingBIND_HOST,HOST) or Helm/Terraform valuesipFamilies/ipFamilyPolicyis handled by VPC CNI)ipaddress.ip_address()) and IP anonymization already handle IPv6Test plan
python3 -m py_compile registry/core/config.py registry/main.py servers/currenttime/server.py registry/api/config_routes.pybash -n docker/registry-entrypoint.sh docker/auth-entrypoint.shterraform fmt -check terraform/aws-ecs/variables.tf terraform/aws-ecs/main.tf terraform/aws-ecs/modules/mcp-gateway/variables.tf terraform/aws-ecs/modules/mcp-gateway/ecs-services.tfhelm template mcpgw charts/mcpgw --set app.secretKey=test-secretrendersHOSTas::