Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
kind: add deploy-kind-example.sh wrapping the example deploy commands
Tomas Tormo341f77fd608a
diff --git a/development/kind/deploy-kind-example.sh b/development/kind/deploy-kind-example.shnew file mode 100755index 00000000..36a534d8--- /dev/null+++ b/development/kind/deploy-kind-example.sh@@ -0,0 +1,27 @@+#!/usr/bin/env bash+# Build, load and install a development/examples/<example> into the kind mesh.+# Extra args pass to helm, e.g.: deploy-kind-example.sh code-reviewer-pool/reviewer --set replicaCount=3+set -euo pipefail++[[ $# -ge 1 ]] || { echo "usage: $(basename "$0") <example> [helm args...]" >&2; exit 1; }++SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"+PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"+EXAMPLE="$1"; shift+DIR="${PROJECT_ROOT}/development/examples/${EXAMPLE}"+[[ -f "${DIR}/values.yaml" ]] || { echo "example '${EXAMPLE}' not found (no values.yaml in development/examples/${EXAMPLE})" >&2; exit 1; }+NAME="$(basename "${EXAMPLE}")"++HELM="helm"+if ! command -v helm >/dev/null 2>&1; then+ [[ -x "${PROJECT_ROOT}/bin/helm" ]] || { echo "missing prerequisite: helm (install helm or place it in ./bin/helm)" >&2; exit 1; }+ HELM="${PROJECT_ROOT}/bin/helm"+fi++set -x+docker build -t "${NAME}:local" "${DIR}"+kind load docker-image --name sam-kind "${NAME}:local"+"${HELM}" --kube-context kind-sam-kind -n sam-kind upgrade --install "${NAME}" "${PROJECT_ROOT}/charts/sam-node" \+ -f "${PROJECT_ROOT}/development/kind/sam-node.values.yaml" \+ -f "${DIR}/values.yaml" "$@"+kubectl --context kind-sam-kind -n sam-kind rollout status "deployment/${NAME}-sam-node" --timeout=180sdiff --git a/development/kind/run.sh b/development/kind/run.shindex 424ec42f..d3190ed8 100755--- a/development/kind/run.sh+++ b/development/kind/run.sh@@ -267,10 +267,8 @@ echo " control plane: http://${MAIN_IP}"echo " dex: ${OIDC_ISSUER}"echoecho "To put a service on the mesh, deploy an example with charts/sam-node:"-echo " docker build -t calc-mcp:local development/examples/calc-mcp"-echo " kind load docker-image --name ${CLUSTER} calc-mcp:local"-echo " ${HELM} --kube-context ${KCTX} -n ${NAMESPACE} install calc-mcp charts/sam-node \\"-echo " -f development/kind/sam-node.values.yaml -f development/examples/calc-mcp/values.yaml"+echo " ./development/kind/deploy-kind-example.sh calc-mcp"+echo "(it prints the docker build / kind load / helm install commands as it runs them)"echoecho "To drive the mesh, enroll a local node in another shell (it stays in the foreground):"echo " make build && make kind-local-node"diff --git a/development/kind/test-mesh-e2e.sh b/development/kind/test-mesh-e2e.shindex 7cf1f4b5..86f0ca8a 100755--- a/development/kind/test-mesh-e2e.sh+++ b/development/kind/test-mesh-e2e.sh@@ -15,23 +15,8 @@set -euo pipefail-KCTX="kind-sam-kind"-NAMESPACE="sam-kind"--# Same helm fallback as run.sh: CI and dev boxes may only have ./bin/helm.-HELM="helm"-if ! command -v helm >/dev/null 2>&1; then- [[ -x "./bin/helm" ]] || { echo "missing prerequisite: helm (install helm or place it in ./bin/helm)" >&2; exit 1; }- HELM="./bin/helm"-fi-echo "== Deploying calc-mcp via charts/sam-node =="-docker build -t calc-mcp:local development/examples/calc-mcp-kind load docker-image --name sam-kind calc-mcp:local-"${HELM}" --kube-context "${KCTX}" -n "${NAMESPACE}" install calc-mcp charts/sam-node \- -f development/kind/sam-node.values.yaml \- -f development/examples/calc-mcp/values.yaml-kubectl --context "${KCTX}" -n "${NAMESPACE}" rollout status deployment/calc-mcp-sam-node --timeout=180s+./development/kind/deploy-kind-example.sh calc-mcp# If running locally, we might want to store logs in a temp dirLOG_DIR="${RUNNER_TEMP:-$(mktemp -d)}"diff --git a/site/content/docs/development/kubernetes-deployment.md b/site/content/docs/development/kubernetes-deployment.mdindex e6077e3b..3e12158b 100644--- a/site/content/docs/development/kubernetes-deployment.md+++ b/site/content/docs/development/kubernetes-deployment.md@@ -69,6 +69,16 @@ helm --kube-context kind-sam-kind -n sam-kind install calc-mcp charts/sam-node \-f development/examples/calc-mcp/values.yaml```+`development/kind/deploy-kind-example.sh` wraps those commands (as+`helm upgrade --install`, plus a rollout wait) and echoes each one as it+runs, so deploying — or redeploying after a code change — is one line.+Extra args pass through to helm:++```bash+./development/kind/deploy-kind-example.sh calc-mcp+./development/kind/deploy-kind-example.sh code-reviewer-pool/reviewer --set replicaCount=3+```+To write your own service, copy an example folder: a backend listening on alocal port, a `Dockerfile`, and a `values.yaml` declaring the service —