Skip to content

Commit 440d5fe

Browse files
authored
(feat) Add substrate as a subchart (kagent-dev#2030)
## Description Adds substrate as a subchart to kagent. Subchart version is based on pinned version in go.mod. Adds an warning in notes.txt warning about regarding experimental support. ## Manual Testing ``` # 1. Verify SUBSTRATE_VERSION is derived from go.mod replace directive make --eval='show:; @echo $(SUBSTRATE_VERSION)' show # Expected: 0.0.6 (matches `replace ... => github.com/kagent-dev/substrate v0.0.6`) # 2. Stamp Chart.yaml files and pull subchart deps from GHCR make helm-version # Expected: "Pulled: ghcr.io/kagent-dev/substrate/helm/substrate-crds:0.0.6" # "Pulled: ghcr.io/kagent-dev/substrate/helm/substrate:0.0.6" helm dependency list helm/kagent-crds | grep substrate helm dependency list helm/kagent | grep substrate # Expected: substrate-crds 0.0.6 oci://ghcr.io/kagent-dev/substrate/helm ok # substrate 0.0.6 oci://ghcr.io/kagent-dev/substrate/helm ok # 3. kagent-crds — substrate gating helm template t helm/kagent-crds --set substrate.enabled=false 2>/dev/null \ | grep -c '^# Source: kagent-crds/charts/substrate-crds/' # Expected: 0 helm template t helm/kagent-crds --set substrate.enabled=true 2>/dev/null \ | grep '^# Source: kagent-crds/charts/substrate-crds/' | sort -u # Expected: ate.dev_actortemplates.yaml, ate.dev_workerpools.yaml # 4. kagent main chart — substrate subchart gating helm template t helm/kagent --set substrate.enabled=false --set providers.openAI.apiKey=x 2>/dev/null \ | grep -c '^# Source: kagent/charts/substrate/' # Expected: 0 helm template t helm/kagent --set substrate.enabled=true --set providers.openAI.apiKey=x 2>/dev/null \ | grep '^# Source: kagent/charts/substrate/' | sort -u # Expected: ate-api-server.yaml, ate-api-server-envvars.yaml, ate-controller.yaml, # atelet.yaml, atenet-dns.yaml, atenet-router.yaml, jwt-bootstrap.yaml, # jwt-oidc-rbac.yaml, role.yaml, rustfs.yaml, valkey.yaml ``` --------- Signed-off-by: Jonathan Jamroga <jjamroga@gmail.com>
1 parent 5a18873 commit 440d5fe

7 files changed

Lines changed: 54 additions & 4 deletions

File tree

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ init-git-hooks: ## Use the tracked version of Git hooks from this repo
136136
KMCP_ENABLED ?= true
137137
KMCP_VERSION ?= $(shell $(AWK) '/github\.com\/kagent-dev\/kmcp/ { print substr($$2, 2) }' go/go.mod) # KMCP version defaults to what's referenced in go.mod
138138

139+
# Substrate
140+
SUBSTRATE_ENABLED ?= false
141+
SUBSTRATE_VERSION ?= $(shell $(AWK) '/github\.com\/kagent-dev\/substrate/ { print substr($$5, 2) }' go/go.mod) # Substrate version defaults to the replace target in go.mod
142+
139143
HELM_ACTION=upgrade --install
140144

141145
# Helm chart variables
@@ -394,8 +398,8 @@ helm-tools: ## Package all tool Helm charts into the dist folder
394398
.PHONY: helm-version
395399
helm-version: ## Stamp chart versions, update dependencies, and package kagent + kagent-crds
396400
helm-version: helm-cleanup helm-agents helm-tools
397-
VERSION=$(VERSION) KMCP_VERSION=$(KMCP_VERSION) envsubst < helm/kagent-crds/Chart-template.yaml > helm/kagent-crds/Chart.yaml
398-
VERSION=$(VERSION) KMCP_VERSION=$(KMCP_VERSION) envsubst < helm/kagent/Chart-template.yaml > helm/kagent/Chart.yaml
401+
VERSION=$(VERSION) KMCP_VERSION=$(KMCP_VERSION) SUBSTRATE_VERSION=$(SUBSTRATE_VERSION) envsubst < helm/kagent-crds/Chart-template.yaml > helm/kagent-crds/Chart.yaml
402+
VERSION=$(VERSION) KMCP_VERSION=$(KMCP_VERSION) SUBSTRATE_VERSION=$(SUBSTRATE_VERSION) envsubst < helm/kagent/Chart-template.yaml > helm/kagent/Chart.yaml
399403
helm dependency update helm/kagent
400404
helm dependency update helm/kagent-crds
401405
helm package -d $(HELM_DIST_FOLDER) helm/kagent-crds

helm/kagent-crds/Chart-template.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ dependencies:
88
version: ${KMCP_VERSION}
99
repository: oci://ghcr.io/kagent-dev/kmcp/helm
1010
condition: kmcp.enabled
11+
- name: substrate-crds
12+
version: ${SUBSTRATE_VERSION}
13+
repository: oci://ghcr.io/kagent-dev/substrate/helm
14+
condition: substrate.enabled
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if .Values.substrate.enabled }}
2+
################################################################################
3+
# WARNING: SUBSTRATE IS EXPERIMENTAL, USE AT OWN RISK #
4+
################################################################################
5+
Substrate is a product in early development, and as a result may be unstable due to
6+
schema, API, and architectural changes.
7+
8+
Kagent uses its own fork of Substrate in order to accelerate adoption. As a result,
9+
the values.yaml schema is subject to change.
10+
11+
################################################################################
12+
{{- end }}

helm/kagent-crds/values.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,11 @@
55
# ==============================================================================
66

77
kmcp:
8-
enabled: true
8+
enabled: true
9+
10+
# ==============================================================================
11+
# SUBSTRATE
12+
# ==============================================================================
13+
14+
substrate:
15+
enabled: false

helm/kagent/Chart-template.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ dependencies:
88
version: ${KMCP_VERSION}
99
repository: oci://ghcr.io/kagent-dev/kmcp/helm
1010
condition: kmcp.enabled
11+
- name: substrate
12+
version: ${SUBSTRATE_VERSION}
13+
repository: oci://ghcr.io/kagent-dev/substrate/helm
14+
condition: substrate.enabled
1115
- name: kagent-tools
1216
version: 0.2.1
1317
repository: oci://ghcr.io/kagent-dev/tools/helm

helm/kagent/templates/NOTES.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ACCESSING THE UI:
1313

1414
ACCESSING THE CONTROLLER API:
1515
kubectl -n {{ include "kagent.namespace" . }} port-forward service/{{ include "kagent.fullname" . }}-controller {{ .Values.controller.service.ports.port }}:{{ .Values.controller.service.ports.port }}
16-
16+
1717
API endpoint: http://localhost:{{ .Values.controller.service.ports.port }}/api
1818

1919
DEPLOYED COMPONENTS:
@@ -92,4 +92,16 @@ DOCUMENTATION:
9292
database.postgres.bundled.enabled=false
9393
{{- end }}
9494
{{- end }}
95+
{{- if .Values.substrate.enabled }}
96+
################################################################################
97+
# WARNING: SUBSTRATE IS EXPERIMENTAL, USE AT OWN RISK #
98+
################################################################################
99+
Substrate is a product in early development, and as a result may be unstable due to
100+
schema, API, and architectural changes.
101+
102+
Kagent uses its own fork of Substrate in order to accelerate adoption. As a result,
103+
the values.yaml schema is subject to change.
104+
105+
################################################################################
106+
{{- end }}
95107
################################################################################

helm/kagent/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,13 @@ kmcp:
481481
fullnameOverride: "" # Override if desired
482482
namespaceOverride: "" # Override if desired (in conjunction with fullnameOverride to drop the `kagent-` prefix if you want)
483483

484+
# ==============================================================================
485+
# SUBSTRATE
486+
# ==============================================================================
487+
488+
substrate:
489+
enabled: false
490+
484491
# ==============================================================================
485492
# BUILT-IN TOOLS
486493
# ==============================================================================

0 commit comments

Comments
 (0)