From 61a49eec8366ca430027036fe0520cf648164ccb Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Fri, 6 Oct 2023 09:55:55 -0600 Subject: [PATCH] [collector] Add ability to enable GOMEMLIMIT (#900) * Add ability to enable GOMEMLIMIT * remove trailing spaces * Fix title * Update charts/opentelemetry-collector/UPGRADING.md Co-authored-by: Pablo Baeyens * Update charts/opentelemetry-collector/UPGRADING.md Co-authored-by: Pablo Baeyens * update warning * Cleanup merge * Apply suggestions from code review Co-authored-by: Jina Jain --------- Co-authored-by: Pablo Baeyens Co-authored-by: Jina Jain --- charts/opentelemetry-collector/Chart.yaml | 2 +- charts/opentelemetry-collector/UPGRADING.md | 12 +++ .../ci/GOMEMLIMIT-values.yaml | 3 + .../rendered/configmap-agent.yaml | 2 +- .../rendered/configmap.yaml | 2 +- .../rendered/daemonset.yaml | 4 +- .../rendered/deployment.yaml | 4 +- .../rendered/service.yaml | 2 +- .../rendered/serviceaccount.yaml | 2 +- .../rendered/configmap-agent.yaml | 2 +- .../rendered/daemonset.yaml | 4 +- .../rendered/serviceaccount.yaml | 2 +- .../rendered/configmap-agent.yaml | 2 +- .../rendered/daemonset.yaml | 4 +- .../rendered/serviceaccount.yaml | 2 +- .../rendered/configmap-agent.yaml | 2 +- .../rendered/daemonset.yaml | 4 +- .../rendered/serviceaccount.yaml | 2 +- .../rendered/configmap-agent.yaml | 2 +- .../daemonset-only/rendered/daemonset.yaml | 4 +- .../rendered/serviceaccount.yaml | 2 +- .../deployment-only/rendered/configmap.yaml | 2 +- .../deployment-only/rendered/deployment.yaml | 4 +- .../deployment-only/rendered/service.yaml | 2 +- .../rendered/serviceaccount.yaml | 2 +- .../rendered/configmap.yaml | 2 +- .../rendered/deployment.yaml | 4 +- .../rendered/service.yaml | 2 +- .../rendered/serviceaccount.yaml | 2 +- .../rendered/deployment.yaml | 2 +- .../rendered/service.yaml | 2 +- .../rendered/serviceaccount.yaml | 2 +- .../rendered/clusterrole.yaml | 2 +- .../rendered/clusterrolebinding.yaml | 2 +- .../rendered/configmap.yaml | 2 +- .../rendered/deployment.yaml | 4 +- .../rendered/service.yaml | 2 +- .../rendered/serviceaccount.yaml | 2 +- .../rendered/configmap-statefulset.yaml | 2 +- .../statefulset-only/rendered/service.yaml | 2 +- .../rendered/serviceaccount.yaml | 2 +- .../rendered/statefulset.yaml | 4 +- .../using-GOMEMLIMIT/rendered/configmap.yaml | 85 ++++++++++++++++ .../using-GOMEMLIMIT/rendered/deployment.yaml | 98 +++++++++++++++++++ .../using-GOMEMLIMIT/rendered/service.yaml | 48 +++++++++ .../rendered/serviceaccount.yaml | 13 +++ .../examples/using-GOMEMLIMIT/values.yaml | 6 ++ .../templates/NOTES.txt | 4 + .../templates/_config.tpl | 15 ++- .../templates/_helpers.tpl | 34 +++++++ .../templates/_pod.tpl | 4 + .../values.schema.json | 3 + charts/opentelemetry-collector/values.yaml | 8 ++ 53 files changed, 380 insertions(+), 53 deletions(-) create mode 100644 charts/opentelemetry-collector/ci/GOMEMLIMIT-values.yaml create mode 100644 charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/configmap.yaml create mode 100644 charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/deployment.yaml create mode 100644 charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/service.yaml create mode 100644 charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/serviceaccount.yaml create mode 100644 charts/opentelemetry-collector/examples/using-GOMEMLIMIT/values.yaml diff --git a/charts/opentelemetry-collector/Chart.yaml b/charts/opentelemetry-collector/Chart.yaml index d402bae1f..429361260 100644 --- a/charts/opentelemetry-collector/Chart.yaml +++ b/charts/opentelemetry-collector/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: opentelemetry-collector -version: 0.70.0 +version: 0.71.0 description: OpenTelemetry Collector Helm chart for Kubernetes type: application home: https://opentelemetry.io/ diff --git a/charts/opentelemetry-collector/UPGRADING.md b/charts/opentelemetry-collector/UPGRADING.md index 017689950..6a3a7e778 100644 --- a/charts/opentelemetry-collector/UPGRADING.md +++ b/charts/opentelemetry-collector/UPGRADING.md @@ -4,6 +4,18 @@ These upgrade guidelines only contain instructions for version upgrades which re If the version you want to upgrade to is not listed here, then there is nothing to do for you. Just upgrade and enjoy. +## Feature Flags + +### useGOMEMLIMIT + +A new flag, `useGOMEMLIMIT` has been added that allows specifying whether or not the chart should use the `GOMEMLIMIT` environment variable or the Memory Ballast Extension. +When enabled, the chart will remove the Memory Ballast Extension from the collector's configuration AND will setup a `GOMEMLIMIT` environment variable that is set to 80% +of the configured `resources.limits.memory`. If no `resources.limits.memory` are set when `useGOMEMLIMIT` is enabled then a `GOMEMLIMIT` environment variable WILL NOT be +created but the Memory Ballast Extension will still be removed. + +If you are not interested in using `GOMEMLIMIT` then this change does not affect you. But, depending on the progress made in [Issue 891](https://github.com/open-telemetry/opentelemetry-helm-charts/issues/891), +the use of `GOMEMLIMIT` may completely replace the Memory Ballast Extension in the future. + ## 0.69.3 to 0.70.0 The following deprecated fields have been removed. Please use the new values: diff --git a/charts/opentelemetry-collector/ci/GOMEMLIMIT-values.yaml b/charts/opentelemetry-collector/ci/GOMEMLIMIT-values.yaml new file mode 100644 index 000000000..6622d50eb --- /dev/null +++ b/charts/opentelemetry-collector/ci/GOMEMLIMIT-values.yaml @@ -0,0 +1,3 @@ +mode: deployment + +useGOMEMLIMIT: true diff --git a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/configmap-agent.yaml b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/configmap-agent.yaml index 0ea64b7f4..6ccd58304 100644 --- a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/configmap-agent.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/configmap-agent.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-agent namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/configmap.yaml b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/configmap.yaml index 4ae1c9f2b..6976c3f84 100644 --- a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/configmap.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/configmap.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/daemonset.yaml b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/daemonset.yaml index ccf93a663..a0ca1d2e2 100644 --- a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/daemonset.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/daemonset.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-agent namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" @@ -22,7 +22,7 @@ spec: template: metadata: annotations: - checksum/config: ccab9d99705eed0434bb4ffcd924aa81b3622af921df46de739520808aff3246 + checksum/config: 88e694bff97ab33455b2e53ade6109785a6d687673e7f632f985ceed0dc86413 labels: app.kubernetes.io/name: opentelemetry-collector diff --git a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/deployment.yaml b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/deployment.yaml index 671145023..0b384e534 100644 --- a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/deployment.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/deployment.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" @@ -24,7 +24,7 @@ spec: template: metadata: annotations: - checksum/config: 24b5ef86a727e5f75d401c67bee702751bbfff70f16cf50abac1de7d0cbe2873 + checksum/config: dfc7dbcb5bff86eb9e0e8a6030af4acf76abb73bd3951e43605033bf061484ab labels: app.kubernetes.io/name: opentelemetry-collector diff --git a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/service.yaml b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/service.yaml index 0e850917d..48f6df47d 100644 --- a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/service.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/service.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/serviceaccount.yaml index 26dc5db54..d5fbeb81d 100644 --- a/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/serviceaccount.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/configmap-agent.yaml b/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/configmap-agent.yaml index b303cd83d..61c75e5ef 100644 --- a/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/configmap-agent.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/configmap-agent.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-agent namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/daemonset.yaml b/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/daemonset.yaml index 6cea5d925..b4eab6901 100644 --- a/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/daemonset.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/daemonset.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-agent namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" @@ -22,7 +22,7 @@ spec: template: metadata: annotations: - checksum/config: 73a39e4f304375d3b9e068d5c81234b4516fb1de436ef2543cb1f1f44767f477 + checksum/config: e7b3535c56d7a1434ffd60d4eea790d39add0d6e7627a57249910a4c2d727441 labels: app.kubernetes.io/name: opentelemetry-collector diff --git a/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/serviceaccount.yaml index 26dc5db54..d5fbeb81d 100644 --- a/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/serviceaccount.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-collector-logs/rendered/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/configmap-agent.yaml b/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/configmap-agent.yaml index 41b0b53a9..857ffe7b1 100644 --- a/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/configmap-agent.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/configmap-agent.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-agent namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/daemonset.yaml b/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/daemonset.yaml index db8a4de51..4ab396f73 100644 --- a/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/daemonset.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/daemonset.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-agent namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" @@ -22,7 +22,7 @@ spec: template: metadata: annotations: - checksum/config: cde6c4571da1a1b8e9efa472a125615a0d02751b0b71e0ceabcf8423b881656e + checksum/config: 42c6ca46b9fcdf08ad5082f6906e4d8bf0a31db0d5cb4250bd2a2f60be0a736e labels: app.kubernetes.io/name: opentelemetry-collector diff --git a/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/serviceaccount.yaml index 26dc5db54..d5fbeb81d 100644 --- a/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/serviceaccount.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-hostmetrics/rendered/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/configmap-agent.yaml b/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/configmap-agent.yaml index d86ef1d86..b6eacebea 100644 --- a/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/configmap-agent.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/configmap-agent.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-agent namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/daemonset.yaml b/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/daemonset.yaml index 3d60f445c..a6337599c 100644 --- a/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/daemonset.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/daemonset.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-agent namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" @@ -22,7 +22,7 @@ spec: template: metadata: annotations: - checksum/config: 2309aae86d18f4d766dee4f7c66dc18a33d5cee1f2a20ff4d9b1a7f1d8e06b18 + checksum/config: 46730dd9caadfde06da33495dc3db9fc5c0676776c31ce158a81876258d33326 labels: app.kubernetes.io/name: opentelemetry-collector diff --git a/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/serviceaccount.yaml index 26dc5db54..d5fbeb81d 100644 --- a/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/serviceaccount.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-lifecycle-hooks/rendered/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-only/rendered/configmap-agent.yaml b/charts/opentelemetry-collector/examples/daemonset-only/rendered/configmap-agent.yaml index d86ef1d86..b6eacebea 100644 --- a/charts/opentelemetry-collector/examples/daemonset-only/rendered/configmap-agent.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-only/rendered/configmap-agent.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-agent namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/daemonset-only/rendered/daemonset.yaml b/charts/opentelemetry-collector/examples/daemonset-only/rendered/daemonset.yaml index 35526387c..0a700d106 100644 --- a/charts/opentelemetry-collector/examples/daemonset-only/rendered/daemonset.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-only/rendered/daemonset.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-agent namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" @@ -22,7 +22,7 @@ spec: template: metadata: annotations: - checksum/config: 2309aae86d18f4d766dee4f7c66dc18a33d5cee1f2a20ff4d9b1a7f1d8e06b18 + checksum/config: 46730dd9caadfde06da33495dc3db9fc5c0676776c31ce158a81876258d33326 labels: app.kubernetes.io/name: opentelemetry-collector diff --git a/charts/opentelemetry-collector/examples/daemonset-only/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/daemonset-only/rendered/serviceaccount.yaml index 26dc5db54..d5fbeb81d 100644 --- a/charts/opentelemetry-collector/examples/daemonset-only/rendered/serviceaccount.yaml +++ b/charts/opentelemetry-collector/examples/daemonset-only/rendered/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/deployment-only/rendered/configmap.yaml b/charts/opentelemetry-collector/examples/deployment-only/rendered/configmap.yaml index 4ae1c9f2b..6976c3f84 100644 --- a/charts/opentelemetry-collector/examples/deployment-only/rendered/configmap.yaml +++ b/charts/opentelemetry-collector/examples/deployment-only/rendered/configmap.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/deployment-only/rendered/deployment.yaml b/charts/opentelemetry-collector/examples/deployment-only/rendered/deployment.yaml index 18fe96225..446c746f0 100644 --- a/charts/opentelemetry-collector/examples/deployment-only/rendered/deployment.yaml +++ b/charts/opentelemetry-collector/examples/deployment-only/rendered/deployment.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" @@ -24,7 +24,7 @@ spec: template: metadata: annotations: - checksum/config: 24b5ef86a727e5f75d401c67bee702751bbfff70f16cf50abac1de7d0cbe2873 + checksum/config: dfc7dbcb5bff86eb9e0e8a6030af4acf76abb73bd3951e43605033bf061484ab labels: app.kubernetes.io/name: opentelemetry-collector diff --git a/charts/opentelemetry-collector/examples/deployment-only/rendered/service.yaml b/charts/opentelemetry-collector/examples/deployment-only/rendered/service.yaml index 0e850917d..48f6df47d 100644 --- a/charts/opentelemetry-collector/examples/deployment-only/rendered/service.yaml +++ b/charts/opentelemetry-collector/examples/deployment-only/rendered/service.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/deployment-only/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/deployment-only/rendered/serviceaccount.yaml index 26dc5db54..d5fbeb81d 100644 --- a/charts/opentelemetry-collector/examples/deployment-only/rendered/serviceaccount.yaml +++ b/charts/opentelemetry-collector/examples/deployment-only/rendered/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/configmap.yaml b/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/configmap.yaml index 8cb120321..69c0c5346 100644 --- a/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/configmap.yaml +++ b/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/configmap.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/deployment.yaml b/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/deployment.yaml index 2ff14b66b..38364b18e 100644 --- a/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/deployment.yaml +++ b/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/deployment.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" @@ -24,7 +24,7 @@ spec: template: metadata: annotations: - checksum/config: a870cb9fafbd2b89ea7d94d1ba82beabb19266ea8cc59e7d07d18f9fef1e68ae + checksum/config: ae671240415415a486f2b20b6f4d4890f39c1460c48356f7e5c860e23aa50e27 labels: app.kubernetes.io/name: opentelemetry-collector diff --git a/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/service.yaml b/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/service.yaml index 230c96589..e10a20f9a 100644 --- a/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/service.yaml +++ b/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/service.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/serviceaccount.yaml index 26dc5db54..d5fbeb81d 100644 --- a/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/serviceaccount.yaml +++ b/charts/opentelemetry-collector/examples/deployment-otlp-traces/rendered/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/deployment.yaml b/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/deployment.yaml index 56a1decdc..3ce53bfca 100644 --- a/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/deployment.yaml +++ b/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/deployment.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/service.yaml b/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/service.yaml index 0e850917d..48f6df47d 100644 --- a/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/service.yaml +++ b/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/service.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/serviceaccount.yaml index 26dc5db54..d5fbeb81d 100644 --- a/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/serviceaccount.yaml +++ b/charts/opentelemetry-collector/examples/deployment-use-existing-configMap/rendered/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/clusterrole.yaml b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/clusterrole.yaml index 0d2002190..55bb49624 100644 --- a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/clusterrole.yaml +++ b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/clusterrole.yaml @@ -5,7 +5,7 @@ kind: ClusterRole metadata: name: example-opentelemetry-collector labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/clusterrolebinding.yaml b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/clusterrolebinding.yaml index 5a757502f..8ec9c8748 100644 --- a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/clusterrolebinding.yaml +++ b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/clusterrolebinding.yaml @@ -5,7 +5,7 @@ kind: ClusterRoleBinding metadata: name: example-opentelemetry-collector labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/configmap.yaml b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/configmap.yaml index 625c4b1b2..c85281e5a 100644 --- a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/configmap.yaml +++ b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/configmap.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/deployment.yaml b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/deployment.yaml index 7d0f022c0..b0d444a0b 100644 --- a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/deployment.yaml +++ b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/deployment.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" @@ -24,7 +24,7 @@ spec: template: metadata: annotations: - checksum/config: ab42dfd87bc2e0501b0c739c20dbd1bb5f7d308caedef4f8fd42da9eace31248 + checksum/config: 796ff6e0130991300179128fda925c41774058ae51517353042c37013fc5e1be labels: app.kubernetes.io/name: opentelemetry-collector diff --git a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/service.yaml b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/service.yaml index 0e850917d..48f6df47d 100644 --- a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/service.yaml +++ b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/service.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/serviceaccount.yaml index 26dc5db54..d5fbeb81d 100644 --- a/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/serviceaccount.yaml +++ b/charts/opentelemetry-collector/examples/kubernetesAttributes/rendered/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/statefulset-only/rendered/configmap-statefulset.yaml b/charts/opentelemetry-collector/examples/statefulset-only/rendered/configmap-statefulset.yaml index 3c46f9b98..bea10137e 100644 --- a/charts/opentelemetry-collector/examples/statefulset-only/rendered/configmap-statefulset.yaml +++ b/charts/opentelemetry-collector/examples/statefulset-only/rendered/configmap-statefulset.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector-statefulset namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/statefulset-only/rendered/service.yaml b/charts/opentelemetry-collector/examples/statefulset-only/rendered/service.yaml index 4cd3921c0..3744590c5 100644 --- a/charts/opentelemetry-collector/examples/statefulset-only/rendered/service.yaml +++ b/charts/opentelemetry-collector/examples/statefulset-only/rendered/service.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/statefulset-only/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/statefulset-only/rendered/serviceaccount.yaml index 26dc5db54..d5fbeb81d 100644 --- a/charts/opentelemetry-collector/examples/statefulset-only/rendered/serviceaccount.yaml +++ b/charts/opentelemetry-collector/examples/statefulset-only/rendered/serviceaccount.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" diff --git a/charts/opentelemetry-collector/examples/statefulset-only/rendered/statefulset.yaml b/charts/opentelemetry-collector/examples/statefulset-only/rendered/statefulset.yaml index 763c2a365..fab1019ea 100644 --- a/charts/opentelemetry-collector/examples/statefulset-only/rendered/statefulset.yaml +++ b/charts/opentelemetry-collector/examples/statefulset-only/rendered/statefulset.yaml @@ -6,7 +6,7 @@ metadata: name: example-opentelemetry-collector namespace: default labels: - helm.sh/chart: opentelemetry-collector-0.70.0 + helm.sh/chart: opentelemetry-collector-0.71.0 app.kubernetes.io/name: opentelemetry-collector app.kubernetes.io/instance: example app.kubernetes.io/version: "0.86.0" @@ -25,7 +25,7 @@ spec: template: metadata: annotations: - checksum/config: a8993a6c320e9994f1e7ce6fc85cafc0ff0f07927397bbd01d9be97bda935378 + checksum/config: 7647078fa6404a9719ded58e644a14a781438c45d8f0a560ed16aee2540ac451 labels: app.kubernetes.io/name: opentelemetry-collector diff --git a/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/configmap.yaml b/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/configmap.yaml new file mode 100644 index 000000000..0385fb937 --- /dev/null +++ b/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/configmap.yaml @@ -0,0 +1,85 @@ +--- +# Source: opentelemetry-collector/templates/configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: example-opentelemetry-collector + namespace: default + labels: + helm.sh/chart: opentelemetry-collector-0.71.0 + app.kubernetes.io/name: opentelemetry-collector + app.kubernetes.io/instance: example + app.kubernetes.io/version: "0.86.0" + app.kubernetes.io/managed-by: Helm +data: + relay: | + exporters: + debug: {} + logging: {} + extensions: + health_check: {} + processors: + batch: {} + memory_limiter: + check_interval: 5s + limit_percentage: 80 + spike_limit_percentage: 25 + receivers: + jaeger: + protocols: + grpc: + endpoint: ${env:MY_POD_IP}:14250 + thrift_compact: + endpoint: ${env:MY_POD_IP}:6831 + thrift_http: + endpoint: ${env:MY_POD_IP}:14268 + otlp: + protocols: + grpc: + endpoint: ${env:MY_POD_IP}:4317 + http: + endpoint: ${env:MY_POD_IP}:4318 + prometheus: + config: + scrape_configs: + - job_name: opentelemetry-collector + scrape_interval: 10s + static_configs: + - targets: + - ${env:MY_POD_IP}:8888 + zipkin: + endpoint: ${env:MY_POD_IP}:9411 + service: + extensions: + - health_check + pipelines: + logs: + exporters: + - debug + processors: + - memory_limiter + - batch + receivers: + - otlp + metrics: + exporters: + - debug + processors: + - memory_limiter + - batch + receivers: + - otlp + - prometheus + traces: + exporters: + - debug + processors: + - memory_limiter + - batch + receivers: + - otlp + - jaeger + - zipkin + telemetry: + metrics: + address: ${env:MY_POD_IP}:8888 diff --git a/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/deployment.yaml b/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/deployment.yaml new file mode 100644 index 000000000..a002e6531 --- /dev/null +++ b/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/deployment.yaml @@ -0,0 +1,98 @@ +--- +# Source: opentelemetry-collector/templates/deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: example-opentelemetry-collector + namespace: default + labels: + helm.sh/chart: opentelemetry-collector-0.71.0 + app.kubernetes.io/name: opentelemetry-collector + app.kubernetes.io/instance: example + app.kubernetes.io/version: "0.86.0" + app.kubernetes.io/managed-by: Helm +spec: + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: opentelemetry-collector + app.kubernetes.io/instance: example + component: standalone-collector + strategy: + type: RollingUpdate + template: + metadata: + annotations: + checksum/config: bccfb78587ee2550c78e1213c1db4c5a3c40b958eec6c021a893c9c2baad0211 + + labels: + app.kubernetes.io/name: opentelemetry-collector + app.kubernetes.io/instance: example + component: standalone-collector + + spec: + + serviceAccountName: example-opentelemetry-collector + securityContext: + {} + containers: + - name: opentelemetry-collector + command: + - /otelcol-contrib + - --config=/conf/relay.yaml + securityContext: + {} + image: "otel/opentelemetry-collector-contrib:0.86.0" + imagePullPolicy: IfNotPresent + ports: + + - name: jaeger-compact + containerPort: 6831 + protocol: UDP + - name: jaeger-grpc + containerPort: 14250 + protocol: TCP + - name: jaeger-thrift + containerPort: 14268 + protocol: TCP + - name: otlp + containerPort: 4317 + protocol: TCP + - name: otlp-http + containerPort: 4318 + protocol: TCP + - name: zipkin + containerPort: 9411 + protocol: TCP + env: + - name: MY_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: GOMEMLIMIT + value: 156Mi + livenessProbe: + httpGet: + path: / + port: 13133 + readinessProbe: + httpGet: + path: / + port: 13133 + resources: + limits: + cpu: 100m + memory: 200M + volumeMounts: + - mountPath: /conf + name: opentelemetry-collector-configmap + volumes: + - name: opentelemetry-collector-configmap + configMap: + name: example-opentelemetry-collector + items: + - key: relay + path: relay.yaml + hostNetwork: false diff --git a/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/service.yaml b/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/service.yaml new file mode 100644 index 000000000..48f6df47d --- /dev/null +++ b/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/service.yaml @@ -0,0 +1,48 @@ +--- +# Source: opentelemetry-collector/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: example-opentelemetry-collector + namespace: default + labels: + helm.sh/chart: opentelemetry-collector-0.71.0 + app.kubernetes.io/name: opentelemetry-collector + app.kubernetes.io/instance: example + app.kubernetes.io/version: "0.86.0" + app.kubernetes.io/managed-by: Helm + component: standalone-collector +spec: + type: ClusterIP + ports: + + - name: jaeger-compact + port: 6831 + targetPort: 6831 + protocol: UDP + - name: jaeger-grpc + port: 14250 + targetPort: 14250 + protocol: TCP + - name: jaeger-thrift + port: 14268 + targetPort: 14268 + protocol: TCP + - name: otlp + port: 4317 + targetPort: 4317 + protocol: TCP + appProtocol: grpc + - name: otlp-http + port: 4318 + targetPort: 4318 + protocol: TCP + - name: zipkin + port: 9411 + targetPort: 9411 + protocol: TCP + selector: + app.kubernetes.io/name: opentelemetry-collector + app.kubernetes.io/instance: example + component: standalone-collector + internalTrafficPolicy: Cluster diff --git a/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/serviceaccount.yaml b/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/serviceaccount.yaml new file mode 100644 index 000000000..d5fbeb81d --- /dev/null +++ b/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/rendered/serviceaccount.yaml @@ -0,0 +1,13 @@ +--- +# Source: opentelemetry-collector/templates/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: example-opentelemetry-collector + namespace: default + labels: + helm.sh/chart: opentelemetry-collector-0.71.0 + app.kubernetes.io/name: opentelemetry-collector + app.kubernetes.io/instance: example + app.kubernetes.io/version: "0.86.0" + app.kubernetes.io/managed-by: Helm diff --git a/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/values.yaml b/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/values.yaml new file mode 100644 index 000000000..61b4acc26 --- /dev/null +++ b/charts/opentelemetry-collector/examples/using-GOMEMLIMIT/values.yaml @@ -0,0 +1,6 @@ +mode: deployment +resources: + limits: + cpu: 100m + memory: 200M +useGOMEMLIMIT: true diff --git a/charts/opentelemetry-collector/templates/NOTES.txt b/charts/opentelemetry-collector/templates/NOTES.txt index bdb572d75..4a3465612 100644 --- a/charts/opentelemetry-collector/templates/NOTES.txt +++ b/charts/opentelemetry-collector/templates/NOTES.txt @@ -31,6 +31,10 @@ [WARNING] Setting internalTrafficPolicy to 'Cluster' on Daemonset is not recommended. Consider using 'Local' instead. {{ end }} +{{- if and (.Values.useGOMEMLIMIT) (not ((((.Values.resources).limits).memory))) }} +[WARNING] "useGOMEMLIMIT" is enabled but memory limits have not been supplied, which means no GOMEMLIMIT env var was configured but the Memory Ballast Extension was removed. It is highly recommended to only use "useGOMEMLIMIT" when memory limits have been set. +{{ end }} + {{- if .Values.configMap.create }} {{- range $key, $value := (((.Values.config).service).pipelines) }} {{- if has "logging" ($value.exporters) }} diff --git a/charts/opentelemetry-collector/templates/_config.tpl b/charts/opentelemetry-collector/templates/_config.tpl index d5a5ffef7..ee5ccebd3 100644 --- a/charts/opentelemetry-collector/templates/_config.tpl +++ b/charts/opentelemetry-collector/templates/_config.tpl @@ -20,10 +20,19 @@ Merge user supplied config into memory limiter config. {{- if not $processorsConfig.memory_limiter }} {{- $_ := set $processorsConfig "memory_limiter" (include "opentelemetry-collector.memoryLimiter" . | fromYaml) }} {{- end }} -{{- $memoryBallastConfig := get .Values.config.extensions "memory_ballast" }} -{{- if or (not $memoryBallastConfig) (not $memoryBallastConfig.size_in_percentage) }} -{{- $_ := set $memoryBallastConfig "size_in_percentage" 40 }} + +{{- if .Values.useGOMEMLIMIT }} + {{- if (((.Values.config).service).extensions) }} + {{- $_ := set .Values.config.service "extensions" (without .Values.config.service.extensions "memory_ballast") }} + {{- end}} + {{- $_ := unset (.Values.config.extensions) "memory_ballast" }} +{{- else }} + {{- $memoryBallastConfig := get .Values.config.extensions "memory_ballast" }} + {{- if or (not $memoryBallastConfig) (not $memoryBallastConfig.size_in_percentage) }} + {{- $_ := set $memoryBallastConfig "size_in_percentage" 40 }} + {{- end }} {{- end }} + {{- .Values.config | toYaml }} {{- end }} diff --git a/charts/opentelemetry-collector/templates/_helpers.tpl b/charts/opentelemetry-collector/templates/_helpers.tpl index f4a755450..32329ade7 100644 --- a/charts/opentelemetry-collector/templates/_helpers.tpl +++ b/charts/opentelemetry-collector/templates/_helpers.tpl @@ -155,3 +155,37 @@ Allow the release namespace to be overridden {{- .Release.Namespace -}} {{- end -}} {{- end -}} + +{{/* +Convert memory value to numeric value in MiB to be used by otel memory_limiter processor. +*/}} +{{- define "opentelemetry-collector.convertMemToMib" -}} +{{- $mem := lower . -}} +{{- if hasSuffix "e" $mem -}} +{{- trimSuffix "e" $mem | atoi | mul 1000 | mul 1000 | mul 1000 | mul 1000 -}} +{{- else if hasSuffix "ei" $mem -}} +{{- trimSuffix "ei" $mem | atoi | mul 1024 | mul 1024 | mul 1024 | mul 1024 -}} +{{- else if hasSuffix "p" $mem -}} +{{- trimSuffix "p" $mem | atoi | mul 1000 | mul 1000 | mul 1000 -}} +{{- else if hasSuffix "pi" $mem -}} +{{- trimSuffix "pi" $mem | atoi | mul 1024 | mul 1024 | mul 1024 -}} +{{- else if hasSuffix "t" $mem -}} +{{- trimSuffix "t" $mem | atoi | mul 1000 | mul 1000 -}} +{{- else if hasSuffix "ti" $mem -}} +{{- trimSuffix "ti" $mem | atoi | mul 1024 | mul 1024 -}} +{{- else if hasSuffix "g" $mem -}} +{{- trimSuffix "g" $mem | atoi | mul 1000 -}} +{{- else if hasSuffix "gi" $mem -}} +{{- trimSuffix "gi" $mem | atoi | mul 1024 -}} +{{- else if hasSuffix "m" $mem -}} +{{- div (trimSuffix "m" $mem | atoi | mul 1000) 1024 -}} +{{- else if hasSuffix "mi" $mem -}} +{{- trimSuffix "mi" $mem | atoi -}} +{{- else if hasSuffix "k" $mem -}} +{{- div (trimSuffix "k" $mem | atoi) 1000 -}} +{{- else if hasSuffix "ki" $mem -}} +{{- div (trimSuffix "ki" $mem | atoi) 1024 -}} +{{- else -}} +{{- div (div ($mem | atoi) 1024) 1024 -}} +{{- end -}} +{{- end -}} diff --git a/charts/opentelemetry-collector/templates/_pod.tpl b/charts/opentelemetry-collector/templates/_pod.tpl index 1237b23a7..d79ed86bb 100644 --- a/charts/opentelemetry-collector/templates/_pod.tpl +++ b/charts/opentelemetry-collector/templates/_pod.tpl @@ -47,6 +47,10 @@ containers: fieldRef: fieldPath: spec.nodeName {{- end }} + {{- if and (.Values.useGOMEMLIMIT) ((((.Values.resources).limits).memory)) }} + - name: GOMEMLIMIT + value: {{ div (mul (include "opentelemetry-collector.convertMemToMib" .Values.resources.limits.memory) 80) 100 }}Mi + {{- end }} {{- with .Values.extraEnvs }} {{- . | toYaml | nindent 6 }} {{- end }} diff --git a/charts/opentelemetry-collector/values.schema.json b/charts/opentelemetry-collector/values.schema.json index bcccfffa1..3bc0b0e2d 100644 --- a/charts/opentelemetry-collector/values.schema.json +++ b/charts/opentelemetry-collector/values.schema.json @@ -899,6 +899,9 @@ } } } + }, + "useGOMEMLIMIT": { + "type": "boolean" } }, "required": ["mode"] diff --git a/charts/opentelemetry-collector/values.yaml b/charts/opentelemetry-collector/values.yaml index 0d493c766..96c6fd2f2 100644 --- a/charts/opentelemetry-collector/values.yaml +++ b/charts/opentelemetry-collector/values.yaml @@ -563,3 +563,11 @@ networkPolicy: # ports: # - port: 1234 # protocol: TCP + +# When enabled, the chart will set the GOMEMLIMIT env var to 80% of the configured +# resources.limits.memory and remove the memory ballast extension. +# If no resources.limits.memory are defined enabling does nothing. +# In a future release this setting will be enabled by default. +# See https://github.com/open-telemetry/opentelemetry-helm-charts/issues/891 +# for more details. +useGOMEMLIMIT: false