From d1089a0eab6f5a0c3a451806b1f58287fe727d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rostislav=20St=C5=99=C3=ADbrn=C3=BD?= Date: Mon, 21 Apr 2025 13:37:24 +0200 Subject: [PATCH] [bitnami/fluent-bit] Added support for extraContainerPorts (#33083) --- bitnami/fluent-bit/CHANGELOG.md | 6 ++++- bitnami/fluent-bit/Chart.yaml | 2 +- bitnami/fluent-bit/README.md | 22 ++++++++++++++++++- bitnami/fluent-bit/templates/daemonset.yaml | 3 +++ .../fluent-bit/templates/networkpolicy.yaml | 6 +++++ bitnami/fluent-bit/values.yaml | 7 ++++++ 6 files changed, 43 insertions(+), 3 deletions(-) diff --git a/bitnami/fluent-bit/CHANGELOG.md b/bitnami/fluent-bit/CHANGELOG.md index b2ab55d935..d55ee9e5f7 100644 --- a/bitnami/fluent-bit/CHANGELOG.md +++ b/bitnami/fluent-bit/CHANGELOG.md @@ -1,8 +1,12 @@ # Changelog +## 3.1.0 (2025-04-21) + +* [bitnami/fluent-bit] Added support for extraContainerPorts ([#33083](https://github.com/bitnami/charts/pull/33083)) + ## 3.0.0 (2025-04-02) -* [bitnami/fluent-bit] Release 3.0.0 ([#32779](https://github.com/bitnami/charts/pull/32779)) +* [bitnami/fluent-bit] Release 3.0.0 (#32779) ([1c82162](https://github.com/bitnami/charts/commit/1c821623a0a03ad80ff88c64fe6bb54347a09772)), closes [#32779](https://github.com/bitnami/charts/issues/32779) ## 2.5.7 (2025-03-25) diff --git a/bitnami/fluent-bit/Chart.yaml b/bitnami/fluent-bit/Chart.yaml index 37e421d1b9..f968db304f 100644 --- a/bitnami/fluent-bit/Chart.yaml +++ b/bitnami/fluent-bit/Chart.yaml @@ -29,4 +29,4 @@ maintainers: name: fluent-bit sources: - https://github.com/bitnami/charts/tree/main/bitnami/fluent-bit -version: 3.0.0 +version: 3.1.0 diff --git a/bitnami/fluent-bit/README.md b/bitnami/fluent-bit/README.md index ae750cc392..c34c21b04c 100644 --- a/bitnami/fluent-bit/README.md +++ b/bitnami/fluent-bit/README.md @@ -75,6 +75,25 @@ It is strongly recommended to use immutable tags in a production environment. Th Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist. +### Configure extraPorts + +- Based on your fluent-bit configuration, edit the `extraContainerPorts` and `service.extraPorts` parameters. In the `extraContainerPorts` parameter, set the extra ports that the fluent-bit configuration uses, and in the `service.extraPorts` parameter, set the extra ports to be externally exposed. + + Example: + + ```yaml + service: + extraPorts: + - name: forward + port: 24224 # We use port 24224 for receiving logs over TCP + protocol: TCP + targetPort: forward + + extraContainerPorts: + - name: forward + containerPort: 24224 + ``` + ### Backup and restore To back up and restore Helm chart deployments on Kubernetes, you need to back up the persistent volumes from the source deployment and attach them to a new deployment using [Velero](https://velero.io/), a Kubernetes backup/restore tool. Find the instructions for using Velero in [this guide](https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-backup-restore-deployments-velero-index.html). @@ -220,6 +239,7 @@ The [Bitnami Fluent Bit](https://github.com/bitnami/containers/tree/main/bitnami | `resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` | | `extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for fluent-bit container | `[]` | | `containerPorts.http` | Port for HTTP port | `2020` | +| `extraContainerPorts` | Optionally specify extra list of additional ports for fluent-bit containers | `[]` | | `service.type` | Fluent Bit service type | `ClusterIP` | | `service.ports.http` | Port for HTTP port | `2020` | | `service.nodePorts.http` | Node port for HTTP port | `""` | @@ -383,4 +403,4 @@ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file +limitations under the License. diff --git a/bitnami/fluent-bit/templates/daemonset.yaml b/bitnami/fluent-bit/templates/daemonset.yaml index bc438a95a6..cf4eee1d22 100644 --- a/bitnami/fluent-bit/templates/daemonset.yaml +++ b/bitnami/fluent-bit/templates/daemonset.yaml @@ -92,6 +92,9 @@ spec: ports: - name: http containerPort: {{ .Values.containerPorts.http }} + {{- if .Values.extraContainerPorts }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraContainerPorts "context" $) | nindent 12 }} + {{- end }} env: {{- if .Values.extraEnvVars }} {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} diff --git a/bitnami/fluent-bit/templates/networkpolicy.yaml b/bitnami/fluent-bit/templates/networkpolicy.yaml index d11e602c1f..83e802b522 100644 --- a/bitnami/fluent-bit/templates/networkpolicy.yaml +++ b/bitnami/fluent-bit/templates/networkpolicy.yaml @@ -37,6 +37,9 @@ spec: # Allow connection to other aggregator pods - ports: - port: {{ .Values.containerPorts.http }} + {{- range .Values.extraContainerPorts }} + - port: {{ .containerPort }} + {{- end }} to: - podSelector: matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }} @@ -47,6 +50,9 @@ spec: ingress: - ports: - port: {{ .Values.containerPorts.http }} + {{- range .Values.extraContainerPorts }} + - port: {{ .containerPort }} + {{- end }} {{- if not .Values.networkPolicy.allowExternal }} from: - podSelector: diff --git a/bitnami/fluent-bit/values.yaml b/bitnami/fluent-bit/values.yaml index 71eacb4c82..83a74a77b4 100644 --- a/bitnami/fluent-bit/values.yaml +++ b/bitnami/fluent-bit/values.yaml @@ -260,6 +260,13 @@ containerPorts: ## @param containerPorts.http Port for HTTP port ## http: 2020 +## @param extraContainerPorts Optionally specify extra list of additional ports for fluent-bit containers +## e.g: +## extraContainerPorts: +## - name: forward +## containerPort: 24224 +## +extraContainerPorts: [] ## Fluent Bit service parameters ## service: