Build & Deploy Application
Deploy App to K8s
In this step, you’ll deploy the Splunk Distribution of the OpenTelemetry Collector to your application cluster using Helm.
Deploy Application to Cluster #
run:
bash
cd ~/workshop/context-propagation
make deployThis script:
- Applies all Kubernetes manifests from
deploy/k8s/ - Creates a
splunk-otelsecret from yourenvcredentials - Points deployments at the registry images
- Waits for all rollouts to complete
Validation Checklist - Deploy #
1. Confirm all pods are running #
bash
kubectl -n cosmic-shop get podstext
NAME READY STATUS RESTARTS AGE
catalog-api-xxxxxxxxxx-xxxxx 1/1 Running 0 2m
frontend-xxxxxxxxxx-xxxxx 1/1 Running 0 2m
gateway-xxxxxxxxxx-xxxxx 1/1 Running 0 2m
order-worker-xxxxxxxxxx-xxxxx 1/1 Running 0 2m
rabbitmq-xxxxxxxxxx-xxxxx 1/1 Running 0 2m
splunk-otel-collector-agent-xxxxx 1/1 Running 0 10m
storefront-api-xxxxxxxxxx-xxxxx 1/1 Running 0 2mFailure indicators:
| STATUS | Likely cause |
|---|---|
ImagePullBackOff | Images not pushed - run make build again |
CrashLoopBackOff | Check logs with kubectl -n cosmic-shop logs deployment/<name> |
Pending | Insufficient cluster resources - check kubectl describe pod <name> |
2. Confirm Services and NodePort #
bash
kubectl -n cosmic-shop get svctext
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
catalog-api ClusterIP 10.43.xxx.xxx <none> 3002/TCP 2m
frontend NodePort 10.43.xxx.xxx <none> 80:30080/TCP 2m
gateway ClusterIP 10.43.xxx.xxx <none> 80/TCP 2m
order-worker ClusterIP 10.43.xxx.xxx <none> 3003/TCP 2m
rabbitmq NodePort 10.43.xxx.xxx <none> 5672:xxxxx/TCP,15672:15672/TCP 2m
storefront-api ClusterIP 10.43.xxx.xxx <none> 3001/TCP 2m3. Confirm Backend Health Endpoints #
bash
kubectl -n cosmic-shop exec deploy/frontend-api -- wget -qO- http://localhost:3007/health
kubectl -n cosmic-shop exec deploy/catalog-api -- wget -qO- http://localhost:3002/health
kubectl -n cosmic-shop exec deploy/order-api -- wget -qO- http://localhost:3001/healthjson
{"status":"ok","service":"frontend-api","stage":"bff"}
{"status":"ok","service":"catalog-api"}
{"status":"ok","service":"order-api","stage":"order"}4. Confirm Shop UI Responds #
bash
curl -s -o /dev/null -w "HTTP %{http_code}\n" http://localhost:30080/
curl -s http://localhost:30080/ | head -5text
HTTP 200
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />5. Confirm API Catalog Endpoint via Gateway #
bash
curl -s http://localhost:30080/api/catalog | python3 -m json.tool | head -20json
{
"products": [
{
"id": "telescope-orion-8",
"name": "Orion 8\" Dobsonian Telescope",
"price": 449.99,
...
}
]
}6. Confirm RabbitMQ Management UI #
The RabbitMQ Service uses NodePort 15672 so k3d can expose the management UI through the loadbalancer.
Verify k3d loadbalancer is mapped port 15672 #
bash
docker ps --filter name=k3d-$INSTANCE-cluster-serverlb --format '{{.Ports}}'text
0.0.0.0:30080->30080/tcp, 0.0.0.0:15672->15672/tcp, ...If 15672 is missing from that output, the cluster was created without the RabbitMQ port mapping — see RabbitMQ UI is not loading below.
Confirm HTTP Responds #
bash
curl -s -o /dev/null -w "HTTP %{http_code}\n" http://localhost:15672/text
HTTP 200
