[bitnami/influxdb] feat: 🔒 Add automatic adaptation for Openshift restricted-v2 SCC (#24094)

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>
This commit is contained in:
Javier J. Salmerón-García
2024-03-06 10:08:46 +01:00
committed by GitHub
parent aeef6b7767
commit c21a5db68d
6 changed files with 27 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.16.1
digest: sha256:f808a6fdc9c374d158ad7ff2f2c53a6c409e41da778d768b232dd20f86ef8b47
generated: "2024-02-21T14:00:35.290092315Z"
version: 2.18.0
digest: sha256:f489ae7394a4eceb24fb702901483c67a5b4fff605f19d5e2545e3a6778e1280
generated: "2024-03-05T14:10:21.805317652+01:00"

View File

@@ -37,4 +37,4 @@ maintainers:
name: influxdb
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/influxdb
version: 5.17.1
version: 5.18.0

View File

@@ -57,11 +57,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 storage class for dynamic provisioning | `""` |
| Name | Description | Value |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `global.imageRegistry` | Global Docker image registry | `""` |
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` |
| `global.storageClass` | Global storage class for dynamic provisioning | `""` |
| `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

View File

@@ -28,7 +28,7 @@ spec:
{{- end }}
spec:
{{- if .Values.backup.cronjob.podSecurityContext.enabled }}
securityContext: {{- omit .Values.backup.cronjob.podSecurityContext "enabled" | toYaml | nindent 12 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.backup.cronjob.podSecurityContext "context" $) | nindent 12 }}
{{- end }}
restartPolicy: OnFailure
volumes:
@@ -94,7 +94,7 @@ spec:
mountPath: /tmp/backup.sh
subPath: backup.sh
{{- if .Values.backup.cronjob.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.backup.cronjob.containerSecurityContext "enabled" | toYaml | nindent 16 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.backup.cronjob.containerSecurityContext "context" $) | nindent 16 }}
{{- end }}
containers:
- name: influxdb-backup-dummy-container
@@ -107,7 +107,7 @@ spec:
- "/bin/true"
{{- end }}
{{- if .Values.backup.cronjob.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.backup.cronjob.containerSecurityContext "enabled" | toYaml | nindent 16 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.backup.cronjob.containerSecurityContext "context" $) | nindent 16 }}
{{- end }}
{{- if .Values.backup.uploadProviders.google.enabled }}
- name: gsutil-cp
@@ -131,7 +131,7 @@ spec:
- name: google-cloud-key
mountPath: /var/secrets/google/
{{- if .Values.backup.cronjob.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.backup.cronjob.containerSecurityContext "enabled" | toYaml | nindent 16 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.backup.cronjob.containerSecurityContext "context" $) | nindent 16 }}
{{- end }}
{{- end }}
{{- if .Values.backup.uploadProviders.azure.enabled }}
@@ -164,7 +164,7 @@ spec:
mountPath: /tmp/upload-azure.sh
subPath: upload-azure.sh
{{- if .Values.backup.cronjob.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.backup.cronjob.containerSecurityContext "enabled" | toYaml | nindent 16 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.backup.cronjob.containerSecurityContext "context" $) | nindent 16 }}
{{- end }}
{{- end }}
{{- if .Values.backup.uploadProviders.aws.enabled }}
@@ -224,7 +224,7 @@ spec:
mountPath: /tmp/upload-aws.sh
subPath: upload-aws.sh
{{- if .Values.backup.cronjob.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.backup.cronjob.containerSecurityContext "enabled" | toYaml | nindent 16 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.backup.cronjob.containerSecurityContext "context" $) | nindent 16 }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -56,7 +56,7 @@ spec:
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.influxdb.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.influxdb.podSecurityContext.enabled }}
securityContext: {{- omit .Values.influxdb.podSecurityContext "enabled" | toYaml | nindent 8 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.influxdb.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "influxdb.serviceAccountName" . }}
initContainers:
@@ -96,7 +96,7 @@ spec:
image: {{ include "influxdb.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.influxdb.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.influxdb.containerSecurityContext "enabled" | toYaml | nindent 12 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.influxdb.containerSecurityContext "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}

View File

@@ -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)