Skip to content
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 otel-cloud-stack chart #1058

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

### Helm ###
**/charts/*.tgz
.DS_Store
23 changes: 23 additions & 0 deletions charts/otel-cloud-stack/.helmignore
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/
15 changes: 15 additions & 0 deletions charts/otel-cloud-stack/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dependencies:
- name: crds
repository: ""
version: 0.0.0
- name: opentelemetry-operator
repository: file://../opentelemetry-operator
version: 0.48.0
- name: kube-state-metrics
repository: https://prometheus-community.github.io/helm-charts
version: 5.16.2
- name: prometheus-node-exporter
repository: https://prometheus-community.github.io/helm-charts
version: 4.30.3
digest: sha256:3d4be94b8ce9d8ee54c0c6e304a80921d0926f5250e8e7f67c9972b82ec65d71
generated: "2024-03-04T12:00:21.318565-05:00"
29 changes: 29 additions & 0 deletions charts/otel-cloud-stack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v2
name: otel-cloud-stack
version: 0.1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather start with 0.0.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good!

description: Helm chart for an Opentelemetry Kubernetes Quickstart
type: application
home: https://opentelemetry.io/
sources:
- https://github.com/open-telemetry/opentelemetry-operator
maintainers:
- name: jaronoff97
- name: anammedina21
Comment on lines +10 to +11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please list @TylerHelmuth @dmitryax and @Allex1. I'd love if you wanted to help maintain this chart and become an approver after it is merged, we did something similar with @puckpuck and the demo chart.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do!

icon: https://raw.githubusercontent.com/cncf/artwork/a718fa97fffec1b9fd14147682e9e3ac0c8817cb/projects/opentelemetry/icon/color/opentelemetry-icon-color.png
appVersion: 0.94.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appversion corresponds with the collector, but the sources only list the operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i was thinking this would determine the version for everything this chart creates (read: collectors) but i also should pipe this in to the image used for the operator too

dependencies:
- name: crds
version: "0.0.0"
condition: prometheus.customResources.enabled
- name: opentelemetry-operator
repository: "file://../opentelemetry-operator"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use https://open-telemetry.github.io/opentelemetry-helm-charts, thats what we do for the demo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do!

version: 0.48.0
condition: opentelemetry-operator.enabled
- name: kube-state-metrics
version: "5.16.*"
repository: https://prometheus-community.github.io/helm-charts
condition: kubeStateMetrics.enabled
- name: prometheus-node-exporter
version: "4.30.*"
repository: https://prometheus-community.github.io/helm-charts
condition: nodeExporter.enabled
3 changes: 3 additions & 0 deletions charts/otel-cloud-stack/charts/crds/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
apiVersion: v2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this matches what's done in kube-prometheus-stack such that we can install the necessary prometheus CRDs in the right order. the installation of this is entirely optional and disabled by default.

name: crds
version: 0.0.0
848 changes: 848 additions & 0 deletions charts/otel-cloud-stack/charts/crds/crds/podmonitor.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're gonna allow installing the crds of other charts we should do something similar to the operator chart where we can use make to update these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! this is the pattern that i saw in kube-prometheus-stack and liked. I can update the makefile

Large diffs are not rendered by default.

876 changes: 876 additions & 0 deletions charts/otel-cloud-stack/charts/crds/crds/servicemonitor.yaml

Large diffs are not rendered by default.

168 changes: 168 additions & 0 deletions charts/otel-cloud-stack/daemon_scrape_configs.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this files do? It isn't part of template so it isn't included in any install of the chart. Is it an expected scrape config to use with the chart?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually included in the chart via the logic in the collector.yaml. The chart dynamically pulls these values in and appends them (or creates a new) prometheus scrape config in the prometheus receiver

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move them in a configs folder?

Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Collect node metrics
- job_name: kubernetes-pods
scrape_interval: 30s
kubernetes_sd_configs:
- role: pod
selectors:
- role: pod
# only scrape data from pods running on the same node as collector
field: "spec.nodeName=$OTEL_K8S_NODE_NAME"
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: true
- source_labels:
[__meta_kubernetes_pod_annotation_prometheus_io_scrape_slow]
action: drop
regex: true
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
action: replace
regex: (https?)
target_label: __scheme__
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels:
[__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
# NOTE: otel collector uses env var replacement. $$ is used as a literal $.
replacement: $$1:$$2
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_annotation_prometheus_io_param_(.+)
replacement: __param_$$1
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: pod
- source_labels: [__meta_kubernetes_pod_phase]
regex: Pending|Succeeded|Failed|Completed
action: drop
- action: replace
source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name]
target_label: job
- job_name: node-exporter
scrape_interval: 30s
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- action: replace
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- job
target_label: __tmp_prometheus_job_name
static_configs:
- targets:
- ${OTEL_K8S_NODE_IP}:9100
# We still need to scrape kubelet's CAdvisor which isn't supported
- authorization:
credentials_file: "/var/run/secrets/kubernetes.io/serviceaccount/token"
type: Bearer
follow_redirects: true
honor_labels: true
honor_timestamps: true
job_name: kubelet
kubernetes_sd_configs:
- follow_redirects: true
role: node
selectors:
- role: node
# only scrape data from pods running on the same node as collector
field: "metadata.name=$OTEL_K8S_NODE_NAME"
metric_relabel_configs:
- action: drop
regex: container_cpu_(load_average_10s|system_seconds_total|user_seconds_total)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_fs_(io_current|reads_merged_total|sector_reads_total|sector_writes_total|writes_merged_total)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_memory_(mapped_file|swap)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_(file_descriptors|tasks_state|threads_max)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_spec.*
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: ".+;"
replacement: "$1"
separator: ";"
source_labels:
- id
- pod
metrics_path: "/metrics/cadvisor"
relabel_configs:
- action: replace
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- job
target_label: __tmp_prometheus_job_name
- action: replace
replacement: "kubelet"
target_label: job
- action: replace
regex: "(.*)"
replacement: "${1}"
separator: ";"
source_labels:
- __meta_kubernetes_node_name
target_label: node
- action: replace
regex: "(.*)"
replacement: https-metrics
separator: ";"
target_label: endpoint
- action: replace
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- __metrics_path__
target_label: metrics_path
- action: hashmod
modulus: 1
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- __address__
target_label: __tmp_hash
- action: keep
regex: "$(SHARD)"
replacement: "$1"
separator: ";"
source_labels:
- __tmp_hash
scheme: https
scrape_interval: 15s
scrape_timeout: 10s
tls_config:
ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
insecure_skip_verify: true
Loading
Loading