Skip to content

Commit

Permalink
[newrelic-logging] Update Docs: "fluentBit.k8sLoggingExclude" needs t…
Browse files Browse the repository at this point in the history
…o be 'true' and not 'On' (#1426)

<!--
Thank you for contributing to New Relic's Helm charts. Before you submit
this PR we'd like to
make sure you are aware of our technical requirements:

*
https://github.com/newrelic-experimental/helm-charts/blob/master/CONTRIBUTING.md#technical-requirements

For a quick overview across what we will look at reviewing your PR,
please read
our review guidelines:

*
https://github.com/newrelic-experimental/helm-charts/blob/master/REVIEW_GUIDELINES.md

Following our best practices right from the start will accelerate the
review process and
help get your PR merged quicker.

When updates to your PR are requested, please add new commits and do not
squash the
history. This will make it easier to identify new changes. The PR will
be squashed
anyways when it is merged. Thanks.

For fast feedback, please @-mention maintainers that are listed in the
Chart.yaml file.

Please make sure you test your changes before you push them. Once
pushed, a Github Action
will run across your changes and do some initial checks and linting.
These checks run
very quickly. Please check the results. We would like these checks to
pass before we
even continue reviewing your changes.
-->
#### Is this a new chart
No. It is an existing chart named newrelic-logging

#### What this PR does / why we need it:
Template is failing to generate valid YAML file if there are multiple
pod labels


#### Which issue this PR fixes
*(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)`
format, will close that issue when PR gets merged)*
  - fixes #1312

#### Special notes for your reviewer:
Tested scenarios with following values and observed results in compiled
yaml file:
fluentBit.k8sLoggingExclude: off -> false
fluentBit.k8sLoggingExclude: on -> true
fluentBit.k8sLoggingExclude: true -> true
fluentBit.k8sLoggingExclude: false -> false
Not having the attribute fluentBit.k8sLoggingExclude -> false

#### Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove
unrelated fields.]
- [x] Chart Version bumped
- [x] Variables are documented in the README.md
- [x] Title of the PR starts with chart name (e.g. `[mychartname]`)
  • Loading branch information
nr-rkallempudi authored Jul 17, 2024
1 parent cb8b13a commit 97477f2
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 9 deletions.
6 changes: 3 additions & 3 deletions charts/newrelic-logging/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: "2023-03-21T22:34:27.606266389Z"
version: 1.2.0
digest: sha256:fa87cb007564a39a72739a3e850a91d6b03c0fc27a1115deac042b3ef77b4142
generated: "2024-07-17T19:29:15.951407+05:30"
4 changes: 2 additions & 2 deletions 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.22.2
version: 1.22.3
appVersion: 2.0.0
home: https://github.com/newrelic/kubernetes-logging
icon: https://newrelic.com/assets/newrelic/source/NewRelic-logo-square.svg
Expand All @@ -15,5 +15,5 @@ keywords:
- newrelic
dependencies:
- name: common-library
version: 1.1.1
version: 1.2.0
repository: "https://helm-charts.newrelic.com"
2 changes: 1 addition & 1 deletion charts/newrelic-logging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ See [values.yaml](values.yaml) for the default values
| `fluentBit.linuxMountPath` | The path mounted on linux Fluent-Bit pods to read logs from. Defaults to /var because some engines write the logs to /var/log and others to /var/lib (symlinked to /var/log) so Fluent-Bit need access to both in those cases | `/var` |
| `fluentBit.db` | Node path used by Fluent Bit to store a database file to keep track of monitored files and offsets. | `/var/log/containers/*.log` |
| `fluentBit.k8sBufferSize` | Set the buffer size for HTTP client when reading responses from Kubernetes API server. A value of 0 results in no limit and the buffer will expand as needed. | `32k` |
| `fluentBit.k8sLoggingExclude` | Set to "On" to allow excluding pods by adding the annotation `fluentbit.io/exclude: "true"` to pods you wish to exclude. | `Off` |
| `fluentBit.k8sLoggingExclude` | Set to "true" to allow excluding pods by adding the annotation `fluentbit.io/exclude: "true"` to pods you wish to exclude. | `false` |
| `fluentBit.additionalEnvVariables` | Additional environmental variables for fluentbit pods | `[]]` |
| `fluentBit.persistence.mode` | The [persistence mode](#Fluent-Bit-persistence-modes) you want to use, options are "hostPath", "none" or "persistentVolume" (this last one available only for linux) |
| `fluentBit.persistence.persistentVolume.storageClass` | On "persistentVolume" [persistence mode](#Fluent-Bit-persistence-modes), indicates the storage class that will be used for create the PersistentVolume and PersistentVolumeClaim. | |
Expand Down
2 changes: 1 addition & 1 deletion charts/newrelic-logging/templates/daemonset-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ spec:
- name: K8S_BUFFER_SIZE
value: {{ $.Values.fluentBit.k8sBufferSize | quote }}
- name: K8S_LOGGING_EXCLUDE
value: {{ $.Values.fluentBit.k8sLoggingExclude | quote }}
value: {{ $.Values.fluentBit.k8sLoggingExclude | default "false" | quote }}
- name: LOW_DATA_MODE
value: {{ include "newrelic-logging.lowDataMode" $ | default "false" | quote }}
- name: RETRY_LIMIT
Expand Down
2 changes: 1 addition & 1 deletion charts/newrelic-logging/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ spec:
- name: K8S_BUFFER_SIZE
value: {{ .Values.fluentBit.k8sBufferSize | quote }}
- name: K8S_LOGGING_EXCLUDE
value: {{ .Values.fluentBit.k8sLoggingExclude | quote }}
value: {{ .Values.fluentBit.k8sLoggingExclude | default "false" | quote }}
- name: LOW_DATA_MODE
value: {{ include "newrelic-logging.lowDataMode" . | default "false" | quote }}
- name: RETRY_LIMIT
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
suite: test fluent-bit exclude logging
templates:
- templates/daemonset.yaml
- templates/configmap.yaml
- templates/persistentvolume.yaml
release:
name: my-release
namespace: my-namespace
tests:
- it: K8S_LOGGING_EXCLUDE set true
templates:
- templates/daemonset.yaml
set:
licenseKey: nr_license_key
fluentBit:
k8sLoggingExclude: true
asserts:
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="K8S_LOGGING_EXCLUDE")].value
value: "true"
template: templates/daemonset.yaml
- it: K8S_LOGGING_EXCLUDE set false
templates:
- templates/daemonset.yaml
set:
licenseKey: nr_license_key
fluentBit:
k8sLoggingExclude: false
asserts:
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="K8S_LOGGING_EXCLUDE")].value
value: "false"
template: templates/daemonset.yaml
- it: K8S_LOGGING_EXCLUDE set value xyz and expect it to be set
templates:
- templates/daemonset.yaml
set:
licenseKey: nr_license_key
fluentBit:
k8sLoggingExclude: xyz
asserts:
- equal:
path: spec.template.spec.containers[0].env[?(@.name=="K8S_LOGGING_EXCLUDE")].value
value: "xyz"
template: templates/daemonset.yaml
2 changes: 1 addition & 1 deletion charts/newrelic-logging/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fluentBit:
windowsDb: "C:\\var\\log\\flb_kube.db"
criEnabled: true
k8sBufferSize: "32k"
k8sLoggingExclude: "Off"
k8sLoggingExclude: "false"
retryLimit: 5
sendMetrics: false
extraEnv: []
Expand Down

0 comments on commit 97477f2

Please sign in to comment.