{"id":40111101,"url":"https://github.com/agentic-layer/agent-gateway-krakend-operator","last_synced_at":"2026-04-27T10:00:28.454Z","repository":{"id":316721553,"uuid":"1061729798","full_name":"agentic-layer/agent-gateway-krakend-operator","owner":"agentic-layer","description":"The krakend operator implementation of the Agentic Layer AgentGateway","archived":false,"fork":false,"pushed_at":"2026-04-17T05:49:43.000Z","size":289,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-17T07:33:33.750Z","etag":null,"topics":["agentic-ai","kubernetes","microservice","operator","operator-sdk"],"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/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":"2025-09-22T09:58:53.000Z","updated_at":"2026-04-17T05:49:13.000Z","dependencies_parsed_at":"2026-01-19T12:00:17.779Z","dependency_job_id":null,"html_url":"https://github.com/agentic-layer/agent-gateway-krakend-operator","commit_stats":null,"previous_names":["agentic-layer/agent-gateway-krakend-operator"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/agentic-layer/agent-gateway-krakend-operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentic-layer%2Fagent-gateway-krakend-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentic-layer%2Fagent-gateway-krakend-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentic-layer%2Fagent-gateway-krakend-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentic-layer%2Fagent-gateway-krakend-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agentic-layer","download_url":"https://codeload.github.com/agentic-layer/agent-gateway-krakend-operator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentic-layer%2Fagent-gateway-krakend-operator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32331305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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":["agentic-ai","kubernetes","microservice","operator","operator-sdk"],"created_at":"2026-01-19T12:00:13.734Z","updated_at":"2026-04-27T10:00:28.355Z","avatar_url":"https://github.com/agentic-layer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agent Gateway KrakenD Operator\n\nThe Agent Gateway KrakenD Operator is a specialized Kubernetes operator that provides a KrakenD-based Agent gateway implementation for the Agent Runtime Operator ecosystem. It manages `AgentGateway` resources and automatically generates KrakenD configurations to expose Agent workloads through a unified gateway interface.\n\nThis operator works as a companion to the [Agent Runtime Operator](https://github.com/agentic-layer/agent-runtime-operator) and implements the `AgentGatewayClass` controller pattern to provide centralized gateway management for agentic workloads.\n\n## Table of Contents\n\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\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\n**IMPORTANT: The Agent Runtime Operator must be installed before deploying this operator.**\n\nThis operator depends on the Agent Runtime Operator to provide `Agent`, `AgentGateway`, and `AgentGatewayClass` Custom Resource Definitions (CRDs). Please install and configure the Agent Runtime Operator first by following the instructions in the [Agent Runtime Operator repository](https://github.com/agentic-layer/agent-runtime-operator).\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* **make**: The build automation tool\n\n----\n\n## Getting Started\n\n📖 **For detailed setup instructions**, see our [Getting Started guide](https://docs.agentic-layer.ai/agent-gateway-krakend-operator/) in the documentation.\n\n**Quick Start:**\n\n\u003e **Note:** This operator requires the [Agent Runtime Operator](https://github.com/agentic-layer/agent-runtime-operator) to be installed first, as it provides the required CRDs (`AgentGateway` and `AgentGatewayClass`).\n\n```shell\n# Create local cluster and install cert-manager\nkind create cluster\nkubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.19.1/cert-manager.yaml\n\n# Install the Agent Runtime Operator (provides CRDs)\nkubectl apply -f https://github.com/agentic-layer/agent-runtime-operator/releases/latest/download/install.yaml\n\n# Install the Agent Gateway operator\nkubectl apply -f  https://github.com/agentic-layer/agent-gateway-krakend-operator/releases/latest/download/install.yaml\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 `agent-gateway-krakend-operator-system` namespace.\n\n```bash\nkubectl get pods -n agent-gateway-krakend-operator-system\n```\n\n## Configuration\n\n### AgentGateway Configuration\n\nTo create a KrakenD-based gateway for your agents, define an `AgentGateway` resource:\n\n```yaml\napiVersion: runtime.agentic-layer.ai/v1alpha1\nkind: AgentGateway\nmetadata:\n  labels:\n    app.kubernetes.io/name: agent-gateway-krakend-operator\n    app.kubernetes.io/managed-by: kustomize\n  name: my-agent-gateway\nspec:\n  agentGatewayClassName: krakend  # Optional: specify controller responsibility\n  replicas: 2  # Number of gateway replicas (optional, default: 1)\n  timeout: \"30000ms\"  # Request timeout (optional, default: 60000ms)\n```\n\n### Agent Integration\n\nThe gateway automatically discovers and configures endpoints for `Agent` resources that have `exposed: true`:\n\n```yaml\napiVersion: runtime.agentic-layer.ai/v1alpha1\nkind: Agent\nmetadata:\n  name: weather-agent\nspec:\n  framework: google-adk\n  image: eu.gcr.io/agentic-layer/weather-agent:0.3.0\n  exposed: true  # This agent will be included in the gateway configuration\n  protocols:\n    - type: A2A\n```\n\nThe operator will:\n1. Discover all exposed agents across all namespaces\n2. Generate KrakenD endpoint configurations for each agent\n3. Create a ConfigMap with the complete KrakenD configuration\n4. Deploy a KrakenD deployment that serves the unified gateway\n5. Create a ServiceAccount for the gateway deployment\n\n**Endpoint Routing:**\n\nEach exposed agent gets endpoints in two formats:\n- **Namespaced** (always): `/{namespace}/{agent-name}` and `/{namespace}/{agent-name}/.well-known/agent-card.json`\n- **Shorthand** (when unique): `/{agent-name}` and `/{agent-name}/.well-known/agent-card.json`\n\nShorthand endpoints are only created when the agent name is unique across all namespaces. This prevents conflicts while providing convenience for uniquely-named agents.\n\nThe gateway also provides OpenAI-compatible endpoints:\n- `GET /models` - List all exposed agents\n- `POST /chat/completions` - Chat with agents using the `model` parameter for routing\n\n### Default AgentGatewayClass\n\nThe operator installs a `AgentGatewayClass` resource:\n\n```yaml\napiVersion: runtime.agentic-layer.ai/v1alpha1\nkind: AgentGatewayClass\nmetadata:\n  name: krakend\nspec:\n  controller: runtime.agentic-layer.ai/agent-gateway-controller\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\nThe E2E test suite includes:\n- Operator deployment verification\n- CRD installation testing\n- Webhook functionality testing\n- Certificate management verification\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 (will create 'ai-gateway-litellm-test-e2e' cluster)\nmake setup-test-e2e\n```\n```bash\n# Run E2E tests against the existing cluster\nKIND_CLUSTER=ai-gateway-litellm-test-e2e go test ./test/e2e/ -v -ginkgo.v\n```\n```bash\n# Clean up test cluster when done\nmake cleanup-test-e2e\n```\n\n### E2E Test Coverage\n\n**E2E Test Features:**\n- OpenAI API `/models` and `/chat/completions` endpoints\n- Unique agent routing\n- Namespace conflict resolution\n- Agent gateway deployment verification\n- KrakenD configuration generation\n\n## Testing Tools and Configuration\n\nThe project includes comprehensive test coverage:\n\n- **Unit Tests**: Complete test suite for the controller with AgentGatewayClass responsibility checks\n- **Integration Tests**: Tests for Agent discovery and KrakenD configuration generation\n- **E2E Tests**: End-to-end tests for OpenAI API flows and namespace conflict resolution\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 AgentGateway resources with:\n\n    ```bash\n    kubectl apply -k config/samples/\n    ```\n\n  * **How to verify the sample gateway?**\n    After applying the sample, check the created resources:\n\n    ```bash\n    # Check the gateway status\n    kubectl get agentgateways -o yaml\n\n    # Check the KrakenD deployment\n    kubectl get deployments -l provider=krakend\n\n    # Check the generated configuration\n    kubectl get configmaps -l provider=krakend\n    ```\n\n\n\n## Contribution\n\nSee [Contribution Guide](https://github.com/agentic-layer/agent-runtime-krakend-operator?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%2Fagent-gateway-krakend-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagentic-layer%2Fagent-gateway-krakend-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentic-layer%2Fagent-gateway-krakend-operator/lists"}