Skip to content

Commit d1de509

Browse files
committed
Example of how a Kubernetes deployment with labels to appear in Kagenti UI
Signed-off-by: Ed Snible <snible@us.ibm.com>
1 parent 19e24ea commit d1de509

2 files changed

Lines changed: 141 additions & 1 deletion

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.venv
1+
.venv
2+
deployment
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Best practice to create a ServiceAccount for each agent to allow for more granular permissions if needed.
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: a2a-currency-converter
6+
namespace: team1
7+
---
8+
# Expose the A2A endpoint and Agent Card.
9+
apiVersion: v1
10+
kind: Service
11+
metadata:
12+
labels:
13+
app.kubernetes.io/managed-by: kagenti-e2e
14+
app.kubernetes.io/name: a2a-currency-converter
15+
# kagenti.io/type=agent is required for the Agent to be discovered by Kagenti and show up in the UI
16+
kagenti.io/type: agent
17+
protocol.kagenti.io/a2a: ""
18+
name: a2a-currency-converter
19+
namespace: team1
20+
spec:
21+
ports:
22+
- name: http
23+
port: 8080
24+
protocol: TCP
25+
targetPort: 8000
26+
selector:
27+
app.kubernetes.io/name: a2a-currency-converter
28+
kagenti.io/type: agent
29+
type: ClusterIP
30+
---
31+
# Deploy a test build of the Agent
32+
apiVersion: apps/v1
33+
kind: Deployment
34+
metadata:
35+
labels:
36+
app.kubernetes.io/component: agent
37+
app.kubernetes.io/managed-by: kagenti-e2e
38+
app.kubernetes.io/name: weather-service
39+
kagenti.io/framework: LangGraph
40+
kagenti.io/type: agent
41+
kagenti.io/workload-type: deployment
42+
protocol.kagenti.io/a2a: ""
43+
name: a2a-currency-converter
44+
namespace: team1
45+
spec:
46+
progressDeadlineSeconds: 600
47+
replicas: 1
48+
revisionHistoryLimit: 10
49+
selector:
50+
matchLabels:
51+
app.kubernetes.io/name: a2a-currency-converter
52+
kagenti.io/type: agent
53+
template:
54+
metadata:
55+
labels:
56+
app.kubernetes.io/name: a2a-currency-converter
57+
kagenti.io/framework: LangGraph
58+
kagenti.io/type: agent
59+
protocol.kagenti.io/a2a: ""
60+
spec:
61+
containers:
62+
- env:
63+
# Port to bind A2A server
64+
- name: PORT
65+
value: "8000"
66+
# Host to bind A2A server (0.0.0.0 means bind to all interfaces)
67+
- name: HOST
68+
value: 0.0.0.0
69+
# AGENT_ENDPOINT is the endpoint that appears on the Agent Card
70+
- name: AGENT_ENDPOINT
71+
value: http://a2a-currency-converter.team1.svc.cluster.local:8080/
72+
- name: OTEL_EXPORTER_OTLP_ENDPOINT
73+
value: http://otel-collector.kagenti-system.svc.cluster.local:8335
74+
- name: KEYCLOAK_URL
75+
value: http://keycloak.keycloak.svc.cluster.local:8080
76+
- name: UV_CACHE_DIR
77+
value: /app/.cache/uv
78+
# Many A2A agents call tools, and find them at this endpoint
79+
# - name: MCP_URL
80+
# value: http://weather-tool-mcp.team1.svc.cluster.local:8000/mcp
81+
# This is the LLM_API_BASE for ollama running on the host machine. In production, this would point to a real LLM API.
82+
- name: LLM_API_BASE
83+
value: http://host.docker.internal:11434/v1
84+
# This is a dummy key; if using a real LLM API use a real key
85+
- name: LLM_API_KEY
86+
value: dummy
87+
# This is a dummy key; if using OpenAI use a real key
88+
- name: OPENAI_API_KEY
89+
value: dummy
90+
- name: LLM_MODEL
91+
value: llama3.2:3b-instruct-fp16
92+
- name: GITHUB_SECRET_NAME
93+
value: github-token-secret
94+
# Pin to a specific version
95+
image: ghcr.io/kagenti/agent-examples/a2a_currency_converter:v0.1.0-alpha.1
96+
# Or use the latest version
97+
# image: ghcr.io/kagenti/agent-examples/a2a_currency_converter:latest
98+
imagePullPolicy: Always
99+
name: agent
100+
ports:
101+
- containerPort: 8000
102+
name: http
103+
protocol: TCP
104+
readinessProbe:
105+
failureThreshold: 12
106+
initialDelaySeconds: 5
107+
periodSeconds: 5
108+
successThreshold: 1
109+
tcpSocket:
110+
port: 8000
111+
timeoutSeconds: 1
112+
resources:
113+
limits:
114+
cpu: 500m
115+
memory: 1Gi
116+
requests:
117+
cpu: 100m
118+
memory: 256Mi
119+
terminationMessagePath: /dev/termination-log
120+
terminationMessagePolicy: File
121+
volumeMounts:
122+
# This is for agents that use uv and its dependency cache
123+
- mountPath: /app/.cache
124+
name: cache
125+
# Something like this is needed if the Agent has a Marvin dependency
126+
# - mountPath: /.marvin
127+
# name: marvin
128+
dnsPolicy: ClusterFirst
129+
restartPolicy: Always
130+
schedulerName: default-scheduler
131+
securityContext: {}
132+
serviceAccount: a2a-currency-converter
133+
serviceAccountName: a2a-currency-converter
134+
terminationGracePeriodSeconds: 30
135+
volumes:
136+
- emptyDir: {}
137+
name: cache
138+
- emptyDir: {}
139+
name: marvin

0 commit comments

Comments
 (0)