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

[nr-ebpf-agent] Supporting global.cluster name supplied by the nri bundle. #1525

Merged
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
2 changes: 1 addition & 1 deletion charts/nr-ebpf-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.9
version: 0.1.10
dependencies:
- name: common-library
version: 1.3.0
Expand Down
11 changes: 11 additions & 0 deletions charts/nr-ebpf-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ Create the name of the service account to use
{{- end }}
{{- end }}

{{/*
Return the cluster name
*/}}
{{- define "nr-ebpf-agent.clusterName" -}}
{{- if .Values.global }}
{{- .Values.global.cluster | default "" -}}
{{- else -}}
{{- "" -}}
{{- end -}}
{{- end -}}

{{/*
Return the licenseKey
*/}}
Expand Down
9 changes: 7 additions & 2 deletions charts/nr-ebpf-agent/templates/otel-collector-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $globalClusterName := include "nr-ebpf-agent.clusterName" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -111,7 +112,7 @@ data:
service:
pipelines:
traces:
receivers:
receivers:
- otlp
processors:
- resource/setup_for_local_k8s_md
Expand All @@ -122,7 +123,7 @@ data:
exporters:
- otlp
metrics:
receivers:
receivers:
- otlp
processors:
- resource/setup_for_local_k8s_md
Expand All @@ -132,4 +133,8 @@ data:
- resource/setup_for_export
exporters:
- otlp
{{- if $globalClusterName}}
clusterName: {{ $globalClusterName }}
{{ else }}
clusterName: {{ required "Please set the Kubernetes cluster name" .Values.cluster | quote }}
{{ end }}
Loading