From 7abac05dd3e8f8825b30645d9abe26ce9dcd308e Mon Sep 17 00:00:00 2001 From: Jaisheesh-2006 Date: Thu, 23 Jul 2026 20:58:53 +0530 Subject: [PATCH 1/2] Docs: Script added and README updated Signed-off-by: Jaisheesh-2006 --- gsoc-otel-demo/README.md | 12 +++--- gsoc-otel-demo/scripts/build_and_load.sh | 50 ++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 gsoc-otel-demo/scripts/build_and_load.sh diff --git a/gsoc-otel-demo/README.md b/gsoc-otel-demo/README.md index 8ba9ce5..260b620 100755 --- a/gsoc-otel-demo/README.md +++ b/gsoc-otel-demo/README.md @@ -2,10 +2,7 @@ A GSoC 2026 sample that packages the [OpenTelemetry Astronomy Shop](https://opentelemetry.io/docs/demo/) — a microservices e‑commerce demo — as a composable [kpt](https://kpt.dev) package and shows how the same package can be rebranded, regionalized, wired up for telemetry, and updated safely using **Configuration as Data** and **KRM Functions**. - - - + --- @@ -85,7 +82,12 @@ app/ (ROOT PACKAGE) ### Prerequisites - A working Kubernetes cluster (kind, minikube, or any conformant cluster). -- Docker as container engine +- Docker as container engine. +- If you want to build the images, you may run the provided script (this is for a kind cluster): + ```bash + ./scripts/build_and_load.sh + ``` + - [`kubectl`](https://kubernetes.io/docs/tasks/tools/) — for cluster interaction. - [`kpt`](https://kpt.dev/installation/kpt-cli) — for fetching, rendering, and applying the package. - Create a namespace called `otel-demo` diff --git a/gsoc-otel-demo/scripts/build_and_load.sh b/gsoc-otel-demo/scripts/build_and_load.sh new file mode 100644 index 0000000..db1dba1 --- /dev/null +++ b/gsoc-otel-demo/scripts/build_and_load.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# Exit immediately if a command exits with a non-zero status +set -e + +echo "Starting build and load process for astronomy and florist resources..." + +KIND_CLUSTER_NAME=${1:-"kind"} # Default kind cluster name is 'kind', or use the first argument + +build_and_load() { + local app=$1 + local service=$2 + local dir="$app/$service" + local image_name="${app}-${service}:v1" + + if [ -f "$dir/Dockerfile" ]; then + echo "--------------------------------------------------------" + echo "🏗️ Building image $image_name from $dir..." + if [ "$service" = "ad" ]; then + docker build --build-arg OTEL_JAVA_AGENT_VERSION=2.8.0 -t "$image_name" "$dir" + else + docker build -t "$image_name" "$dir" + fi + + echo "🚢 Loading image $image_name into kind cluster '$KIND_CLUSTER_NAME'..." + kind load docker-image "$image_name" --name "$KIND_CLUSTER_NAME" + echo "✅ Successfully loaded $image_name" + else + echo "⚠️ No Dockerfile found in $dir, skipping..." + fi +} + +# Iterate over the two main apps +for app in astronomy florist; do + if [ -d "$app" ]; then + echo "Processing $app resources..." + for service_dir in "$app"/*; do + if [ -d "$service_dir" ]; then + service=$(basename "$service_dir") + build_and_load "$app" "$service" + fi + done + else + echo "❌ Directory $app not found! Run this script from the root of the project." + exit 1 + fi +done + +echo "--------------------------------------------------------" +echo "🎉 All astronomy and florist images have been built and loaded into the '$KIND_CLUSTER_NAME' kind cluster successfully!" From ae55abd8d88724418765d4bfbe34cb95f849addf Mon Sep 17 00:00:00 2001 From: Jaisheesh-2006 Date: Sun, 26 Jul 2026 21:30:55 +0530 Subject: [PATCH 2/2] Kptfile cleanup Signed-off-by: Jaisheesh-2006 --- gsoc-otel-demo/app/Kptfile | 48 -------------------------------------- 1 file changed, 48 deletions(-) diff --git a/gsoc-otel-demo/app/Kptfile b/gsoc-otel-demo/app/Kptfile index 173420c..cfae222 100644 --- a/gsoc-otel-demo/app/Kptfile +++ b/gsoc-otel-demo/app/Kptfile @@ -31,51 +31,3 @@ pipeline: configPath: profiles/validator-profile.yaml - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 configPath: chaos/validator-chaos.yaml -status: - conditions: - - type: Rendered - status: "True" - reason: RenderSuccess - renderStatus: - mutationSteps: - - image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.4.5 - exitCode: 0 - results: - - message: all matching namespaces are already "otel-demo". no value changed - severity: info - - message: all `depends-on` annotations are up-to-date. no `namespace` changed - severity: info - - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.4.5 - exitCode: 0 - results: - - message: all matching namespaces are already "otel-demo". no value changed - severity: info - - message: all `depends-on` annotations are up-to-date. no `namespace` changed - severity: info - - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/apply-replacements:v0.1.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/apply-replacements:v0.1.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/apply-replacements:v0.1.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 - exitCode: 0 - validationSteps: - - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 - exitCode: 0 - - image: ghcr.io/kptdev/krm-functions-catalog/starlark:v0.5.5 - exitCode: 0