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

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:39 +01:00
committed by GitHub
parent 574caf8bc6
commit aeef6b7767
7 changed files with 27 additions and 17 deletions

View File

@@ -4,6 +4,6 @@ dependencies:
version: 14.2.4
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.16.1
digest: sha256:36448bacde33a274556f24b33d0ba889f1b6eaf27c05cbb9147ac829883ace91
generated: "2024-03-04T17:12:16.376016+01:00"
version: 2.18.0
digest: sha256:0ddbfaaaf1f677e914d2110af422c25d63f838bf1ae7205637e9b0583ac88aad
generated: "2024-03-05T14:17:10.371615526+01:00"

View File

@@ -37,4 +37,4 @@ maintainers:
name: jupyterhub
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/jupyterhub
version: 6.0.0
version: 6.1.0

View File

@@ -114,11 +114,12 @@ For more information, check the official [JupyterHub documentation](https://gith
### 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

View File

@@ -69,7 +69,7 @@ spec:
schedulerName: {{ .Values.hub.schedulerName }}
{{- end }}
{{- if .Values.hub.podSecurityContext.enabled }}
securityContext: {{- omit .Values.hub.podSecurityContext "enabled" | toYaml | nindent 8 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.hub.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.hub.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.hub.terminationGracePeriodSeconds }}
@@ -108,7 +108,7 @@ spec:
info "Connected to the PostgreSQL instance"
fi
{{- if .Values.hub.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.hub.containerSecurityContext "enabled" | toYaml | nindent 12 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.hub.containerSecurityContext "context" $) | nindent 12 }}
{{- end }}
env:
- name: POSTGRESQL_CLIENT_DATABASE_HOST
@@ -135,7 +135,7 @@ spec:
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.hub.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.hub.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.hub.containerSecurityContext "enabled" | toYaml | nindent 12 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.hub.containerSecurityContext "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}

View File

@@ -60,7 +60,7 @@ spec:
schedulerName: {{ .Values.imagePuller.schedulerName }}
{{- end }}
{{- if .Values.imagePuller.podSecurityContext.enabled }}
securityContext: {{- omit .Values.imagePuller.podSecurityContext "enabled" | toYaml | nindent 8 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.imagePuller.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.imagePuller.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.imagePuller.terminationGracePeriodSeconds }}
@@ -80,7 +80,7 @@ spec:
- -c
- echo "Pulling complete"
{{- if $.Values.imagePuller.containerSecurityContext.enabled }}
securityContext: {{- omit $.Values.imagePuller.containerSecurityContext "enabled" | toYaml | nindent 12 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" $.Values.imagePuller.containerSecurityContext "context" $) | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.imagePuller.initContainers }}
@@ -94,7 +94,7 @@ spec:
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.imagePuller.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.imagePuller.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.imagePuller.containerSecurityContext "enabled" | toYaml | nindent 12 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.imagePuller.containerSecurityContext "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}

View File

@@ -65,7 +65,7 @@ spec:
schedulerName: {{ .Values.proxy.schedulerName }}
{{- end }}
{{- if .Values.proxy.podSecurityContext.enabled }}
securityContext: {{- omit .Values.proxy.podSecurityContext "enabled" | toYaml | nindent 8 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.proxy.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.proxy.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.proxy.terminationGracePeriodSeconds }}
@@ -81,7 +81,7 @@ spec:
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.proxy.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.proxy.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.proxy.containerSecurityContext "enabled" | toYaml | nindent 12 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.proxy.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
##