- For the OTEL example with docker, you'll need to have docker installed in your machine. You can follow the instructions here.
- For the OTEL example with operator, you'll need a kubernetes cluster, you can use minikube or your own kubernetes cluster. Here you can find how to create an AWS EKS cluster using CDK.
To start the mini-kube cluster, run:
minikube startThe OTEL operator requires a TLS certificate manager to be installed in the cluster. To install cert-manager in your cluster, run:
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.1/cert-manager.yamlTo install the OTEL operator, run:
kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yamlThe command above will install the latest version of the OTEL operator, create a new namespace called opentelemetry-operator-system and deploy the operator in it.
Create a new namespace for the applications:
kubectl create namespace all-applicationsTo deploy the OTEL collector as a sidecar, run:
kubectl apply -f infra/otel/otel-collector-sidecar.yamlWhen there are multiple OpenTelemetryCollector resources with a mode set to Sidecar in the same
namespace, a concrete name should be used. When there's only one Sidecar instance in the same
namespace, this instance is used when the annotation is set to "true" (take a look at the
vertx-create-span example). The
vertx-create-span is a Vert.x starter project
(from http://start.vertx.io/), with just enough code to include Jaeger tracer and report a span. To create
the pod in your cluster, run:
kubectl apply -f infra/otel/vertx-create-span.yamlForwards the port of the vertx-create-span pod to your local machine:
kubectl port-forward -n all-applications pods/vertx-create-span 8080To test the application, run:
curl http://localhost:8080/Now, you'll be able to see the spans being reported in the console of sidecar container of the vertx-create-span pod.
kubectl logs -n all-applications vertx-create-span -c otc-containerBuild the docker images for the services and push them to minikube's local registry:
eval $(minikube docker-env)
docker-compose -f src/docker-compose.yml build order-apiDeploy the services to the kubernetes cluster:
kubectl apply -f infra/recipes/order/web-deployment.yaml
kubectl apply -f infra/recipes/order/configmap.yaml
kubectl apply -f infra/recipes/order/secret.yamlRead the README.md file inside the src folder to know how to run the services locally outside of docker or kubernetes.