Skip to content
Draft
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
1 change: 1 addition & 0 deletions charts/langsmith/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ For information on how to use this chart, up-to-date release notes, and other gu
| insights.redis.statefulSet.updateStrategy | object | `{}` | Optional StatefulSet update strategy for the in-chart Insights Redis instance. Leave unset to keep the Kubernetes default RollingUpdate behavior. |
| insights.redis.statefulSet.volumeMounts | list | `[]` | |
| insights.redis.statefulSet.volumes | list | `[]` | |
| internalServiceUrls | object | `{}` | Optional URLs for core internal services. Empty values preserve Kubernetes service DNS. |
| istioGateway.annotations | object | `{}` | |
| istioGateway.enabled | bool | `false` | |
| istioGateway.labels | object | `{}` | |
Expand Down
42 changes: 41 additions & 1 deletion charts/langsmith/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,45 @@ dnsConfig:
{{- end }}
{{- end }}

{{/*
Returns an internal URL override when configured, otherwise the provided default.
*/}}
{{- define "langsmith.internalServiceUrl" -}}
{{- $root := .root -}}
{{- $override := get $root.Values.internalServiceUrls .key -}}
{{- if $override -}}
{{- $override -}}
{{- else -}}
{{- .default -}}
{{- end -}}
{{- end -}}

{{/*
Returns an internal service URL. A non-empty internalServiceUrls entry overrides
the default Kubernetes service DNS URL.
*/}}
{{- define "langsmith.internalServiceEndpoint" -}}
{{- $root := .root -}}
{{- $default := printf "http://%s-%s.%s.svc.%s:%v" (include "langsmith.fullname" $root) .name .namespace $root.Values.clusterDomain .port -}}
{{- include "langsmith.internalServiceUrl" (dict "root" $root "key" .key "default" $default) -}}
{{- end -}}

{{/*
Returns the host LangChain API URL, preserving the existing deployment and base-path behavior.
*/}}
{{- define "langsmith.internalHostLangchainApiEndpoint" -}}
{{- $namespace := .Values.namespace | default .Release.Namespace -}}
{{- if .Values.internalServiceUrls.hostLangchainApi -}}
{{- .Values.internalServiceUrls.hostLangchainApi -}}
{{- else if not .Values.frontend.enabled -}}
{{- printf "%s/api/v1" (include "langsmith.internalServiceEndpoint" (dict "root" . "key" "backend" "name" .Values.backend.name "namespace" $namespace "port" .Values.backend.service.port)) -}}
{{- else if .Values.config.basePath -}}
{{- printf "%s/%s/api/v1" (include "langsmith.internalServiceEndpoint" (dict "root" . "key" "frontend" "name" .Values.frontend.name "namespace" $namespace "port" .Values.frontend.service.httpPort)) .Values.config.basePath -}}
{{- else -}}
{{- printf "%s/api/v1" (include "langsmith.internalServiceEndpoint" (dict "root" . "key" "frontend" "name" .Values.frontend.name "namespace" $namespace "port" .Values.frontend.service.httpPort)) -}}
{{- end -}}
{{- end -}}

{{/*
Template containing common environment variables that are used by several services.
*/}}
Expand Down Expand Up @@ -204,7 +243,8 @@ Template containing common environment variables that are used by several servic
{{- if .Values.fleet.enabled }}
{{- $ns := .Values.namespace | default .Release.Namespace -}}
{{- $cd := .Values.clusterDomain -}}
{{- $fleetApi := printf "http://%s.%s.svc.%s:%v" (include "langsmith.agentFeatures.apiServerK8sServiceName" (dict "root" . "product" "fleet")) $ns $cd .Values.fleet.apiServer.service.httpPort }}
{{- $fleetApiDefault := printf "http://%s.%s.svc.%s:%v" (include "langsmith.agentFeatures.apiServerK8sServiceName" (dict "root" . "product" "fleet")) $ns $cd .Values.fleet.apiServer.service.httpPort -}}
{{- $fleetApi := include "langsmith.internalServiceUrl" (dict "root" . "key" "fleetApiServer" "default" $fleetApiDefault) }}
- name: LANGGRAPH_DEPLOYMENT_URL
value: {{ $fleetApi | quote }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/langsmith/templates/agent-gateway/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
value: {{ .Values.agentGateway.containerPort | quote }}
{{- if .Values.presidioAnalyzer.enabled }}
- name: PRESIDIO_ANALYZER_URL
value: "http://{{ include "langsmith.fullname" . }}-{{ .Values.presidioAnalyzer.name }}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.presidioAnalyzer.service.port }}"
value: {{ include "langsmith.internalServiceEndpoint" (dict "root" . "key" "presidioAnalyzer" "name" .Values.presidioAnalyzer.name "namespace" (.Values.namespace | default .Release.Namespace) "port" .Values.presidioAnalyzer.service.port) | quote }}
{{- end }}
{{- end -}}
{{- if .Values.agentGateway.enabled }}
Expand Down
26 changes: 9 additions & 17 deletions charts/langsmith/templates/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ data:
{{- end }}
LANGCHAIN_ENV: "local_kubernetes"
LANGCHAIN_ENDPOINT: "/{{ if .Values.config.basePath }}{{ .Values.config.basePath }}/{{ end }}api/v1"
GO_ENDPOINT: "http://{{ include "langsmith.fullname" . }}-{{ .Values.platformBackend.name }}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.platformBackend.service.port }}"
GO_ACE_ENDPOINT: "http://{{ include "langsmith.fullname" . }}-{{.Values.aceBackend.name}}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.aceBackend.service.port }}"
PLAYGROUND_ENDPOINT: "http://{{ include "langsmith.fullname" . }}-{{.Values.playground.name}}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.playground.service.port }}"
SMITH_BACKEND_ENDPOINT: "http://{{ include "langsmith.fullname" . }}-{{.Values.backend.name}}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.backend.service.port }}"
HOST_BACKEND_ENDPOINT: "http://{{ include "langsmith.fullname" . }}-{{.Values.hostBackend.name}}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.hostBackend.service.port }}"
LANGSMITH_AUTH_ENDPOINT: "http://{{ include "langsmith.fullname" . }}-{{ .Values.platformBackend.name }}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.platformBackend.service.port }}"
GO_ENDPOINT: {{ include "langsmith.internalServiceEndpoint" (dict "root" . "key" "platformBackend" "name" .Values.platformBackend.name "namespace" (.Values.namespace | default .Release.Namespace) "port" .Values.platformBackend.service.port) | quote }}
GO_ACE_ENDPOINT: {{ include "langsmith.internalServiceEndpoint" (dict "root" . "key" "aceBackend" "name" .Values.aceBackend.name "namespace" (.Values.namespace | default .Release.Namespace) "port" .Values.aceBackend.service.port) | quote }}
PLAYGROUND_ENDPOINT: {{ include "langsmith.internalServiceEndpoint" (dict "root" . "key" "playground" "name" .Values.playground.name "namespace" (.Values.namespace | default .Release.Namespace) "port" .Values.playground.service.port) | quote }}
SMITH_BACKEND_ENDPOINT: {{ include "langsmith.internalServiceEndpoint" (dict "root" . "key" "backend" "name" .Values.backend.name "namespace" (.Values.namespace | default .Release.Namespace) "port" .Values.backend.service.port) | quote }}
HOST_BACKEND_ENDPOINT: {{ include "langsmith.internalServiceEndpoint" (dict "root" . "key" "hostBackend" "name" .Values.hostBackend.name "namespace" (.Values.namespace | default .Release.Namespace) "port" .Values.hostBackend.service.port) | quote }}
LANGSMITH_AUTH_ENDPOINT: {{ include "langsmith.internalServiceEndpoint" (dict "root" . "key" "platformBackend" "name" .Values.platformBackend.name "namespace" (.Values.namespace | default .Release.Namespace) "port" .Values.platformBackend.service.port) | quote }}
{{- if and .Values.smithdb.enabled .Values.smithdb.langsmith.frontend.useSmithDBEndpoints }}
{{- $smithdbQueryUrl := include "langsmith.smithdb.grpcServiceUrl" (dict "root" . "component" "query" "port" .Values.smithdb.query.service.port) }}
SMITHDB_QUERY_SERVICE_URL: {{ $smithdbQueryUrl | quote }}
Expand All @@ -67,18 +67,10 @@ data:
LLM_AUTH_PROXY_ISSUER: {{ .Values.config.llmAuthProxyIssuer | quote }}
{{- end }}
{{- if and .Values.fleet.enabled .Values.fleetTriggerServer.enabled }}
MCP_SERVER_URL: "http://{{ include "langsmith.fullname" . }}-{{ .Values.fleetToolServer.name }}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.fleetToolServer.service.port }}"
MCP_SERVER_URL: {{ include "langsmith.internalServiceEndpoint" (dict "root" . "key" "fleetToolServer" "name" .Values.fleetToolServer.name "namespace" (.Values.namespace | default .Release.Namespace) "port" .Values.fleetToolServer.service.port) | quote }}
{{- end }}
{{- if .Values.config.deployment.enabled }}
{{- if not .Values.frontend.enabled }}
HOST_LANGCHAIN_API_ENDPOINT: "http://{{ include "langsmith.fullname" . }}-{{ .Values.backend.name }}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.backend.service.port }}/api/v1"
{{- else }}
{{- if .Values.config.basePath }}
HOST_LANGCHAIN_API_ENDPOINT: "http://{{ include "langsmith.fullname" . }}-{{ .Values.frontend.name }}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.frontend.service.httpPort }}/{{ .Values.config.basePath}}/api/v1"
{{- else }}
HOST_LANGCHAIN_API_ENDPOINT: "http://{{ include "langsmith.fullname" . }}-{{ .Values.frontend.name }}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.frontend.service.httpPort }}/api/v1"
{{- end }}
{{- end }}
HOST_LANGCHAIN_API_ENDPOINT: {{ include "langsmith.internalHostLangchainApiEndpoint" . | quote }}
{{- end }}
FF_RUN_STATS_GROUP_BY_ENABLED_ALL: "true"
SEPARATE_QUEUES_WITH_SINGLE_WORKER: '["host"]'
Expand Down Expand Up @@ -108,7 +100,7 @@ data:
SELF_HOSTED_POLLY_ENABLED: "true"
{{- end }}
{{- if .Values.agentGateway.enabled }}
AGENT_GATEWAY_URL: "http://{{ include "langsmith.fullname" . }}-{{ .Values.agentGateway.name }}.{{ .Values.namespace | default .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.agentGateway.service.port }}"
AGENT_GATEWAY_URL: {{ include "langsmith.internalServiceEndpoint" (dict "root" . "key" "agentGateway" "name" .Values.agentGateway.name "namespace" (.Values.namespace | default .Release.Namespace) "port" .Values.agentGateway.service.port) | quote }}
{{- end }}
# Usage backfill export gating
{{- if .Values.config.superAdmins }}
Expand Down
Loading