Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions helm/kagent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,14 @@ Validate controller configuration
{{- fail "ERROR: controller.replicas cannot be greater than 1 when database.type is 'sqlite' as the SQLite database is local to the pod. Please either set controller.replicas to 1 or change database.type to 'postgres'." }}
{{- end -}}
{{- end -}}

{{/*
A2A Base URL - computes the default URL based on the controller service name if not explicitly set
*/}}
{{- define "kagent.a2aBaseUrl" -}}
{{- if .Values.controller.a2aBaseUrl -}}
{{- .Values.controller.a2aBaseUrl -}}
{{- else -}}
{{- printf "http://%s-controller.%s.svc.cluster.local:%d" (include "kagent.fullname" .) (include "kagent.namespace" .) (.Values.controller.service.ports.port | int) -}}
{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions helm/kagent/templates/controller-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
labels:
{{- include "kagent.controller.labels" . | nindent 4 }}
data:
A2A_BASE_URL: {{ include "kagent.a2aBaseUrl" . | quote }}
DATABASE_TYPE: {{ .Values.database.type | quote }}
DEFAULT_MODEL_CONFIG_NAME: {{ include "kagent.defaultModelConfigName" . | quote }}
IMAGE_PULL_POLICY: {{ .Values.controller.agentImage.pullPolicy | default .Values.imagePullPolicy | quote }}
Expand Down
17 changes: 17 additions & 0 deletions helm/kagent/tests/controller-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ tests:
path: spec.template.spec.containers[0].ports[0].containerPort
value: 8083

- it: should set A2A_BASE_URL with computed default value
template: controller-configmap.yaml
asserts:
- equal:
path: data.A2A_BASE_URL
value: "http://RELEASE-NAME-controller.NAMESPACE.svc.cluster.local:8083"

- it: should set A2A_BASE_URL with custom value when explicitly set
template: controller-configmap.yaml
set:
controller:
a2aBaseUrl: "https://kagent.example.com"
asserts:
- equal:
path: data.A2A_BASE_URL
value: "https://kagent.example.com"

- it: should use custom loglevel when set
template: controller-configmap.yaml
set:
Expand Down
3 changes: 3 additions & 0 deletions helm/kagent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ database:
controller:
replicas: 1
loglevel: "info"
# -- The base URL of the A2A Server endpoint, as advertised to clients.
# @default -- `http://<fullname>-controller.<namespace>.svc.cluster.local:<port>`
a2aBaseUrl: ""
agentImage:
registry: ""
repository: kagent-dev/kagent/app
Expand Down
Loading