Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
0fac832
feat(newrelic-pixie): support global.images.registry for container im…
dpacheconr Nov 14, 2025
cc389ca
feat(newrelic-pixie): add global.images.pullSecrets support
dpacheconr Nov 14, 2025
bb53407
feat(newrelic-pixie): add global.images.pullPolicy support
dpacheconr Nov 14, 2025
90c0caa
fix(newrelic-pixie): correct precedence model and restore default ima…
dpacheconr Mar 11, 2026
3849f58
test(newrelic-pixie): add global.images coverage tests with anchors
dpacheconr Mar 11, 2026
934037c
feat(newrelic-pixie): implement global value inheritance with precedence
dpacheconr Nov 26, 2025
87a5094
fix: correct global value inheritance precedence for newrelic-pixie
dpacheconr Nov 26, 2025
82b1cf9
test(newrelic-pixie): fix global inheritance test suite - all tests p…
dpacheconr Nov 26, 2025
24203ca
docs(newrelic-pixie): document global value inheritance and precedence
dpacheconr Nov 26, 2025
04958de
refactor(newrelic-pixie): standardize values.yaml comments to match e…
dpacheconr Dec 3, 2025
5a84e5a
test: strengthen global value inheritance tests with explicit assertions
dpacheconr Dec 4, 2025
02170f4
fix: resolve three template and precedence limitations
dpacheconr Dec 4, 2025
68b94fc
fix(newrelic-pixie): resolve array serialization bug in tolerations a…
dpacheconr Mar 11, 2026
7c6e810
chore: merge global.images support from support/global-images-registr…
dpacheconr Mar 24, 2026
48c0288
fix(newrelic-pixie): fix dot-in-key path assertion in configmap test
dpacheconr Mar 24, 2026
c2a1c73
Merge branch 'master' into refactor/newrelic-pixie-global-inheritance
dpacheconr Mar 24, 2026
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
55 changes: 45 additions & 10 deletions charts/newrelic-pixie/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,56 @@ helm install newrelic/newrelic-pixie \

## Globals

**Important:** global parameters have higher precedence than locals with the same name.

These are meant to be used when you are writing a chart with subcharts. It helps to avoid
setting values multiple times on different subcharts.

**Precedence Model**: For each value, the precedence is (highest to lowest):
1. **Local value** (e.g., `cluster`) - takes precedence over global
2. **Global value** (e.g., `global.cluster`) - applies if local value is not set
3. **Default value** - applies if neither local nor global value is set

More information on globals and subcharts can be found at [Helm's official documentation](https://helm.sh/docs/topics/chart_template_guide/subcharts_and_globals/).

| Parameter |
| ------------------------------- |
| `global.cluster` |
| `global.licenseKey` |
| `global.customSecretName` |
| `global.customSecretLicenseKey` |
| `global.lowDataMode` |
| `global.nrStaging` |
### Supported Global Values

| Parameter | Description | Default |
| -------------------------------------- | ----------- | ------- |
| `global.cluster` | Cluster name for Kubernetes cluster | |
| `global.licenseKey` | New Relic license key | |
| `global.customSecretName` | Name of Secret containing license key | |
| `global.customSecretLicenseKey` | Key in Secret for license key | |
| `global.lowDataMode` | If true, enable low data mode sampling | false |
| `global.nrStaging` | Send data to staging environment | false |
| `global.proxy` | HTTP/HTTPS proxy URL for connectivity | |
| `global.images.registry` | Container registry (for air-gapped environments) | |
| `global.images.pullSecrets` | Image pull secrets | |
| `global.images.pullPolicy` | Image pull policy (IfNotPresent, Always, Never) | |
| `global.nodeSelector` | Node selector for pod scheduling | {} |
| `global.tolerations` | Node tolerations for tainted nodes | [] |
| `global.affinity` | Pod affinity rules | {} |
| `global.priorityClassName` | Priority class for pod scheduling | |
| `global.podSecurityContext` | Security context for pods | |
| `global.containerSecurityContext` | Security context for containers | |
| `global.dnsConfig` | DNS configuration for pods | |
| `global.hostNetwork` | Use host network for pod | false |
| `global.labels` | Additional labels for all resources | {} |
| `global.podLabels` | Additional labels for pods | {} |

### Important Notes

- **apiKey is not inherited from global**: The Pixie API key must be provided separately as `apiKey` (not `global.licenseKey`). This is because Pixie uses a separate authentication system from New Relic.
- **Example with globals**:
```yaml
global:
cluster: my-cluster
licenseKey: <your-nrl-key>
proxy: http://proxy.example.com:3128
nodeSelector:
node.role/monitoring: "true"

# Still required - Pixie uses separate auth:
apiKey: <your-pixie-api-key>
```

## Custom scripts

Expand Down
267 changes: 234 additions & 33 deletions charts/newrelic-pixie/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,48 +37,42 @@ release: {{.Release.Name }}
{{- end }}

{{- define "newrelic-pixie.cluster" -}}
{{- if .Values.global -}}
{{- if .Values.cluster -}}
{{- .Values.cluster -}}
{{- else if .Values.global -}}
{{- if .Values.global.cluster -}}
{{- .Values.global.cluster -}}
{{- else -}}
{{- .Values.cluster | default "" -}}
{{- .Values.global.cluster -}}
{{- end -}}
{{- else -}}
{{- .Values.cluster | default "" -}}
{{- end -}}
{{- end -}}

{{- define "newrelic-pixie.nrStaging" -}}
{{- if .Values.global }}
{{- if .Values.nrStaging }}
{{- .Values.nrStaging -}}
{{- else if .Values.global }}
{{- if .Values.global.nrStaging }}
{{- .Values.global.nrStaging -}}
{{- end -}}
{{- else if .Values.nrStaging }}
{{- .Values.nrStaging -}}
{{- end -}}
{{- end -}}

{{- define "newrelic-pixie.licenseKey" -}}
{{- if .Values.global}}
{{- if .Values.licenseKey }}
{{- .Values.licenseKey -}}
{{- else if .Values.global -}}
{{- if .Values.global.licenseKey }}
{{- .Values.global.licenseKey -}}
{{- else -}}
{{- .Values.licenseKey | default "" -}}
{{- .Values.global.licenseKey -}}
{{- end -}}
{{- else -}}
{{- .Values.licenseKey | default "" -}}
{{- end -}}
{{- end -}}

{{- define "newrelic-pixie.apiKey" -}}
{{- if .Values.global}}
{{- if .Values.apiKey }}
{{- .Values.apiKey -}}
{{- else if .Values.global -}}
{{- if .Values.global.apiKey }}
{{- .Values.global.apiKey -}}
{{- else -}}
{{- .Values.apiKey | default "" -}}
{{- .Values.global.apiKey -}}
{{- end -}}
{{- else -}}
{{- .Values.apiKey | default "" -}}
{{- end -}}
{{- end -}}

Expand Down Expand Up @@ -117,14 +111,12 @@ Returns "true" if `lowDataMode` is enabled, otherwise "" (empty string)
Return the customSecretName where the New Relic license is being stored.
*/}}
{{- define "newrelic-pixie.customSecretName" -}}
{{- if .Values.global }}
{{- if .Values.customSecretName }}
{{- .Values.customSecretName -}}
{{- else if .Values.global -}}
{{- if .Values.global.customSecretName }}
{{- .Values.global.customSecretName -}}
{{- else -}}
{{- .Values.customSecretName | default "" -}}
{{- .Values.global.customSecretName -}}
{{- end -}}
{{- else -}}
{{- .Values.customSecretName | default "" -}}
{{- end -}}
{{- end -}}

Expand All @@ -139,14 +131,12 @@ Return the customSecretApiKeyName where the Pixie API key is being stored.
Return the customSecretLicenseKey
*/}}
{{- define "newrelic-pixie.customSecretLicenseKey" -}}
{{- if .Values.global }}
{{- if .Values.customSecretLicenseKey }}
{{- .Values.customSecretLicenseKey -}}
{{- else if .Values.global -}}
{{- if .Values.global.customSecretLicenseKey }}
{{- .Values.global.customSecretLicenseKey -}}
{{- else -}}
{{- .Values.customSecretLicenseKey | default "" -}}
{{- .Values.global.customSecretLicenseKey -}}
{{- end -}}
{{- else -}}
{{- .Values.customSecretLicenseKey | default "" -}}
{{- end -}}
{{- end -}}

Expand All @@ -157,6 +147,217 @@ Return the customSecretApiKeyKey
{{- .Values.customSecretApiKeyKey | default "" -}}
{{- end -}}

{{/*
Return proxy configuration from global or local values
*/}}
{{- define "newrelic-pixie.proxy" -}}
{{- if .Values.proxy }}
{{- .Values.proxy -}}
{{- else if .Values.global }}
{{- if .Values.global.proxy }}
{{- .Values.global.proxy -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return image registry from global or local values
*/}}
{{- define "newrelic-pixie.image.registry" -}}
{{- if .Values.image.registry }}
{{- .Values.image.registry -}}
{{- else if .Values.global -}}
{{- if .Values.global.images -}}
{{- if .Values.global.images.registry -}}
{{- .Values.global.images.registry -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return image pull policy from local or global values with proper fallback precedence.
Precedence: local .Values.image.pullPolicy > global.images.pullPolicy > default "IfNotPresent"
*/}}
{{- define "newrelic-pixie.image.pullPolicy" -}}
{{- if .Values.image.pullPolicy }}
{{- .Values.image.pullPolicy -}}
{{- else if .Values.global -}}
{{- if .Values.global.images -}}
{{- if .Values.global.images.pullPolicy -}}
{{- .Values.global.images.pullPolicy -}}
{{- end -}}
{{- end -}}
{{- else }}
{{- /* Default fallback when neither local nor global set */ -}}
IfNotPresent
{{- end -}}
{{- end -}}

{{/*
Return image pull secrets from global or local values, merging both
*/}}
{{- define "newrelic-pixie.image.pullSecrets" -}}
{{- $localPullSecrets := .Values.image.pullSecrets | default list -}}
{{- $globalPullSecrets := list -}}
{{- if .Values.global -}}
{{- if .Values.global.images -}}
{{- $globalPullSecrets = .Values.global.images.pullSecrets | default list -}}
{{- end -}}
{{- end -}}
{{- $merged := concat $globalPullSecrets $localPullSecrets -}}
{{- if $merged }}
{{- toYaml $merged | trim -}}
{{- end -}}
{{- end -}}

{{/*
Return nodeSelector from global or local values
*/}}
{{- define "newrelic-pixie.nodeSelector" -}}
{{- if .Values.nodeSelector }}
{{- toJson .Values.nodeSelector -}}
{{- else if .Values.global }}
{{- if .Values.global.nodeSelector }}
{{- toJson .Values.global.nodeSelector -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return tolerations from global or local values
*/}}
{{- define "newrelic-pixie.tolerations" -}}
{{- if .Values.tolerations }}
{{- toYaml .Values.tolerations | trim -}}
{{- else if .Values.global }}
{{- if .Values.global.tolerations }}
{{- toYaml .Values.global.tolerations | trim -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return affinity from global or local values
*/}}
{{- define "newrelic-pixie.affinity" -}}
{{- if .Values.affinity }}
{{- toJson .Values.affinity -}}
{{- else if .Values.global }}
{{- if .Values.global.affinity }}
{{- toJson .Values.global.affinity -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return priorityClassName from global or local values
*/}}
{{- define "newrelic-pixie.priorityClassName" -}}
{{- if .Values.priorityClassName }}
{{- .Values.priorityClassName -}}
{{- else if .Values.global }}
{{- if .Values.global.priorityClassName }}
{{- .Values.global.priorityClassName -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return podSecurityContext from global or local values
*/}}
{{- define "newrelic-pixie.podSecurityContext" -}}
{{- if .Values.podSecurityContext }}
{{- toJson .Values.podSecurityContext -}}
{{- else if .Values.global }}
{{- if .Values.global.podSecurityContext }}
{{- toJson .Values.global.podSecurityContext -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return containerSecurityContext from global or local values
*/}}
{{- define "newrelic-pixie.containerSecurityContext" -}}
{{- if .Values.containerSecurityContext }}
{{- toJson .Values.containerSecurityContext -}}
{{- else if .Values.global }}
{{- if .Values.global.containerSecurityContext }}
{{- toJson .Values.global.containerSecurityContext -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return dnsConfig from global or local values
*/}}
{{- define "newrelic-pixie.dnsConfig" -}}
{{- if .Values.dnsConfig }}
{{- toJson .Values.dnsConfig -}}
{{- else if .Values.global }}
{{- if .Values.global.dnsConfig }}
{{- toJson .Values.global.dnsConfig -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return hostNetwork from global or local values
*/}}
{{- define "newrelic-pixie.hostNetwork" -}}
{{- if kindIs "bool" .Values.hostNetwork }}
{{- .Values.hostNetwork -}}
{{- else if .Values.global }}
{{- if kindIs "bool" .Values.global.hostNetwork }}
{{- .Values.global.hostNetwork -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return labels merged from global and local values
*/}}
{{- define "newrelic-pixie.labels.merged" -}}
{{- $globalLabels := dict -}}
{{- if .Values.global -}}
{{- $globalLabels = .Values.global.labels | default dict -}}
{{- end -}}
{{- $localLabels := .Values.labels | default dict -}}
{{- $merged := merge $localLabels $globalLabels -}}
{{- if $merged }}
{{- toJson $merged -}}
{{- end -}}
{{- end -}}

{{/*
Return podLabels merged from global and local values
*/}}
{{- define "newrelic-pixie.podLabels.merged" -}}
{{- $globalLabels := dict -}}
{{- if .Values.global -}}
{{- $globalLabels = .Values.global.podLabels | default dict -}}
{{- end -}}
{{- $localLabels := .Values.podLabels | default dict -}}
{{- $merged := merge $localLabels $globalLabels -}}
{{- if $merged }}
{{- toJson $merged -}}
{{- end -}}
{{- end -}}

{{/*
Return verboseLog from global or local values
*/}}
{{- define "newrelic-pixie.verboseLog" -}}
{{- if .Values.verboseLog }}
{{- .Values.verboseLog -}}
{{- else if .Values.global }}
{{- if .Values.global.verboseLog }}
{{- .Values.global.verboseLog -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Returns if the template should render, it checks if the required values
licenseKey and cluster are set.
Expand Down
Loading
Loading