Skip to content

Commit e68cadf

Browse files
refactor(api): Rename A2A Custom Resource Definition to Agent (#36)
* chore(refactor): Remove old A2A files as part of rename to Agent * chore(refactor): Remove old A2A sample and example files * feat(api): Rename A2A Custom Resource Definition to Agent This major refactoring renames the A2A (Agent-to-Agent) CRD to simply "Agent" for better usability and intuitive kubectl commands. ## Changes Made: ### API Types - Renamed `A2ASpec` → `AgentSpec` - Renamed `A2AStatus` → `AgentStatus` - Renamed `A2A` → `Agent` - Renamed `A2AList` → `AgentList` - Renamed Gateway field `A2A` → `Agents` - Renamed all A2A-related types to Agent equivalents ### Controllers - Renamed `A2AReconciler` → `AgentReconciler` - Updated all controller logic to use new Agent types - Updated RBAC permissions from `a2as` to `agents` ### Examples & Samples - Updated example files to use `kind: Agent` - Renamed example files for clarity - Updated Gateway examples to use `agents:` field ### Generated Files - Regenerated DeepCopy methods for new API types - Updated CRDs and manifests - Updated RBAC permissions ## Breaking Changes This is a breaking change that requires existing A2A resources to be migrated. Users can now run `kubectl get agents` instead of `kubectl get a2as`. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>" * refactor(api): Run task manifests Signed-off-by: Eden Reich <eden.reich@gmail.com> * chore(api): Ensure newline at end of file in gateway-agent-service-discovery.yaml Signed-off-by: Eden Reich <eden.reich@gmail.com> * refactor(api): Rename A2A configuration and update related references Signed-off-by: Eden Reich <eden.reich@gmail.com> * refactor(api): Keep the gateway attribute called a2a It makes sense because it just registers those agents and knowing what protocol to use mcp or a2a then makes a lot of sense in the Gateway context. Signed-off-by: Eden Reich <eden.reich@gmail.com> * refactor(api): Simplify environment variable definitions in agent-server.yaml Signed-off-by: Eden Reich <eden.reich@gmail.com> --------- Signed-off-by: Eden Reich <eden.reich@gmail.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent dd77567 commit e68cadf

24 files changed

Lines changed: 456 additions & 482 deletions

CLAUDE.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,19 @@ All commands use the Task runner. Common development tasks:
3535
## Architecture
3636

3737
### Custom Resources
38+
3839
- **Gateway** (`api/v1alpha1/gateway_types.go`) - Core inference gateway deployment with AI provider integration, authentication, observability, and networking
39-
- **A2A** (`api/v1alpha1/a2a_types.go`) - Agent-to-Agent communication servers
40+
- **Agent** (`api/v1alpha1/agent_types.go`) - Agent-to-Agent communication servers
4041
- **MCP** (`api/v1alpha1/mcp_types.go`) - Model Context Protocol servers
4142

4243
### Controllers
44+
4345
- **Gateway Controller** (`internal/controller/gateway_controller.go`) - Manages Gateway deployments, services, configmaps, and HPA
44-
- **A2A Controller** (`internal/controller/a2a_controller.go`) - Manages A2A server deployments
46+
- **Agent Controller** (`internal/controller/agent_controller.go`) - Manages Agent server deployments
4547
- **MCP Controller** (`internal/controller/mcp_controller.go`) - Manages MCP server deployments
4648

4749
### Key Directories
50+
4851
- `api/v1alpha1/` - API type definitions and generated code
4952
- `internal/controller/` - Controller implementations and tests
5053
- `config/` - Kubernetes manifests (CRDs, RBAC, deployments)
@@ -54,11 +57,13 @@ All commands use the Task runner. Common development tasks:
5457
## Testing
5558

5659
### Unit Tests
60+
5761
- Use table-driven testing pattern
5862
- Each test case should have isolated mock dependencies
5963
- Run with `task test` (requires envtest setup)
6064

6165
### E2E Tests
66+
6267
- Located in `test/e2e/`
6368
- Requires k3d cluster managed by ctlptl
6469
- Uses Ginkgo testing framework
@@ -76,20 +81,23 @@ All commands use the Task runner. Common development tasks:
7681
## Deployment
7782

7883
### Local Development
84+
7985
- `task install` - Install CRDs to cluster
8086
- `task deploy` - Build and deploy operator to k3d cluster
8187
- `task undeploy` - Remove operator from cluster
8288
- `task uninstall` - Remove CRDs from cluster
8389

8490
### Cluster Management
91+
8592
- `task cluster:create` - Create local k3d cluster with cert-manager and nginx-ingress
8693
- `task cluster:delete` - Delete local cluster
8794

8895
## Generated Files
8996

9097
The following files are auto-generated and should not be edited manually:
98+
9199
- `api/v1alpha1/zz_generated.deepcopy.go` - Generated by `task generate`
92100
- `config/crd/bases/*.yaml` - Generated by `task manifests`
93101
- `manifests/*.yaml` - Generated by `task manifests`
94102

95-
Always run `task generate` and `task manifests` after modifying API types or controller RBAC annotations.
103+
Always run `task generate` and `task manifests` after modifying API types or controller RBAC annotations.

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,8 @@ spec:
501501
# Service Discovery Configuration
502502
serviceDiscovery:
503503
enabled: true
504-
namespace: "agents" # Namespace to search for A2A agents
505-
labelSelector: "inference-gateway.com/a2a-agent=true" # Label selector for agent discovery
506-
pollingInterval: "30s" # How often to check for new agents
504+
namespace: "agents" # Namespace to search for A2A agents
505+
pollingInterval: "30s" # How often to check for new agents
507506
# Manual agents can still be configured alongside service discovery
508507
agents:
509508
- name: static-agent
@@ -528,8 +527,6 @@ kind: Service
528527
metadata:
529528
name: my-agent
530529
namespace: agents
531-
labels:
532-
inference-gateway.com/a2a-agent: "true" # Required for discovery
533530
spec:
534531
# Service configuration
535532
```
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ import (
3030
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3131
)
3232

33-
// A2ASpec defines the desired state of A2A.
34-
type A2ASpec struct {
35-
Image string `json:"image"`
36-
Timezone string `json:"timezone"`
37-
Port int32 `json:"port"`
38-
Host string `json:"host"`
39-
ReadTimeout string `json:"readTimeout"`
40-
WriteTimeout string `json:"writeTimeout"`
41-
IdleTimeout string `json:"idleTimeout"`
42-
Logging LoggingSpec `json:"logging"`
43-
Telemetry TelemetrySpec `json:"telemetry"`
44-
Queue QueueSpec `json:"queue"`
45-
TLS TLSSpec `json:"tls"`
46-
Agent AgentSpec `json:"agent"`
33+
// AgentSpec defines the desired state of Agent.
34+
type AgentSpec struct {
35+
Image string `json:"image"`
36+
Timezone string `json:"timezone"`
37+
Port int32 `json:"port"`
38+
Host string `json:"host"`
39+
ReadTimeout string `json:"readTimeout"`
40+
WriteTimeout string `json:"writeTimeout"`
41+
IdleTimeout string `json:"idleTimeout"`
42+
Logging LoggingSpec `json:"logging"`
43+
Telemetry TelemetrySpec `json:"telemetry"`
44+
Queue QueueSpec `json:"queue"`
45+
TLS TLSSpec `json:"tls"`
46+
Agent AgentConfigSpec `json:"agent"`
4747

4848
// Environment variables for the provider
4949
// +optional
@@ -66,7 +66,7 @@ type TLSSpec struct {
6666
SecretRef string `json:"secretRef"`
6767
}
6868

69-
type AgentSpec struct {
69+
type AgentConfigSpec struct {
7070
Enabled bool `json:"enabled"`
7171
TLS TLSSpec `json:"tls"`
7272
MaxConversationHistory int32 `json:"maxConversationHistory"`
@@ -152,7 +152,7 @@ type Card struct {
152152
DefaultInputModes []string `json:"defaultInputModes"`
153153
DefaultOutputModes []string `json:"defaultOutputModes"`
154154

155-
// DocumentationURL is an optional field that provides a URL to the documentation for the A2A.
155+
// DocumentationURL is an optional field that provides a URL to the documentation for the Agent.
156156
// +optional
157157
DocumentationURL string `json:"documentationUrl,omitempty"`
158158

@@ -169,8 +169,8 @@ type CapabilitiesSpec struct {
169169
StateTransitionHistory bool `json:"stateTransitionHistory"`
170170
}
171171

172-
// A2AStatus defines the observed state of A2A.
173-
type A2AStatus struct {
172+
// AgentStatus defines the observed state of Agent.
173+
type AgentStatus struct {
174174
// ObservedGeneration is the most recent generation observed for this resource.
175175
// +optional
176176
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
@@ -184,38 +184,38 @@ type A2AStatus struct {
184184
// +optional
185185
Ready bool `json:"ready,omitempty"`
186186

187-
// Card indicates the version of the A2A resource.
187+
// Card indicates the version of the Agent resource.
188188
// +optional
189189
Card Card `json:"card,omitempty"`
190190
}
191191

192-
// +kubebuilder:printcolumn:name="VERSION",type=string,JSONPath=".status.card.version",description="Version of the A2A resource"
193-
// +kubebuilder:printcolumn:name="URL",type=string,JSONPath=".status.card.url",description="URL of the A2A resource"
194-
// +kubebuilder:printcolumn:name="STREAMING",type=string,JSONPath=".status.card.capabilities.streaming",description="Streaming Capability of the A2A resource"
195-
// +kubebuilder:printcolumn:name="PUSH NOTIFICATIONS",type=string,JSONPath=".status.card.capabilities.pushNotifications",description="Push Notifications Capability of the A2A resource"
196-
// +kubebuilder:printcolumn:name="STATE TRANSITION HISTORY",type=string,JSONPath=".status.card.capabilities.stateTransitionHistory",description="State Transition History Capability of the A2A resource"
192+
// +kubebuilder:printcolumn:name="VERSION",type=string,JSONPath=".status.card.version",description="Version of the Agent resource"
193+
// +kubebuilder:printcolumn:name="URL",type=string,JSONPath=".status.card.url",description="URL of the Agent resource"
194+
// +kubebuilder:printcolumn:name="STREAMING",type=string,JSONPath=".status.card.capabilities.streaming",description="Streaming Capability of the Agent resource"
195+
// +kubebuilder:printcolumn:name="PUSH NOTIFICATIONS",type=string,JSONPath=".status.card.capabilities.pushNotifications",description="Push Notifications Capability of the Agent resource"
196+
// +kubebuilder:printcolumn:name="STATE TRANSITION HISTORY",type=string,JSONPath=".status.card.capabilities.stateTransitionHistory",description="State Transition History Capability of the Agent resource"
197197
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp",description="Age of the resource"
198198
// +kubebuilder:object:root=true
199199
// +kubebuilder:subresource:status
200200

201-
// A2A is the Schema for the a2as API.
202-
type A2A struct {
201+
// Agent is the Schema for the agents API.
202+
type Agent struct {
203203
metav1.TypeMeta `json:",inline"`
204204
metav1.ObjectMeta `json:"metadata,omitempty"`
205205

206-
Spec A2ASpec `json:"spec,omitempty"`
207-
Status A2AStatus `json:"status,omitempty"`
206+
Spec AgentSpec `json:"spec,omitempty"`
207+
Status AgentStatus `json:"status,omitempty"`
208208
}
209209

210210
// +kubebuilder:object:root=true
211211

212-
// A2AList contains a list of A2A.
213-
type A2AList struct {
212+
// AgentList contains a list of Agent.
213+
type AgentList struct {
214214
metav1.TypeMeta `json:",inline"`
215215
metav1.ListMeta `json:"metadata,omitempty"`
216-
Items []A2A `json:"items"`
216+
Items []Agent `json:"items"`
217217
}
218218

219219
func init() {
220-
SchemeBuilder.Register(&A2A{}, &A2AList{})
220+
SchemeBuilder.Register(&Agent{}, &AgentList{})
221221
}

api/v1alpha1/gateway_types.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,31 +367,31 @@ type A2AServersSpec struct {
367367

368368
// A2A client timeouts
369369
// +optional
370-
Timeouts *A2ATimeouts `json:"timeouts,omitempty"`
370+
Timeouts *AgentTimeouts `json:"timeouts,omitempty"`
371371

372372
// Polling configuration
373373
// +optional
374-
Polling *A2APolling `json:"polling,omitempty"`
374+
Polling *AgentPolling `json:"polling,omitempty"`
375375

376376
// Service Discovery configuration
377377
// +optional
378-
ServiceDiscovery *A2AServiceDiscovery `json:"serviceDiscovery,omitempty"`
378+
ServiceDiscovery *AgentServiceDiscovery `json:"serviceDiscovery,omitempty"`
379379

380380
// A2A agents configuration
381381
// +optional
382-
Agents []A2AAgent `json:"agents,omitempty"`
382+
Agents []AgentServer `json:"agents,omitempty"`
383383
}
384384

385385
// A2ATimeouts contains timeout configurations for A2A
386-
type A2ATimeouts struct {
386+
type AgentTimeouts struct {
387387
// Client timeout
388388
// +optional
389389
// +kubebuilder:default="60s"
390390
Client string `json:"client,omitempty"`
391391
}
392392

393393
// A2APolling contains polling configuration for A2A
394-
type A2APolling struct {
394+
type AgentPolling struct {
395395
// Enable polling
396396
// +optional
397397
// +kubebuilder:default=true
@@ -416,7 +416,7 @@ type A2APolling struct {
416416
}
417417

418418
// A2AServiceDiscovery contains service discovery configuration for A2A
419-
type A2AServiceDiscovery struct {
419+
type AgentServiceDiscovery struct {
420420
// Enable service discovery
421421
// +optional
422422
// +kubebuilder:default=false
@@ -434,7 +434,7 @@ type A2AServiceDiscovery struct {
434434
}
435435

436436
// A2AAgent contains A2A agent configuration
437-
type A2AAgent struct {
437+
type AgentServer struct {
438438
// Agent name
439439
// +kubebuilder:validation:Required
440440
Name string `json:"name"`

0 commit comments

Comments
 (0)