Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:A2aproject A2a java K8s Manifest Patterns

From Leeroopedia
Knowledge Sources
Domains Cloud_Native, Infrastructure_as_Code
Last Updated 2026-10-29 00:00 GMT

Overview

Pattern documentation for the Kubernetes YAML manifests that define the cloud deployment topology for A2A agents: namespace, PostgreSQL StatefulSet, Strimzi Kafka cluster, Kafka topic, agent ConfigMap, and agent Deployment with Service.

Description

The cloud deployment example includes six Kubernetes manifest files under `examples/cloud-deployment/k8s/` that define the complete infrastructure:

  1. `00-namespace.yaml` — Creates the `a2a-demo` namespace
  2. `01-postgres.yaml` — PostgreSQL StatefulSet with Service, configured with database `a2a`, user/password from secrets, port 5432
  3. `02-kafka.yaml` — Strimzi Kafka cluster (`a2a-kafka`) with 1 ZNode, using ephemeral storage
  4. `03-kafka-topic.yaml` — Kafka topic `a2a-events` with 3 partitions and replication factor 1
  5. `04-agent-configmap.yaml` — Agent configuration: database URL, Kafka bootstrap servers, protocol settings
  6. `05-agent-deployment.yaml` — Agent Deployment with 3 replicas, Service (ClusterIP + NodePort 8080), Downward API for `POD_NAME`

This is a Pattern Doc documenting the Kubernetes manifest structure for A2A agent cloud deployment.

Usage

  • Infrastructure provisioning: Apply manifests via `kubectl apply -f`
  • Customization: Modify replica counts, database credentials, Kafka settings for different environments
  • Template: Use as a starting point for production A2A agent deployments

Code Reference

Source Location

  • Repository: a2a-java
  • Files:
    • `examples/cloud-deployment/k8s/00-namespace.yaml` (L1-4)
    • `examples/cloud-deployment/k8s/01-postgres.yaml` (L1-74)
    • `examples/cloud-deployment/k8s/02-kafka.yaml` (L1-65)
    • `examples/cloud-deployment/k8s/03-kafka-topic.yaml` (L1-16)
    • `examples/cloud-deployment/k8s/04-agent-configmap.yaml` (L1-11)
    • `examples/cloud-deployment/k8s/05-agent-deployment.yaml` (L1-96)

Agent Deployment Manifest

apiVersion: apps/v1
kind: Deployment
metadata:
  name: a2a-agent
  namespace: a2a-demo
spec:
  replicas: 3  # Three pods for load balancing
  selector:
    matchLabels:
      app: a2a-agent
  template:
    spec:
      containers:
        - name: a2a-agent
          image: localhost:5001/a2a-agent:latest
          env:
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name  # Downward API
            # Database and Kafka config from ConfigMap
          ports:
            - containerPort: 9999  # JSON-RPC
            - containerPort: 9000  # gRPC
            - containerPort: 8080  # HTTP

---
apiVersion: v1
kind: Service
metadata:
  name: a2a-agent
  namespace: a2a-demo
spec:
  type: NodePort
  ports:
    - port: 8080
      nodePort: 8080
  selector:
    app: a2a-agent

Strimzi Kafka Cluster

apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
  name: a2a-kafka
  namespace: a2a-demo
spec:
  kafka:
    replicas: 1
    listeners:
      - name: plain
        port: 9092
        type: internal
    storage:
      type: ephemeral
  zookeeper:
    replicas: 1
    storage:
      type: ephemeral

Usage Examples

Apply All Manifests

kubectl apply -f k8s/00-namespace.yaml
kubectl apply -f k8s/01-postgres.yaml
kubectl apply -f k8s/02-kafka.yaml
kubectl apply -f k8s/03-kafka-topic.yaml
kubectl apply -f k8s/04-agent-configmap.yaml
kubectl apply -f k8s/05-agent-deployment.yaml

Check Deployment Status

kubectl get pods -n a2a-demo -l app=a2a-agent
# NAME                         READY   STATUS
# a2a-agent-xxx-aaa            1/1     Running
# a2a-agent-xxx-bbb            1/1     Running
# a2a-agent-xxx-ccc            1/1     Running

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment