-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add opentelemetry-demo chart #280
Merged
Merged
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
d2faff6
add opentelemetry-demo chart
wph95 2180efe
fix lint
wph95 ce6b943
add README.and rename to opentelemetry-demo-webstore
wph95 fb696b1
Reduce the complexity of using otelcol's config by default (future fl…
wph95 03f7cbc
rename to opentelemetry-demo-webstore
wph95 45ad66d
clean up code
wph95 bae3e62
Apply suggestions from code review
wph95 e165617
add @dmitryax and @tigrannajaryan as opentelemetry-demo-webstore main…
wph95 0f665dc
double check jaeger/otelcol ports
wph95 c275b2f
Update charts/opentelemetry-demo-webstore/Chart.yaml
wph95 eeaca9b
1. rename _pod.tpl
wph95 97b57fc
Merge branch 'wph95/otel-demo' of github.com:wph95/opentelemetry-helm…
wph95 0417201
add tyler helmuth as maintainers
wph95 9b69ba5
fixed load generator not working
wph95 176aae6
fixed some service not send trace
wph95 4f77051
rename opentelemetry-demo-webstore to opentelemetry-demo
wph95 d3ecf6c
improve notes.txt
wph95 657b9da
Merge branch 'main' into wph95/otel-demo
wph95 949ff08
remove depends_on in value.yaml
wph95 24ca21d
style fix
wph95 5052d69
change value.yaml compoents name to camelCase
wph95 34b289f
add schema.json
wph95 cb3c5bc
Merge branch 'main' into wph95/otel-demo
wph95 6cbc2ae
Update charts/opentelemetry-demo-webstore/templates/NOTES.txt
wph95 efa09de
rename
wph95 7659844
Update charts/opentelemetry-demo/values.schema.json
wph95 ee2781f
move logic to _objects.tpl
wph95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v2 | ||
type: application | ||
name: opentelemetry-demo | ||
version: 0.1.0 | ||
description: opentelemetry demo helm chart | ||
home: https://opentelemetry.io/ | ||
sources: | ||
- https://github.com/open-telemetry/opentelemetry-demo | ||
maintainers: | ||
- name: dmitryax | ||
- name: tylerhelmuth | ||
- name: wph95 | ||
icon: https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png | ||
appVersion: "0.2.0-alpha" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# OpenTelemetry Demo Helm Chart | ||
|
||
The helm chart installs [OpenTelemetry Demo](https://github.com/open-telemetry/opentelemetry-demo) | ||
in kubernetes cluster. | ||
|
||
## Prerequisites | ||
|
||
- Helm 3.0+ | ||
|
||
## Installing the Chart | ||
|
||
Add OpenTelemetry Helm repository: | ||
|
||
```console | ||
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 following command: | ||
|
||
```console | ||
helm install my-otel-demo open-telemetry/opentelemetry-demo | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
======================================================================================= | ||
|
||
|
||
██████╗ ████████╗███████╗██╗ ██████╗ ███████╗███╗ ███╗ ██████╗ | ||
██╔═══██╗╚══██╔══╝██╔════╝██║ ██╔══██╗██╔════╝████╗ ████║██╔═══██╗ | ||
██║ ██║ ██║ █████╗ ██║ ██║ ██║█████╗ ██╔████╔██║██║ ██║ | ||
██║ ██║ ██║ ██╔══╝ ██║ ██║ ██║██╔══╝ ██║╚██╔╝██║██║ ██║ | ||
╚██████╔╝ ██║ ███████╗███████╗ ██████╔╝███████╗██║ ╚═╝ ██║╚██████╔╝ | ||
╚═════╝ ╚═╝ ╚══════╝╚══════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ | ||
|
||
|
||
- Frontend UI: http://localhost:8080 | ||
by running these commands: | ||
kubectl port-forward svc/{{ include "otel-demo.name" . }}-frontend 8080:8080 | ||
|
||
|
||
{{- if $.Values.observability.jaeger.enabled }} | ||
|
||
- Jaeger UI: http://localhost:16686 | ||
by running these commands: | ||
kubectl port-forward svc/{{ include "otel-demo.name" . }}-jaeger 16686:16686 | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{{- define "otel.demo.deployment" }} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "otel-demo.name" . }}-{{ .name }} | ||
labels: | ||
{{- include "otel-demo.labels" . | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "otel-demo.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "otel-demo.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- if .imageConfig.pullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml .imageConfig.pullSecrets | nindent 8}} | ||
{{- end }} | ||
{{- with .serviceAccountName }} | ||
serviceAccountName: {{ .serviceAccountName}} | ||
{{- end }} | ||
containers: | ||
- name: {{ .name }} | ||
image: {{ .image | default (printf "%s:v%s-%s" .imageConfig.repository .Chart.AppVersion (.name | replace "-" "" | lower)) }} | ||
{{- if or .ports .servicePort}} | ||
ports: | ||
{{- include "otel-demo.pod.ports" . | nindent 10 }} | ||
{{- end }} | ||
env: | ||
{{- include "otel-demo.pod.env" . | nindent 10 }} | ||
|
||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "otel-demo.name" -}} | ||
{{- default .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "otel-demo.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "otel-demo.labels" -}} | ||
helm.sh/chart: {{ include "otel-demo.chart" . }} | ||
{{ include "otel-demo.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "otel-demo.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "otel-demo.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- if .name }} | ||
app.kubernetes.io/component: {{ .name}} | ||
{{- end}} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{{/* | ||
Component Depends Config | ||
*/}} | ||
{{- define "otel-demo.pod.dependsConfig" -}} | ||
cart-service: | ||
- redis | ||
checkout-service: | ||
- cart-service | ||
- currency-service | ||
- email-service | ||
- payment-service | ||
- product-catalog-service | ||
- shipping-service | ||
frontend: | ||
- ad-service | ||
- cart-service | ||
- checkout-service | ||
- currency-service | ||
- product-catalog-service | ||
- recommendation-service | ||
- shipping-service | ||
loadgenerator: | ||
- frontend | ||
recommendation-service: | ||
- product-catalog-service | ||
{{- end}} | ||
|
||
|
||
{{/* | ||
Get Services Port Mapping | ||
*/}} | ||
{{- define "otel-demo.pod.serviceMapping" -}} | ||
{{ $servicePortMap := default dict }} | ||
{{- range $name, $config := .Values.components }} | ||
{{- if $config.servicePort }} | ||
{{ $name | kebabcase }}: {{ $config.servicePort }} | ||
{{- else if $config.ports }} | ||
{{ $name | kebabcase}}: {{ (get (index $config.ports 0 ) "value") }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Get Pod Env | ||
*/}} | ||
{{- define "otel-demo.pod.env" -}} | ||
{{- $prefix := include "otel-demo.name" $ }} | ||
|
||
{{- if .env }} | ||
{{- toYaml .env }} | ||
{{- end }} | ||
|
||
{{- if .observability.otelcol.enabled }} | ||
- name: OTEL_EXPORTER_OTLP_ENDPOINT | ||
value: http://{{ include "otel-demo.name" . }}-otelcol:4317 | ||
- name: OTEL_RESOURCE_ATTRIBUTES | ||
value: service.name={{ .name | kebabcase }} | ||
{{- end }} | ||
|
||
{{- if .servicePort}} | ||
- name: {{ printf "%s_PORT" .name | snakecase | upper }} | ||
value: {{.servicePort | quote}} | ||
{{- end }} | ||
|
||
# {{ $.depends }} | ||
# {{ .name }} | ||
{{- if hasKey $.depends .name }} | ||
{{- range $depend := get $.depends .name }} | ||
- name: {{ printf "%s_ADDR" $depend | snakecase | upper }} | ||
value: {{ printf "%s-%s:%0.f" $prefix ($depend | kebabcase) (get $.serviceMapping $depend )}} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- end }} | ||
|
||
{{/* | ||
Get Pod ports | ||
*/}} | ||
{{- define "otel-demo.pod.ports" -}} | ||
{{- if .ports }} | ||
{{- range $port := .ports }} | ||
- containerPort: {{ $port.value }} | ||
name: {{ $port.name}} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- if .servicePort }} | ||
- containerPort: {{.servicePort}} | ||
name: service | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{ $serviceMapping := include "otel-demo.pod.serviceMapping" . | fromYaml}} | ||
{{ $depends := include "otel-demo.pod.dependsConfig" . | fromYaml }} | ||
{{- range $name, $config := .Values.components }} | ||
{{- $config := set . "name" ($name | kebabcase) }} | ||
{{- $config := set . "Release" $.Release }} | ||
{{- $config := set . "Chart" $.Chart }} | ||
{{- $config := set . "imageConfig" $.Values.image }} | ||
{{- $config := set . "serviceAccount" $.Values.serviceAccount }} | ||
{{- $config := set . "observability" $.Values.observability }} | ||
{{- $config := set . "serviceMapping" $serviceMapping }} | ||
{{- $config := set . "depends" $depends }} | ||
|
||
{{- if $config.enabled -}} | ||
{{- include "otel.demo.deployment" $config -}} | ||
{{- include "otel.demo.service" $config -}} | ||
{{ end }} | ||
|
||
{{- end }} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{- $config := set . "name" "jaeger" }} | ||
{{- if $.Values.observability.jaeger.enabled -}} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "otel-demo.name" . }}-{{ .name }} | ||
labels: | ||
{{- include "otel-demo.labels" . | nindent 4 }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{- include "otel-demo.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "otel-demo.selectorLabels" . | nindent 8 }} | ||
spec: | ||
containers: | ||
- env: | ||
- name: COLLECTOR_ZIPKIN_HTTP_PORT | ||
value: "9411" | ||
image: jaegertracing/all-in-one | ||
name: jaeger | ||
ports: | ||
- containerPort: 5775 | ||
protocol: UDP | ||
- containerPort: 6831 | ||
protocol: UDP | ||
- containerPort: 6832 | ||
protocol: UDP | ||
- containerPort: 5778 | ||
protocol: TCP | ||
- containerPort: 16686 | ||
protocol: TCP | ||
- containerPort: 14268 | ||
protocol: TCP | ||
- containerPort: 9411 | ||
protocol: TCP | ||
- containerPort: 14250 | ||
protocol: TCP | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "otel-demo.name" . }}-{{ .name }} | ||
labels: | ||
{{- include "otel-demo.labels" . | nindent 4 }} | ||
spec: | ||
ports: | ||
- name: frontend | ||
port: 16686 | ||
protocol: TCP | ||
targetPort: 16686 | ||
- name: collector | ||
port: 14250 | ||
protocol: TCP | ||
targetPort: 14250 | ||
selector: | ||
{{- include "otel-demo.selectorLabels" . | nindent 4 }} | ||
{{- end }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.