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
7 changes: 4 additions & 3 deletions helm/kagent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -194,21 +194,22 @@ Password secret name - returns the chart-managed Secret name for POSTGRES_PASSWO
{{- end -}}

{{/*
A2A Base URL - computes the default URL based on the controller service name if not explicitly set
A2A Base URL - computes the default URL based on the controller service name if not explicitly set.
The `name.namespace.svc` short form is used so the URL resolves regardless of the cluster's DNS domain.
*/}}
{{- 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) -}}
{{- printf "http://%s-controller.%s.svc:%d" (include "kagent.fullname" .) (include "kagent.namespace" .) (.Values.controller.service.ports.port | int) -}}
{{- end -}}
{{- end -}}

{{/*
Controller Service host:port for nginx upstream (no scheme).
*/}}
{{- define "kagent.controllerServiceAuthority" -}}
{{- printf "%s-controller.%s.svc.cluster.local:%d" (include "kagent.fullname" .) (include "kagent.namespace" .) (.Values.controller.service.ports.port | int) -}}
{{- printf "%s-controller.%s.svc:%d" (include "kagent.fullname" .) (include "kagent.namespace" .) (.Values.controller.service.ports.port | int) -}}
{{- end -}}

{{/*
Expand Down
2 changes: 1 addition & 1 deletion helm/kagent/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ spec:
name: {{ include "kagent.passwordSecretName" . }}
key: POSTGRES_PASSWORD
- name: POSTGRES_DATABASE_URL
value: {{ printf "postgres://kagent:$(POSTGRES_PASSWORD)@%s.%s.svc.cluster.local:5432/kagent?sslmode=disable" (include "kagent.postgresqlServiceName" .) (include "kagent.namespace" .) | quote }}
value: {{ printf "postgres://kagent:$(POSTGRES_PASSWORD)@%s.%s.svc:5432/kagent?sslmode=disable" (include "kagent.postgresqlServiceName" .) (include "kagent.namespace" .) | quote }}
{{- else }}
{{ fail "No database connection configured. Set database.postgres.url, database.postgres.urlFile, or enable database.postgres.bundled." }}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions helm/kagent/tests/controller-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ tests:
asserts:
- equal:
path: data.A2A_BASE_URL
value: "http://RELEASE-NAME-controller.NAMESPACE.svc.cluster.local:8083"
value: "http://RELEASE-NAME-controller.NAMESPACE.svc:8083"

- it: should set A2A_BASE_URL with custom value when explicitly set
template: controller-configmap.yaml
Expand Down Expand Up @@ -489,7 +489,7 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: POSTGRES_DATABASE_URL
value: "postgres://kagent:$(POSTGRES_PASSWORD)@RELEASE-NAME-postgresql.NAMESPACE.svc.cluster.local:5432/kagent?sslmode=disable"
value: "postgres://kagent:$(POSTGRES_PASSWORD)@RELEASE-NAME-postgresql.NAMESPACE.svc:5432/kagent?sslmode=disable"

- it: should set POSTGRES_DATABASE_URL with external url when url is set
template: controller-deployment.yaml
Expand Down
2 changes: 1 addition & 1 deletion helm/kagent/tests/ui-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: BACKEND_INTERNAL_URL
value: "http://RELEASE-NAME-controller.NAMESPACE.svc.cluster.local:8083/api"
value: "http://RELEASE-NAME-controller.NAMESPACE.svc:8083/api"

- it: should allow overriding ui.backendInternalUrl
template: ui-deployment.yaml
Expand Down
2 changes: 1 addition & 1 deletion helm/kagent/tests/ui-nginx-configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ tests:
asserts:
- matchRegex:
path: data["nginx.conf"]
pattern: 'server RELEASE-NAME-controller\.NAMESPACE\.svc\.cluster\.local:8083;'
pattern: 'server RELEASE-NAME-controller\.NAMESPACE\.svc:8083;'
2 changes: 1 addition & 1 deletion helm/kagent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ controller:
# @default -- "" (controller falls back to "0.0.0.0"; "::" when ipv6.enabled)
host: ""
# -- The base URL of the A2A Server endpoint, as advertised to clients.
# @default -- `http://<fullname>-controller.<namespace>.svc.cluster.local:<port>`
# @default -- `http://<fullname>-controller.<namespace>.svc:<port>`
a2aBaseUrl: ""
agentImage:
registry: ""
Expand Down
Loading