Kubernetes deployment (2024)

We provide a OpenTelemetry Demo Helm chart tohelp deploy the demo to an existing Kubernetes cluster.

Helm must be installed to use the charts. Please refer toHelm’s documentation to get started.

Prerequisites

  • Kubernetes 1.24+
  • 6 GB of free RAM for the application
  • Helm 3.9+ (for Helm installation method only)

Install using Helm (recommended)

Add OpenTelemetry Helm repository:

helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts

To install the chart with the release name my-otel-demo, run the followingcommand:

helm install my-otel-demo open-telemetry/opentelemetry-demo

Note The OpenTelemetry Demo Helm chart version 0.11.0 or greater isrequired to perform all usage methods mentioned below.

Install using kubectl

The following command will install the demo application to your Kubernetescluster.

kubectl apply --namespace otel-demo -f https://raw.githubusercontent.com/open-telemetry/opentelemetry-demo/main/kubernetes/opentelemetry-demo.yaml

Note These manifests are generated from the Helm chart and are providedfor convenience. It is recommended to use the Helm chart for installation.

Use the Demo

The demo application will need the services exposed outside of the Kubernetescluster in order to use them. You can expose the services to your local systemusing the kubectl port-forward command or by configuring service types (ie:LoadBalancer) with optionally deployed ingress resources.

Expose services using kubectl port-forward

To expose the frontendproxy service use the following command (replacemy-otel-demo with your Helm chart release name accordingly):

kubectl port-forward svc/my-otel-demo-frontendproxy 8080:8080

Note: kubectl port-forward will proxy the port until the processterminates. You may need to create separate terminal sessions for each use ofkubectl port-forward, and use Ctrl-C to terminate the processwhen done.

With the frontendproxy port-forward set up, you can access:

Expose Demo components using service or ingress configurations

Note

We recommend that you use a values filewhen installing the Helm chart in order to specify additional configurationoptions.

Configure ingress resources

Note Kubernetes clusters may not have the proper infrastructure componentsto enable LoadBalancer service types or ingress resources. Verify your clusterhas the proper support before using these configuration options.

Each demo component (ie: frontendproxy) offers a way to have its Kubernetesservice type configured. By default, these will not be created, but you canenable and configure them through the ingress property of each component.

To configure the frontendproxy component to use an ingress resource you wouldspecify the following in your values file:

components: frontendProxy: ingress: enabled: true annotations: {} hosts: - host: otel-demo.my-domain.com paths: - path: / pathType: Prefix port: 8080

Some ingress controllers require special annotations or service types. Refer tothe documentation from your ingress controller for more information.

Configure service types

Each demo component (ie: frontendproxy) offers a way to have its Kubernetesservice type configured. By default, these will be ClusterIP but you canchange each one using the service.type property of each component.

To configure the frontendproxy component to use a LoadBalancer service type youwould specify the following in your values file:

components: frontendProxy: service: type: LoadBalancer

Configure browser telemetry

In order for spans from the browser to be properly collected, you will also needto specify the location where the OpenTelemetry Collector is exposed. Thefrontendproxy defines a route for the collector with a path prefix of/otlp-http. You can configure the collector endpoint by setting the followingenvironment variable on the frontend component:

components: frontend: envOverrides: - name: PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT value: http://otel-demo.my-domain.com/otlp-http/v1/traces

Installation with a values file

To install the Helm chart with a custom my-values-file.yaml values file use:

helm install my-otel-demo open-telemetry/opentelemetry-demo --values my-values-file.yaml

With the frontendproxy and Collector exposed, you can access the demo UI at thebase path for the frontendproxy. Other demo components can be accessed at thefollowing sub-paths:

  • Web store: / (base)
  • Grafana: /grafana
  • Load Generator UI: /loadgen/ (must include trailing slash)
  • Jaeger UI: /jaeger/ui

Bring your own backend

Likely you want to use the web store as a demo application for an observabilitybackend you already have (e.g. an existing instance of Jaeger, Zipkin, or one ofthe vendor of your choice.

The OpenTelemetry Collector’s configuration is exposed in the Helm chart. Anyadditions you do will be merged into the default configuration. You can use thisto add your own exporters, and add them to the desired pipeline(s)

opentelemetry-collector: config: exporters: otlphttp/example: endpoint: <your-endpoint-url> service: pipelines: traces: exporters: [spanmetrics, otlphttp/example]

Note

When merging YAML values with Helm,objects are merged and arrays are replaced. The spanmetrics exporter must beincluded in the array of exporters for the traces pipeline if overridden. Notincluding this exporter will result in an error.

Vendor backends might require you to add additional parameters forauthentication, please check their documentation. Some backends requiredifferent exporters, you may find them and their documentation available atopentelemetry-collector-contrib/exporter.

To install the Helm chart with a custom my-values-file.yaml values file use:

helm install my-otel-demo open-telemetry/opentelemetry-demo --values my-values-file.yaml

Last modified March 21, 2024: [demo] - fix browser telemetry example (#4188) (a49a158c)

Kubernetes deployment (2024)
Top Articles
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 6740

Rating: 5 / 5 (60 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.