{"id":47914431,"url":"https://github.com/agentic-layer/tool-gateway-agentgateway","last_synced_at":"2026-04-04T05:29:54.583Z","repository":{"id":338033098,"uuid":"1156297421","full_name":"agentic-layer/tool-gateway-agentgateway","owner":"agentic-layer","description":"Operator that deploys ToolGateway instances based on agentgateway/kgateway","archived":false,"fork":false,"pushed_at":"2026-03-03T14:08:26.000Z","size":343,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-03T17:59:21.782Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/agentic-layer.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-12T13:46:24.000Z","updated_at":"2026-03-03T13:53:21.000Z","dependencies_parsed_at":"2026-02-14T00:00:20.979Z","dependency_job_id":null,"html_url":"https://github.com/agentic-layer/tool-gateway-agentgateway","commit_stats":null,"previous_names":["agentic-layer/tool-gateway-kgateway-operator","agentic-layer/tool-gateway-kgateway"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/agentic-layer/tool-gateway-agentgateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentic-layer%2Ftool-gateway-agentgateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentic-layer%2Ftool-gateway-agentgateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentic-layer%2Ftool-gateway-agentgateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentic-layer%2Ftool-gateway-agentgateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agentic-layer","download_url":"https://codeload.github.com/agentic-layer/tool-gateway-agentgateway/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentic-layer%2Ftool-gateway-agentgateway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31389276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-04-04T05:29:53.802Z","updated_at":"2026-04-04T05:29:54.572Z","avatar_url":"https://github.com/agentic-layer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tool Gateway agentgateway Operator\n\nThe Tool Gateway agentgateway Operator is a Kubernetes operator that manages `ToolGateway` instances based on [agentgateway](https://agentgateway.dev/). It provides centralized gateway management for tool workloads within the Agentic Layer ecosystem.\n\n## Table of Contents\n\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\n- [Development](#development)\n- [Configuration](#configuration)\n- [End-to-End (E2E) Testing](#end-to-end-e2e-testing)\n- [Testing Tools and Configuration](#testing-tools-and-configuration)\n- [Sample Data](#sample-data)\n- [Contribution](#contribution)\n\n----\n\n## Prerequisites\n\nBefore working with this project, ensure you have the following tools installed on your system:\n\n* **Go**: version 1.26.0 or higher\n* **Docker**: version 20.10+ (or a compatible alternative like Podman)\n* **kubectl**: The Kubernetes command-line tool\n* **kind**: For running Kubernetes locally in Docker\n* **helm**: Helm 3+ for installing agentgateway\n* **make**: The build automation tool\n\n----\n\n## Getting Started\n\n**Quick Start:**\n\n```shell\n# Create local cluster\nkind create cluster\n\n# Install required dependencies (cert-manager, Gateway API CRDs, agentgateway, agent-runtime)\nmake install-deps\n\n# Install the Tool Gateway operator\nkubectl apply -f https://github.com/agentic-layer/tool-gateway-agentgateway/releases/latest/download/install.yaml\n```\n\nTo remove all dependencies from the cluster again:\n\n```shell\nkubectl delete -f https://github.com/agentic-layer/tool-gateway-agentgateway/releases/latest/download/install.yaml\nmake uninstall-deps\n```\n\n## How it Works\n\nThe Tool Gateway agentgateway Operator creates and manages Gateway API resources based on ToolGateway and ToolServer custom resources:\n\n1. **Gateway Creation**: When a ToolGateway is created, the operator creates a dedicated Gateway with the same name in the same namespace as the ToolGateway with HTTP listener on port 80. Each ToolGateway has its own Gateway instance.\n\n2. **ToolServer Integration**: For each ToolServer resource, the operator creates:\n   - **AgentgatewayBackend**: Configures the MCP backend connection to the ToolServer\n   - **HTTPRoute**: Routes traffic from the gateway to the AgentgatewayBackend using path-based matching\n\n3. **Automatic Updates**: The operator watches for changes to ToolGateway and ToolServer resources and updates the corresponding Gateway API resources automatically.\n\n### Architecture\n\n```\nToolGateway (CRD)\n    |\nGateway (same name and namespace)\n    |\nHTTPRoute (Gateway API) -\u003e AgentgatewayBackend -\u003e ToolServer\n```\n\n## Development\n\nFollow the prerequisites above to set up your local environment.\nThen follow these steps to build and deploy the operator locally:\n\n```shell\n# Install CRDs into the cluster\nmake install\n# Build docker image\nmake docker-build\n# Load image into kind cluster (not needed if using local registry)\nmake kind-load\n# Deploy the operator to the cluster\nmake deploy\n```\n\nAfter a successful start, you should see the controller manager pod running in the `tool-gateway-agentgateway-system` namespace.\n\n```bash\nkubectl get pods -n tool-gateway-agentgateway-system\n```\n\n## Configuration\n\n### Prerequisites for ToolGateway\n\nBefore creating a ToolGateway, ensure you have:\n\n1. **Gateway API CRDs** installed in your cluster\n2. **agentgateway support** installed (see [Getting Started](#getting-started))\n\n### ToolGateway Configuration\n\nTo create a agentgateway-based gateway for your tools, define a `ToolGateway` resource:\n\n```yaml\napiVersion: runtime.agentic-layer.ai/v1alpha1\nkind: ToolGateway\nmetadata:\n  name: my-tool-gateway\n  namespace: my-namespace\nspec:\n  toolGatewayClassName: agentgateway  # Optional: uses default if not specified\n```\n\nThis will create a `my-tool-gateway` Gateway in the `my-namespace` namespace.\n\n#### OpenTelemetry (OTEL) Configuration\n\nThe operator automatically translates standard OpenTelemetry environment variables to agentgateway's telemetry configuration. This provides seamless observability integration without requiring manual configuration of agentgateway's config file.\n\n**Supported OTEL Environment Variables:**\n\n- `OTEL_EXPORTER_OTLP_ENDPOINT` - The OTLP exporter endpoint URL\n- `OTEL_EXPORTER_OTLP_PROTOCOL` - The protocol to use (grpc or http)\n- `OTEL_EXPORTER_OTLP_HEADERS` - Headers to send with telemetry data\n- Signal-specific overrides:\n  - `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`\n  - `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`\n  - `OTEL_EXPORTER_OTLP_TRACES_HEADERS`\n  - (Similar for METRICS and LOGS)\n\n**Example:**\n\n```yaml\napiVersion: runtime.agentic-layer.ai/v1alpha1\nkind: ToolGateway\nmetadata:\n  name: my-tool-gateway\n  namespace: my-namespace\nspec:\n  toolGatewayClassName: agentgateway\n  env:\n    # OTEL configuration - automatically translated to agentgateway config\n    - name: OTEL_EXPORTER_OTLP_ENDPOINT\n      value: \"http://otel-collector:4318\"\n    - name: OTEL_EXPORTER_OTLP_PROTOCOL\n      value: \"http/protobuf\"\n    - name: OTEL_EXPORTER_OTLP_HEADERS\n      value: \"api-key=secret123\"\n    \n    # Other environment variables are passed through as-is\n    - name: LOG_LEVEL\n      value: \"info\"\n```\n\nThe OTEL environment variables are translated to agentgateway's `rawConfig.telemetry` section and are **not** passed as environment variables to the agentgateway container. Other environment variables (like `LOG_LEVEL` above) are passed through unchanged.\n\nSee `config/samples/toolgateway_v1alpha1_otel_example.yaml` for complete examples.\n\n### ToolServer Configuration\n\nDefine ToolServer resources that the gateway will route to:\n\n```yaml\napiVersion: runtime.agentic-layer.ai/v1alpha1\nkind: ToolServer\nmetadata:\n  name: my-tool-server\n  namespace: my-namespace\nspec:\n  protocol: mcp\n  transportType: http\n  image: my-tool-server:latest\n  port: 8000\n  path: /mcp\n  replicas: 1\n```\n\nThe operator will automatically create:\n- An **AgentgatewayBackend** for the ToolServer\n- An **HTTPRoute** connecting the Gateway to the backend\n\n### Accessing Your Tools\n\nOnce deployed, tools are accessible via the ToolGateway's Gateway:\n\n```shell\n# Get the Gateway service endpoint (example for 'my-tool-gateway')\nkubectl get svc -n my-namespace | grep my-tool-gateway\n\n# Access your tool via the gateway\ncurl http://\u003cgateway-endpoint\u003e/mcp\n```\n\n## End-to-End (E2E) Testing\n\n### Prerequisites for E2E Tests\n\n- **kind** must be installed and available in PATH\n- **Docker** running and accessible\n- **kubectl** configured and working\n\n### Running E2E Tests\n\nThe E2E tests automatically create an isolated Kind cluster, deploy the operator, run comprehensive tests, and clean up afterwards.\n\n```bash\n# Run complete E2E test suite\nmake test-e2e\n```\n\n### Manual E2E Test Setup\n\nIf you need to run E2E tests manually or inspect the test environment:\n\n```bash\n# Set up test cluster\nmake setup-test-e2e\n\n# Install required dependencies\nmake install-deps\n\n# Run E2E tests against the existing cluster\nKIND_CLUSTER=tool-gateway-agentgateway-test-e2e go test ./test/e2e/ -v -ginkgo.v\n\n# Clean up test cluster when done\nmake cleanup-test-e2e\n```\n\n## Testing Tools and Configuration\n\nThe project includes comprehensive test coverage:\n\n- **Unit Tests**: Test suite for the controller\n- **E2E Tests**: End-to-end tests in Kind cluster\n- **Ginkgo/Gomega**: BDD-style testing framework\n- **EnvTest**: Kubernetes API server testing environment\n\nRun tests with:\n\n```bash\n# Run unit and integration tests\nmake test\n\n# Run E2E tests in kind cluster\nmake test-e2e\n```\n\n## Sample Data\n\nThe project includes sample manifests to help you get started.\n\n  * **Where to find sample data?**\n    Sample manifests are located in the `config/samples/` directory.\n\n  * **How to deploy sample resources?**\n    You can deploy sample ToolGateway resources with:\n\n    ```bash\n    kubectl apply -k config/samples/\n    ```\n\n## Contribution\n\nSee [Contribution Guide](https://github.com/agentic-layer/tool-gateway-agentgateway?tab=contributing-ov-file) for details on contribution, and the process for submitting pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentic-layer%2Ftool-gateway-agentgateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagentic-layer%2Ftool-gateway-agentgateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentic-layer%2Ftool-gateway-agentgateway/lists"}