diff --git a/charts/newrelic-logging/Chart.yaml b/charts/newrelic-logging/Chart.yaml index df24625d3..ab809e33c 100644 --- a/charts/newrelic-logging/Chart.yaml +++ b/charts/newrelic-logging/Chart.yaml @@ -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.22.3 +version: 1.22.4 appVersion: 2.0.0 home: https://github.com/newrelic/kubernetes-logging icon: https://newrelic.com/assets/newrelic/source/NewRelic-logo-square.svg diff --git a/charts/newrelic-logging/README.md b/charts/newrelic-logging/README.md index 2f7e4e853..1635b0d86 100644 --- a/charts/newrelic-logging/README.md +++ b/charts/newrelic-logging/README.md @@ -117,7 +117,7 @@ helm upgrade --install newrelic-bundle newrelic/nri-bundle \ See [values.yaml](values.yaml) for the default values | Parameter | Description | Default | -|--------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------| +| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- | | `global.cluster` - `cluster` | The cluster name for the Kubernetes cluster. | | | `global.licenseKey` - `licenseKey` | The [license key](https://docs.newrelic.com/docs/accounts/install-new-relic/account-setup/license-key) for your New Relic Account. This will be the preferred configuration option if both `licenseKey` and `customSecret*` values are specified. | | | `global.customSecretName` - `customSecretName` | Name of the Secret object where the license key is stored | | @@ -163,6 +163,7 @@ See [values.yaml](values.yaml) for the default values | `fluentBit.persistence.persistentVolume.extra.claim` | On "persistentVolume" [persistence mode](#Fluent-Bit-persistence-modes), allows to add extra properties to the PersistentVolumeClaim (if created). | | | `daemonSet.annotations` | The annotations to add to the `DaemonSet`. | | | `podAnnotations` | The annotations to add to the `DaemonSet` created `Pod`s. | | +| `hostNetwork` | Set the hostNetwork property for fluentbit pods. | | | `enableLinux` | Enable log collection from Linux containers. This is the default behavior. In case you are only interested of collecting logs from Windows containers, set this to `false`. | `true` | | `enableWindows` | Enable log collection from Windows containers. Please refer to the [Windows support](#windows-support) section for more details. | `false` | | `fluentBit.config.service` | Contains fluent-bit.conf Service config | | diff --git a/charts/newrelic-logging/templates/daemonset-windows.yaml b/charts/newrelic-logging/templates/daemonset-windows.yaml index a4a9e08fc..6a3145d13 100644 --- a/charts/newrelic-logging/templates/daemonset-windows.yaml +++ b/charts/newrelic-logging/templates/daemonset-windows.yaml @@ -47,6 +47,9 @@ spec: imagePullSecrets: {{- . | nindent 8 }} {{- end }} + {{- if $.Values.hostNetwork }} + hostNetwork: {{ $.Values.hostNetwork }} + {{- end }} {{- if $.Values.windows.initContainers }} initContainers: {{ toYaml $.Values.windows.initContainers | indent 8 }} diff --git a/charts/newrelic-logging/templates/daemonset.yaml b/charts/newrelic-logging/templates/daemonset.yaml index 1bc779a99..7dac9e07e 100644 --- a/charts/newrelic-logging/templates/daemonset.yaml +++ b/charts/newrelic-logging/templates/daemonset.yaml @@ -47,6 +47,9 @@ spec: securityContext: {{- . | nindent 8 }} {{- end }} + {{- if .Values.hostNetwork }} + hostNetwork: {{ .Values.hostNetwork }} + {{- end }} initContainers: {{- if and (.Values.fluentBit.persistence) (eq .Values.fluentBit.persistence.mode "persistentVolume") }} - name: init diff --git a/charts/newrelic-logging/tests/host_network_test.yaml b/charts/newrelic-logging/tests/host_network_test.yaml new file mode 100644 index 000000000..612d1d9a5 --- /dev/null +++ b/charts/newrelic-logging/tests/host_network_test.yaml @@ -0,0 +1,46 @@ +suite: test hostNetwork options in fluent-bit pods +templates: + - templates/configmap.yaml + - templates/daemonset.yaml + - templates/daemonset-windows.yaml +release: + name: my-release + namespace: my-namespace +tests: + - it: daemonsets does not contain hostNetwork block when not provided + set: + licenseKey: nr_license_key + enableWindows: true + asserts: + - notExists: + path: spec.template.spec.hostNetwork + template: templates/daemonset.yaml + - notExists: + path: spec.template.spec.hostNetwork + template: templates/daemonset-windows.yaml + - it: daemonsets does not contain hostNetwork block when provided as false + set: + licenseKey: nr_license_key + enableWindows: true + hostNetwork: false + asserts: + - notExists: + path: spec.template.spec.hostNetwork + template: templates/daemonset.yaml + - notExists: + path: spec.template.spec.hostNetwork + template: templates/daemonset-windows.yaml + - it: daemonsets does contain hostNetwork=true when provided as true + set: + licenseKey: nr_license_key + enableWindows: true + hostNetwork: true + asserts: + - equal: + path: spec.template.spec.hostNetwork + value: true + template: templates/daemonset.yaml + - equal: + path: spec.template.spec.hostNetwork + value: true + template: templates/daemonset-windows.yaml \ No newline at end of file diff --git a/charts/newrelic-logging/values.yaml b/charts/newrelic-logging/values.yaml index 991f9ee9c..c5d85b43f 100644 --- a/charts/newrelic-logging/values.yaml +++ b/charts/newrelic-logging/values.yaml @@ -327,6 +327,10 @@ daemonSet: # Annotations to add to the resulting Pods of the DaemonSet. podAnnotations: {} +# If host network should be enabled for fluentbit pods. +# There are some inputs like UDP which will require this setting to be true as they need to bind to the host network. +hostNetwork: + # When low data mode is enabled only minimal attributes are added to the logs. Kubernetes labels and # annotations are not included. The plugin.type, plugin.version and plugin.source attributes are minified # into the plugin.source attribute.