Skip to content

Commit

Permalink
[demo] use Jaeger sub-chart (open-telemetry#523)
Browse files Browse the repository at this point in the history
Moves to using a Jaeger sub-chart instead of templated within this chart itself.

This does introduce a potential breaking change, where the Jaeger parameters are moving to a top-level jaeger. section instead. Even though this is a breaking change, the chart is early enough, and the current section isn't likely to of been modified by existing deployments.

A readme is also added to the chart to document the upgrade process and all parameters in the chart itself.
  • Loading branch information
puckpuck authored Dec 8, 2022
1 parent 2874f8c commit 295f03a
Show file tree
Hide file tree
Showing 19 changed files with 445 additions and 237 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/demo-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ jobs:
create-kind-cluster: "true"

- name: Run chart-testing (install)
run: ct install --charts charts/opentelemetry-demo --chart-repos opentelemetry-collector=https://open-telemetry.github.io/opentelemetry-helm-charts,prometheus=https://prometheus-community.github.io/helm-charts,grafana=https://grafana.github.io/helm-charts
run: "ct install --charts charts/opentelemetry-demo
--chart-repos opentelemetry-collector=https://open-telemetry.github.io/opentelemetry-helm-charts
--chart-repos prometheus=https://prometheus-community.github.io/helm-charts
--chart-repos grafana=https://grafana.github.io/helm-charts
--chart-repos jaeger=https://jaegertracing.github.io/helm-charts"
6 changes: 5 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ jobs:
create-kind-cluster: "false"

- name: Run chart-testing (lint)
run: ct lint --target-branch main --chart-repos opentelemetry-collector=https://open-telemetry.github.io/opentelemetry-helm-charts,prometheus=https://prometheus-community.github.io/helm-charts,grafana=https://grafana.github.io/helm-charts
run: "ct lint --target-branch main
--chart-repos opentelemetry-collector=https://open-telemetry.github.io/opentelemetry-helm-charts
--chart-repos prometheus=https://prometheus-community.github.io/helm-charts
--chart-repos grafana=https://grafana.github.io/helm-charts
--chart-repos jaeger=https://jaegertracing.github.io/helm-charts"

- name: Run make check-examples
run: make check-examples
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo add prometheus https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add jaeger https://jaegertracing.github.io/helm-charts
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.4.1
Expand Down
7 changes: 5 additions & 2 deletions charts/opentelemetry-demo/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ dependencies:
- name: opentelemetry-collector
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
version: 0.40.7
- name: jaeger
repository: https://jaegertracing.github.io/helm-charts
version: 0.65.1
- name: prometheus
repository: https://prometheus-community.github.io/helm-charts
version: 19.0.1
- name: grafana
repository: https://grafana.github.io/helm-charts
version: 6.45.1
digest: sha256:d22158bd1c911dd20066f1e433516e9e0377f45d93b54de2e6aba416c9955d38
generated: "2022-12-05T20:20:38.093638-05:00"
digest: sha256:02b32ea56215a94643e085cf7956130e8cf3fa6a2c656d42e539949b7e20dca8
generated: "2022-12-05T21:17:14.040795-05:00"
6 changes: 5 additions & 1 deletion charts/opentelemetry-demo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
type: application
name: opentelemetry-demo
version: 0.12.7
version: 0.13.0
description: opentelemetry demo helm chart
home: https://opentelemetry.io/
sources:
Expand All @@ -17,6 +17,10 @@ dependencies:
version: 0.40.7
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
condition: observability.otelcol.enabled
- name: jaeger
version: 0.65.1
repository: https://jaegertracing.github.io/helm-charts
condition: observability.jaeger.enabled
- name: prometheus
version: 19.0.1
repository: https://prometheus-community.github.io/helm-charts
Expand Down
147 changes: 147 additions & 0 deletions charts/opentelemetry-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,150 @@ To install the chart with the release name my-otel-demo, run the following comma
```console
helm install my-otel-demo open-telemetry/opentelemetry-demo
```

## Upgrading Chart

### To 0.13

Jaeger was moved to a Helm sub-chart instead of a local chart deployment. If you
had changes specified to the `observability.jaeger` parameter, those changes
will need to be re-implemented as sub-chart parameters under the top level
`jaeger` parameter instead.

## Chart Parameters

Chart parameters are separated in 4 general sections:
* Default - Used to specify defaults applied to all demo components
* Components - Used to configure the individual components (microservices) for
the demo
* Observability - Used to enable/disable dependencies
* Sub-charts - Configuration for all sub-charts

### Default parameters (applied to all demo components)

| Property | Description | Default |
|----------------------------------------|-------------------------------------------------------------------------------------------|------------------------------------------------------|
| `default.env` | Environment variables added to all components | Array of several OpenTelemetry environment variables |
| `default.envOverrides` | Used to override individual environment variables without re-specifying the entire array. | `[]` |
| `default.image.repository` | Demo components image name | `otel/demo` |
| `default.image.tag` | Demo components image tag (leave blank to use app version) | `nil` |
| `default.image.pullPolicy` | Demo components image pull policy | `IfNotPresent` |
| `default.image.pullSecrets` | Demo components image pull secrets | `[]` |
| `default.schedulingRules.nodeSelector` | Node labels for pod assignment | `{}` |
| `default.schedulingRules.affinity` | Man of node/pod affinities | `{}` |
| `default.schedulingRules.tolerations` | Tolerations for pod assignment | `[]` |
| `serviceAccount` | The name of the ServiceAccount to use for demo components | `""` |

### Component parameters

The OpenTelemetry demo contains several components (microservices). Each
component is configured with a common set of parameters. All components will
be defined within `components.[NAME]` where `[NAME]` is the name of the demo
component.

> **Note**
> The following parameters require a `components.[NAME].` prefix where `[NAME]`
> is the name of the demo component

| Parameter | Description | Default |
|--------------------------------|------------------------------------------------------------------------------------------|---------------------------------------------------------------|
| `enabled` | Is this component enabled | `true` |
| `useDefault.env` | Use the default environment variables in this component | `true` |
| `imageOverride.repository` | Name of image for this component | Defaults to the overall default image repository |
| `imageOverride.tag` | Tag of the image for this component | Defaults to the overall default image tag |
| `imageOverride.pullPolicy` | Image pull policy for this component | `IfNotPresent` |
| `imageOverride.pullSecrets` | Image pull secrets for this component | `[]` |
| `servicePort` | Service port used for this component | `nil` |
| `ports` | Array of ports to open for deployment and service of this component | `[]` |
| `env` | Array of environment variables added to this component | Each component will have its own set of environment variables |
| `envOverrides` | Used to override individual environment variables without re-specifying the entire array | `[]` |
| `resources` | CPU/Memory resource requests/limits | Each component will have a default memory limit set |
| `schedulingRules.nodeSelector` | Node labels for pod assignment | `{}` |
| `schedulingRules.affinity` | Man of node/pod affinities | `{}` |
| `schedulingRules.tolerations` | Tolerations for pod assignment | `[]` |
| `podAnnotations` | Pod annotations for this component | `{}` |


### Observability parameters

| Parameter | Description | Default |
|------------------------------------|-----------------------------------------------|---------|
| `observability.otelcol.enabled` | Enables the OpenTelemetry Collector sub-chart | `true` |
| `observability.jaeger.enabled` | Enables the Jaeger sub-chart | `true` |
| `observability.prometheus.enabled` | Enables the Prometheus sub-chart | `true` |
| `observability.grafana.enabled` | Enables the Grafana sub-chart | `true` |

### Sub-charts

The OpenTelemetry Demo Helm chart depends on 4 sub-charts:
* OpenTelemetry Collector
* Jaeger
* Prometheus
* Grafana

Parameters for each sub-chart can be specified within that sub-chart's
respective top level. This chart will override some of the dependent sub-chart
parameters by default. The overriden parameters are specified below.

#### OpenTelemetry Collector

> **Note**
> The following parameters have a `opentelemetry-collector.` prefix.
| Parameter | Description | Default |
|------------------|----------------------------------------------------|----------------------------------------------------------|
| `nameOverride` | Name that will be used by the sub-chart release | `otelcol` |
| `mode` | The Deployment or Daemonset mode | `deployment` |
| `resources` | CPU/Memory resource requests/limits | 100Mi memory limit |
| `service.type` | Service Type to use | `ClusterIP` |
| `ports` | Ports to enabled for the collector pod and service | `metrics` is enabled and `prometheus` is defined/enabled |
| `podAnnotations` | Pod annotations | Annotations leveraged by Prometheus scrape |
| `config` | OpenTelemetry Collector configuration | Configuration required for demo |

#### Jaeger

> **Note**
> The following parameters have a `jaeger.` prefix.
| Parameter | Description | Default |
|--------------------------------|----------------------------------------------------|-----------------------------------------------------------------------|
| `provisionDataStore.cassandra` | Provision a cassandra data store | `false` (required for AllInOne mode) |
| `allInOne.enabled` | Enable All in One In-Memory Configuration | `true` |
| `allInOne.args` | Command arguments to pass to All in One deployment | `["--memory.max-traces", "10000", "--query.base-path", "/jaeger/ui"]` |
| `allInOne.resources` | CPU/Memory resource requests/limits for All in One | 275Mi memory limit |
| `storage.type` | Storage type to use | `none` (required for AllInOne mode) |
| `agent.enabled` | Enable Jaeger agent | `false` (required for AllInOne mode) |
| `collector.enabled` | Enable Jaeger Collector | `false` (required for AllInOne mode) |
| `query.enabled` | Enable Jaeger Query | `false` (required for AllInOne mode) |

#### Prometheus

> **Note**
> The following parameters have a `prometheus.` prefix.
| Parameter | Description | Default |
|--------------------------------------|------------------------------------------------|-----------------------------------------------------------|
| `alertmanager.enabled` | Install the alertmanager | `false` |
| `configmapReload.prometheus.enabled` | Install the configmap-reload container | `false` |
| `kube-state-metrics.enabled` | Install the kube-state-metrics sub-chart | `false` |
| `prometheus-node-exporter.enabled` | Install the Prometheus Node Exporter sub-chart | `false` |
| `prometheus-pushgateway.enabled` | Install the Prometheus Push Gateway sub-chart | `false` |
| `server.global.scrape_interval` | How frequently to scrape targets by default | `5s` |
| `server.global.scrap_timeout` | How long until a scrape request times out | `3s` |
| `server.global.evaluation_interval` | How frequently to evaluate rules | `30s` |
| `service.servicePort` | Service port used | `9090` |
| `serverFiles.prometheus.yml` | Prometheus configuration file | Scrape config to get metrics from OpenTelemetry collector |

#### Grafana

> **Note**
> The following parameters have a `grafana.` prefix.
| Parameter | Description | Default |
|-----------------------|----------------------------------------------------|----------------------------------------------------------------------|
| `grafana.ini` | Grafana's primary configuration | Enables anonymous login, and proxy through the frontendProxy service |
| `adminPassword` | Password used by `admin` user | `admin` |
| `datasources` | Configure grafana datasources (passed through tpl) | Prometheus and Jaeger data sources |
| `dashboardProviders` | Configure grafana dashboard providers | Defines a `default` provider based on a file path |
| `dashboardConfigMaps` | ConfigMaps reference that contains dashboards | Dashboard config map deployed with this Helm chart |
Loading

0 comments on commit 295f03a

Please sign in to comment.