Skip to content

[bitnami/nginx] Feature Request: Allow disabling of automatic initContainers in NGINX chart #32541

Closed as not planned
@vineetguptadev

Description

@vineetguptadev

Name and Version

bitnami/nginx 19.0.2

What is the problem this feature will solve?

Description:

Current Behavior

The NGINX chart automatically creates initContainers under certain conditions:

  1. When containerSecurityContext.readOnlyRootFilesystem is true, it creates a preserve-logs-symlinks initContainer that requires bash and performs filesystem operations
  2. The chart has no way to disable these automatically created initContainers

Issues

This causes problems when:

  1. Running in environments with strict OPA policies that don't allow readOnlyRootFilesystem
  2. Using custom container images that don't include bash and only sh
  3. Needing to completely disable the log preservation mechanism

Desired Behavior

Add a new configuration option like disableDefaultInitContainers: false (default) that when set to true would skip the automatically generated initContainers while still allowing custom ones via .Values.initContainers.

Suggested Implementation

Modify the conditional statements in deployment.yaml:

{{- if and (not .Values.disableDefaultInitContainers) (or .Values.containerSecurityContext.readOnlyRootFilesystem .Values.cloneStaticSiteFromGit.enabled .Values.initContainers) }}
initContainers:
{{- if and (not .Values.disableDefaultInitContainers) .Values.containerSecurityContext.readOnlyRootFilesystem }}
  - name: preserve-logs-symlinks
    ...
{{- end }}

### What is the feature you are proposing to solve the problem?

A configuration flag disableDefaultInitContainers: true|false (defaulting to false) that allows users to completely skip the automatically created initContainers in the NGINX chart, particularly the preserve-logs-symlinks initContainer that's generated when containerSecurityContext.readOnlyRootFilesystem is true. This would allow users with strict OPA policies or custom images without bash to still use the chart without having to fork it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions