Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[newrelic-logging]: NR-300427: Add support to have hostNetwork proper…
…ty for fluentbit logging pods. (#1462) #### Is this a new chart No. #### What this PR does / why we need it: This PR exposes hostNetwork as a configurable option to provide flexibility while maintaining security by default. This is needed for some inputs like UDP Log Plugin which will require this setting to be true as they need to bind to the host network. **Note**:`hostNetwork` was removed earlier through the PR: #1207 as it was defaulting to true for linux and we did not see a need to keep having it. * This addresses NR-300427. #### Which issue this PR fixes *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)* #### Special notes for your reviewer: ##### Testing done. 1. Unit test: `helm unittest charts/newrelic-logging` 2. Dry Run with default values.yaml produces a yaml file without `hostNetwork`. Dry run with a test yaml file with `hostNetwork` true produces yaml with `hostNetwork = true` . ``` helm upgrade --install newrelic-bundle --set licenseKey=NRAK-4ELM412W24DKNJMOT1N67IDWMW7 /Users/mjha/newrelicpublic/helm-charts/charts/newrelic-logging -n newrelic --values /Users/mjha/newrelicpublic/helm-charts/charts/newrelic-logging/ci/test-hostnetwork-true.yaml –dry-run``` 3. Installing with `hostNetwork = true` result in POD having same IP whereas with `hostNetwork = false` or absent POD have a different IP Adddress. POD IP with `hostNetwork = true`: ``` mjha@C44F6H7NR2 helm-charts % kubectl describe pods newrelic-bundle-newrelic-logging-5gjs5 -n newrelic Name: newrelic-bundle-newrelic-logging-5gjs5 Namespace: newrelic Priority: 0 Service Account: newrelic-bundle-newrelic-logging Node: kind-control-plane/172.18.0.2 Start Time: Mon, 12 Aug 2024 17:27:36 +0530 Labels: app=newrelic-logging app.kubernetes.io/name=newrelic-logging controller-revision-hash=5cc94d4979 kubernetes.io/os=linux pod-template-generation=1 release=newrelic-bundle Annotations: checksum/fluent-bit-config: ebc9eabd67417276ed03d3c82d6bb7278ea319b27661d10f1a6092b6d04bd052 Status: Running IP: 172.18.0.2 IPs: IP: 172.18.0.2 ``` POD IP with `hostNetwork = false`: ``` mjha@C44F6H7NR2 helm-charts % kubectl describe pods newrelic-bundle-newrelic-logging-gl8gr -n newrelic Name: newrelic-bundle-newrelic-logging-gl8gr Namespace: newrelic Priority: 0 Service Account: newrelic-bundle-newrelic-logging Node: kind-control-plane/172.18.0.2 Start Time: Mon, 12 Aug 2024 17:57:53 +0530 Labels: app=newrelic-logging app.kubernetes.io/name=newrelic-logging controller-revision-hash=7d8dfbb548 kubernetes.io/os=linux pod-template-generation=1 release=newrelic-bundle Annotations: checksum/fluent-bit-config: ebc9eabd67417276ed03d3c82d6bb7278ea319b27661d10f1a6092b6d04bd052 Status: Running IP: 10.244.0.5 IPs: IP: 10.244.0.5 ``` #### 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