From aa916bf91f9029ad9214b8abac3d0befb4792aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20J=2E=20Salmer=C3=B3n-Garc=C3=ADa?= Date: Wed, 6 Mar 2024 10:09:18 +0100 Subject: [PATCH] [bitnami/fluentd] feat: :sparkles: :lock: Add automatic adaptation for Openshift restricted-v2 SCC (#24083) Signed-off-by: Javier Salmeron Garcia --- bitnami/fluentd/Chart.lock | 6 +++--- bitnami/fluentd/Chart.yaml | 2 +- bitnami/fluentd/README.md | 11 ++++++----- bitnami/fluentd/templates/aggregator-statefulset.yaml | 4 ++-- bitnami/fluentd/templates/forwarder-daemonset.yaml | 4 ++-- bitnami/fluentd/values.yaml | 9 +++++++++ 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/bitnami/fluentd/Chart.lock b/bitnami/fluentd/Chart.lock index c50aa7aba8..52b70e5c61 100644 --- a/bitnami/fluentd/Chart.lock +++ b/bitnami/fluentd/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: common repository: oci://registry-1.docker.io/bitnamicharts - version: 2.16.1 -digest: sha256:f808a6fdc9c374d158ad7ff2f2c53a6c409e41da778d768b232dd20f86ef8b47 -generated: "2024-02-21T12:25:54.237229873Z" + version: 2.18.0 +digest: sha256:f489ae7394a4eceb24fb702901483c67a5b4fff605f19d5e2545e3a6778e1280 +generated: "2024-03-05T13:50:51.505406843+01:00" diff --git a/bitnami/fluentd/Chart.yaml b/bitnami/fluentd/Chart.yaml index db535b3ab3..c464ef6420 100644 --- a/bitnami/fluentd/Chart.yaml +++ b/bitnami/fluentd/Chart.yaml @@ -30,4 +30,4 @@ maintainers: name: fluentd sources: - https://github.com/bitnami/charts/tree/main/bitnami/fluentd -version: 5.18.1 +version: 5.19.0 diff --git a/bitnami/fluentd/README.md b/bitnami/fluentd/README.md index 23bafa0475..4eb942d77a 100644 --- a/bitnami/fluentd/README.md +++ b/bitnami/fluentd/README.md @@ -58,11 +58,12 @@ The command removes all the Kubernetes components associated with the chart and ### Global parameters -| Name | Description | Value | -| ------------------------- | ----------------------------------------------- | ----- | -| `global.imageRegistry` | Global Docker image registry | `""` | -| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` | -| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` | +| Name | Description | Value | +| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | +| `global.imageRegistry` | Global Docker image registry | `""` | +| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` | +| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` | +| `global.compatibility.openshift.adaptSecurityContext` | Adapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation) | `disabled` | ### Common parameters diff --git a/bitnami/fluentd/templates/aggregator-statefulset.yaml b/bitnami/fluentd/templates/aggregator-statefulset.yaml index 55c2f55abd..8a0814fa7e 100644 --- a/bitnami/fluentd/templates/aggregator-statefulset.yaml +++ b/bitnami/fluentd/templates/aggregator-statefulset.yaml @@ -46,7 +46,7 @@ spec: {{- end }} serviceAccountName: {{ template "fluentd.aggregator.serviceAccountName" . }} {{- if .Values.aggregator.podSecurityContext.enabled }} - securityContext: {{- omit .Values.aggregator.podSecurityContext "enabled" | toYaml | nindent 8 }} + securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.aggregator.podSecurityContext "context" $) | nindent 8 }} {{- end }} {{- if .Values.aggregator.affinity }} affinity: {{- include "common.tplvalues.render" (dict "value" .Values.aggregator.affinity "context" $) | nindent 8 }} @@ -140,7 +140,7 @@ spec: image: {{ include "fluentd.aggregator.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} {{- if .Values.aggregator.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.aggregator.containerSecurityContext "enabled" | toYaml | nindent 12 }} + securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.aggregator.containerSecurityContext "context" $) | nindent 12 }} {{ end }} {{- if .Values.aggregator.lifecycleHooks }} lifecycle: {{- include "common.tplvalues.render" ( dict "value" .Values.aggregator.lifecycleHooks "context" $ ) | nindent 12 }} diff --git a/bitnami/fluentd/templates/forwarder-daemonset.yaml b/bitnami/fluentd/templates/forwarder-daemonset.yaml index 48e3519a3d..1da16c8429 100644 --- a/bitnami/fluentd/templates/forwarder-daemonset.yaml +++ b/bitnami/fluentd/templates/forwarder-daemonset.yaml @@ -62,7 +62,7 @@ spec: tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.forwarder.tolerations "context" $) | nindent 8 }} {{- end }} {{- if .Values.forwarder.podSecurityContext.enabled }} - securityContext: {{- omit .Values.forwarder.podSecurityContext "enabled" | toYaml | nindent 8 }} + securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.forwarder.podSecurityContext "context" $) | nindent 8 }} {{- end }} initContainers: {{- if .Values.forwarder.extraGems }} @@ -133,7 +133,7 @@ spec: image: {{ include "fluentd.forwarder.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.forwarder.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.forwarder.containerSecurityContext "enabled" | toYaml | nindent 12 }} + securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.forwarder.containerSecurityContext "context" $) | nindent 12 }} {{- end }} {{- if .Values.forwarder.lifecycleHooks }} lifecycle: {{- include "common.tplvalues.render" ( dict "value" .Values.forwarder.lifecycleHooks "context" $ ) | nindent 12 }} diff --git a/bitnami/fluentd/values.yaml b/bitnami/fluentd/values.yaml index 265c7def5c..6f623aa40f 100644 --- a/bitnami/fluentd/values.yaml +++ b/bitnami/fluentd/values.yaml @@ -18,6 +18,15 @@ global: ## imagePullSecrets: [] storageClass: "" + ## Compatibility adaptations for Kubernetes platforms + ## + compatibility: + ## Compatibility adaptations for Openshift + ## + openshift: + ## @param global.compatibility.openshift.adaptSecurityContext Adapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation) + ## + adaptSecurityContext: disabled ## @section Common parameters ## @param kubeVersion Force target Kubernetes version (using Helm capabilities if not set)