Skip to content

Commit 4920d83

Browse files
multi account support
1 parent fb0e9c1 commit 4920d83

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

charts/nr-ebpf-agent/templates/nr-ebpf-agent-daemonset.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@ spec:
9292
key: {{ include "newrelic.common.license._customSecretKey" . }}
9393
name: {{ include "newrelic.common.license._customSecretName" . }}
9494
{{- end }}
95+
{{- if or .Values.namespaceLicenseKeys .Values.customSecretNamespaceLicenseKeys }}
96+
- name: NAMESPACE_LICENSE_KEY_MAP
97+
valueFrom:
98+
secretKeyRef:
99+
{{- if .Values.namespaceLicenseKeys }}
100+
key: NAMESPACE_LICENSE_KEY_MAP
101+
name: nr-ebpf-agent-secrets
102+
{{- else }}
103+
key: NAMESPACE_LICENSE_KEY_MAP
104+
name: {{ .Values.customSecretNamespaceLicenseKeys }}
105+
{{- end }}
106+
{{- end }}
95107

96108
{{- if .Values.tableStoreDataLimitMB }}
97109
- name: TABLE_STORE_DATA_LIMIT_MB

charts/nr-ebpf-agent/templates/secrets.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ data:
1717
{{- else }}
1818
NEW_RELIC_LICENSE_KEY: {{ required "secrets.licenseKey is required" .Values.licenseKey | b64enc | quote }}
1919
{{- end }}
20+
{{- if .Values.namespaceLicenseKeys }}
21+
NAMESPACE_LICENSE_KEY_MAP: {{ .Values.namespaceLicenseKeys | toJson | b64enc }}
22+
{{- end }}

charts/nr-ebpf-agent/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ licenseKey: ""
77
customSecretName: ""
88
# -- In case you don't want to have the license key in your values, this allows you to point to which secret key is the license key located. Can be configured also with `global.customSecretLicenseKey`
99
customSecretLicenseKey: ""
10+
# -- Map of K8s namespace to New Relic license key for multi-account OTEL export routing.
11+
# -- Namespaces not in the map fall back to the global licenseKey.
12+
# -- Example:
13+
# -- namespaceLicenseKeys:
14+
# -- team-a: "NRAK-aaa..."
15+
# -- team-b: "NRAK-bbb..."
16+
namespaceLicenseKeys: {}
17+
# -- Reference to a pre-existing Kubernetes secret containing NAMESPACE_LICENSE_KEY_MAP.
18+
# -- Use this instead of namespaceLicenseKeys to avoid storing license keys in values.yaml.
19+
# -- The secret must contain a key named NAMESPACE_LICENSE_KEY_MAP with a JSON-encoded namespace-to-license-key map.
20+
customSecretNamespaceLicenseKeys: ""
1021
# -- If using a customSecretLicenseKey, you must supply your region "US"/"EU". Otherwise, leave this value as an empty string.
1122
region: ""
1223
# -- Custom OTLP endpoint URL. When set, this takes precedence over the region-based static endpoints.

0 commit comments

Comments
 (0)