Skip to content

Commit

Permalink
Merge branch 'master' into pbeckwith/add-ebpf
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip-R-Beckwith authored Nov 7, 2024
2 parents d1956b5 + 5f9669c commit 703af52
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/newrelic-logging/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: A Helm chart to deploy New Relic Kubernetes Logging as a DaemonSet, supporting both Linux and Windows nodes and containers
name: newrelic-logging
version: 1.23.3
version: 1.23.5
appVersion: 2.1.0
home: https://github.com/newrelic/kubernetes-logging
icon: https://newrelic.com/assets/newrelic/source/NewRelic-logo-square.svg
Expand Down
2 changes: 2 additions & 0 deletions charts/newrelic-logging/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ Returns metricsHost
{{- define "newrelic-logging.metricsHost" -}}
{{- if (include "newrelic.nrStaging" .) -}}
staging-metric-api.newrelic.com
{{- else if .Values.metricsEndpoint -}}
{{ .Values.metricsEndpoint -}}
{{- else if eq (substr 0 2 (include "newrelic-logging.licenseKey" .)) "eu" -}}
metric-api.eu.newrelic.com
{{- else -}}
Expand Down
113 changes: 113 additions & 0 deletions charts/newrelic-logging/tests/endpoint_region_selection_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,117 @@ tests:
content:
name: ENDPOINT
value: "custom"
template: templates/daemonset-windows.yaml
- it: selects custom metrics endpoint if provided
set:
licenseKey: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaFFFFNRAL
metricsEndpoint: custom-metric-endpoint
enableWindows: true
asserts:
# Linux
- contains:
path: spec.template.spec.containers[0].env
content:
name: METRICS_HOST
value: "custom-metric-endpoint"
template: templates/daemonset.yaml
# Windows
- contains:
path: spec.template.spec.containers[0].env
content:
name: METRICS_HOST
value: "custom-metric-endpoint"
template: templates/daemonset-windows.yaml

- it: selects default endpoints when no conditions match
set:
licenseKey: default
enableWindows: true
asserts:
# Linux
- contains:
path: spec.template.spec.containers[0].env
content:
name: ENDPOINT
value: "https://log-api.newrelic.com/log/v1"
template: templates/daemonset.yaml
- contains:
path: spec.template.spec.containers[0].env
content:
name: METRICS_HOST
value: "metric-api.newrelic.com"
template: templates/daemonset.yaml
# Windows
- contains:
path: spec.template.spec.containers[0].env
content:
name: ENDPOINT
value: "https://log-api.newrelic.com/log/v1"
template: templates/daemonset-windows.yaml
- contains:
path: spec.template.spec.containers[0].env
content:
name: METRICS_HOST
value: "metric-api.newrelic.com"
template: templates/daemonset-windows.yaml

- it: fails with invalid license key
set:
licenseKey: invalid
enableWindows: true
asserts:
# Linux
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ENDPOINT
template: templates/daemonset.yaml
- notContains:
path: spec.template.spec.containers[0].env
content:
name: METRICS_HOST
template: templates/daemonset.yaml
# Windows
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ENDPOINT
template: templates/daemonset-windows.yaml
- notContains:
path: spec.template.spec.containers[0].env
content:
name: METRICS_HOST
template: templates/daemonset-windows.yaml

- it: selects endpoints with mixed EU key and custom endpoint
set:
licenseKey: euaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaFFFFNRAL
metricsEndpoint: custom-metric-endpoint
enableWindows: true
asserts:
# Linux
- contains:
path: spec.template.spec.containers[0].env
content:
name: ENDPOINT
value: "https://log-api.eu.newrelic.com/log/v1"
template: templates/daemonset.yaml
- contains:
path: spec.template.spec.containers[0].env
content:
name: METRICS_HOST
value: "custom-metric-endpoint"
template: templates/daemonset.yaml
# Windows
- contains:
path: spec.template.spec.containers[0].env
content:
name: ENDPOINT
value: "https://log-api.eu.newrelic.com/log/v1"
template: templates/daemonset-windows.yaml
- contains:
path: spec.template.spec.containers[0].env
content:
name: METRICS_HOST
value: "custom-metric-endpoint"
template: templates/daemonset-windows.yaml
1 change: 1 addition & 0 deletions charts/newrelic-logging/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# whether your account is for the EU region or not.
#
# endpoint: https://log-api.newrelic.com/log/v1
# metricsEndpoint: metric-api.newrelic.com

fluentBit:
logLevel: "info"
Expand Down
6 changes: 3 additions & 3 deletions charts/nr-ebpf-agent/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common-library
repository: https://helm-charts.newrelic.com
version: 1.1.1
digest: sha256:3c9053021f3c22aa3cdfc6781d3498bcbedb0b973af9121b1722469744fb5162
generated: "2024-07-22T22:06:19.122775417Z"
version: 1.3.0
digest: sha256:2e1da613fd8a52706bde45af077779c5d69e9e1641bdf5c982eaf6d1ac67a443
generated: "2024-11-06T20:45:23.428463-08:00"
2 changes: 1 addition & 1 deletion charts/nr-ebpf-agent/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apiVersion: v1
kind: Secret
metadata:
name: nr-ebpf-agent-secrets
type: Opaque
data:
{{- if .Values.licenseKey}}
NR_LICENSE_KEY: {{ .Values.licenseKey | b64enc }}
Expand All @@ -14,4 +15,3 @@ data:
{{- else }}
NR_LICENSE_KEY: {{ required "secrets.licenseKey is required" .Values.licenseKey | b64enc | quote }}
{{ end }}
type: Opaque

0 comments on commit 703af52

Please sign in to comment.