Split "extraVolumeMounts" into init and container mounts (#337)
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/337 Reviewed-by: luhahn <luhahn@noreply.gitea.io> Reviewed-by: lafriks <lafriks@noreply.gitea.io> Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.io> Co-committed-by: justusbunsi <justusbunsi@noreply.gitea.io>
This commit is contained in:
parent
a4ab5f981f
commit
299d6db142
38
README.md
38
README.md
@ -646,18 +646,20 @@ gitea:
|
|||||||
|
|
||||||
### Persistence
|
### Persistence
|
||||||
|
|
||||||
| Name | Description | Value |
|
| Name | Description | Value |
|
||||||
| --------------------------- | ---------------------------------------------------------- | ------------------- |
|
| ---------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------- |
|
||||||
| `persistence.enabled` | Enable persistent storage | `true` |
|
| `persistence.enabled` | Enable persistent storage | `true` |
|
||||||
| `persistence.existingClaim` | Use an existing claim to store repository information | `nil` |
|
| `persistence.existingClaim` | Use an existing claim to store repository information | `nil` |
|
||||||
| `persistence.size` | Size for persistence to store repo information | `10Gi` |
|
| `persistence.size` | Size for persistence to store repo information | `10Gi` |
|
||||||
| `persistence.accessModes` | AccessMode for persistence | `["ReadWriteOnce"]` |
|
| `persistence.accessModes` | AccessMode for persistence | `["ReadWriteOnce"]` |
|
||||||
| `persistence.labels` | Labels for the persistence volume claim to be created | `{}` |
|
| `persistence.labels` | Labels for the persistence volume claim to be created | `{}` |
|
||||||
| `persistence.annotations` | Annotations for the persistence volume claim to be created | `{}` |
|
| `persistence.annotations` | Annotations for the persistence volume claim to be created | `{}` |
|
||||||
| `persistence.storageClass` | Name of the storage class to use | `nil` |
|
| `persistence.storageClass` | Name of the storage class to use | `nil` |
|
||||||
| `persistence.subPath` | Subdirectory of the volume to mount at | `nil` |
|
| `persistence.subPath` | Subdirectory of the volume to mount at | `nil` |
|
||||||
| `extraVolumes` | Additional volumes to mount to the Gitea statefulset | `nil` |
|
| `extraVolumes` | Additional volumes to mount to the Gitea statefulset | `[]` |
|
||||||
| `extraVolumeMounts` | Additional volume mounts for the Gitea containers | `nil` |
|
| `extraContainerVolumeMounts` | Mounts that are only mapped into the Gitea runtime/main container, to e.g. override custom templates. | `[]` |
|
||||||
|
| `extraInitVolumeMounts` | Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration. | `[]` |
|
||||||
|
| `extraVolumeMounts` | **DEPRECATED** Additional volume mounts for init containers and the Gitea main container | `[]` |
|
||||||
|
|
||||||
### Init
|
### Init
|
||||||
|
|
||||||
@ -786,6 +788,18 @@ Please read them carefully to upgrade successfully.
|
|||||||
|
|
||||||
### To 6.0.0
|
### To 6.0.0
|
||||||
|
|
||||||
|
#### Different volume mounts for init-containers and runtime container
|
||||||
|
|
||||||
|
**The `extraVolumeMounts` is deprecated** in favor of `extraInitVolumeMounts` and
|
||||||
|
`extraContainerVolumeMounts`. You can now have different mounts for the initialization
|
||||||
|
phase and Gitea runtime. The deprecated `extraVolumeMounts` will still be available
|
||||||
|
for the time being and is mounted into every container. If you want to switch to
|
||||||
|
the new settings and want to mount specific volumes into all containers, you have
|
||||||
|
to configure their mount points within both new settings.
|
||||||
|
|
||||||
|
**Combining values from the deprecated setting with values from the new settings
|
||||||
|
is not possible.**
|
||||||
|
|
||||||
#### New `enabled` flag for `startupProbe`
|
#### New `enabled` flag for `startupProbe`
|
||||||
|
|
||||||
Prior to this version the `startupProbe` was just a commented sample within the
|
Prior to this version the `startupProbe` was just a commented sample within the
|
||||||
|
@ -313,3 +313,21 @@ https
|
|||||||
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mariadb.auth.password -}}
|
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mariadb.auth.password -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "gitea.init-additional-mounts" -}}
|
||||||
|
{{- /* Honor the deprecated extraVolumeMounts variable when defined */ -}}
|
||||||
|
{{- if gt (len .Values.extraInitVolumeMounts) 0 -}}
|
||||||
|
{{- toYaml .Values.extraInitVolumeMounts -}}
|
||||||
|
{{- else if gt (len .Values.extraVolumeMounts) 0 -}}
|
||||||
|
{{- toYaml .Values.extraVolumeMounts -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "gitea.container-additional-mounts" -}}
|
||||||
|
{{- /* Honor the deprecated extraVolumeMounts variable when defined */ -}}
|
||||||
|
{{- if gt (len .Values.extraContainerVolumeMounts) 0 -}}
|
||||||
|
{{- toYaml .Values.extraContainerVolumeMounts -}}
|
||||||
|
{{- else if gt (len .Values.extraVolumeMounts) 0 -}}
|
||||||
|
{{- toYaml .Values.extraVolumeMounts -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
@ -69,9 +69,7 @@ spec:
|
|||||||
{{- if .Values.persistence.subPath }}
|
{{- if .Values.persistence.subPath }}
|
||||||
subPath: {{ .Values.persistence.subPath }}
|
subPath: {{ .Values.persistence.subPath }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.extraVolumeMounts }}
|
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
||||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
||||||
- name: init-app-ini
|
- name: init-app-ini
|
||||||
@ -109,9 +107,7 @@ spec:
|
|||||||
- name: additional-config-sources-{{ $idx }}
|
- name: additional-config-sources-{{ $idx }}
|
||||||
mountPath: "/env-to-ini-mounts/additionals/{{ $idx }}/"
|
mountPath: "/env-to-ini-mounts/additionals/{{ $idx }}/"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.extraVolumeMounts }}
|
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
||||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
||||||
- name: configure-gitea
|
- name: configure-gitea
|
||||||
@ -201,9 +197,7 @@ spec:
|
|||||||
{{- if .Values.persistence.subPath }}
|
{{- if .Values.persistence.subPath }}
|
||||||
subPath: {{ .Values.persistence.subPath }}
|
subPath: {{ .Values.persistence.subPath }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.extraVolumeMounts }}
|
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
|
||||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
|
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
@ -273,9 +267,7 @@ spec:
|
|||||||
{{- if .Values.persistence.subPath }}
|
{{- if .Values.persistence.subPath }}
|
||||||
subPath: {{ .Values.persistence.subPath }}
|
subPath: {{ .Values.persistence.subPath }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.extraVolumeMounts }}
|
{{- include "gitea.container-additional-mounts" . | nindent 12 }}
|
||||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
@ -301,7 +293,7 @@ spec:
|
|||||||
secret:
|
secret:
|
||||||
secretName: {{ include "gitea.fullname" . }}
|
secretName: {{ include "gitea.fullname" . }}
|
||||||
defaultMode: 110
|
defaultMode: 110
|
||||||
{{- if .Values.extraVolumes }}
|
{{- if gt (len .Values.extraVolumes) 0 }}
|
||||||
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- name: inline-config-sources
|
- name: inline-config-sources
|
||||||
|
18
values.yaml
18
values.yaml
@ -217,17 +217,23 @@ persistence:
|
|||||||
subPath:
|
subPath:
|
||||||
|
|
||||||
## @param extraVolumes Additional volumes to mount to the Gitea statefulset
|
## @param extraVolumes Additional volumes to mount to the Gitea statefulset
|
||||||
extraVolumes:
|
extraVolumes: []
|
||||||
# - name: postgres-ssl-vol
|
# - name: postgres-ssl-vol
|
||||||
# secret:
|
# secret:
|
||||||
# secretName: gitea-postgres-ssl
|
# secretName: gitea-postgres-ssl
|
||||||
|
|
||||||
|
## @param extraContainerVolumeMounts Mounts that are only mapped into the Gitea runtime/main container, to e.g. override custom templates.
|
||||||
|
extraContainerVolumeMounts: []
|
||||||
|
|
||||||
# additional volumes to mount, both to the init container and to the main
|
## @param extraInitVolumeMounts Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration.
|
||||||
# container. As an example, can be used to mount a client cert when connecting
|
extraInitVolumeMounts: []
|
||||||
# to an external Postgres server.
|
|
||||||
## @param extraVolumeMounts Additional volume mounts for the Gitea containers
|
## @depracated The extraVolumeMounts variable has been split two:
|
||||||
extraVolumeMounts:
|
## - extraContainerVolumeMounts
|
||||||
|
## - extraInitVolumeMounts
|
||||||
|
## As an example, can be used to mount a client cert when connecting to an external Postgres server.
|
||||||
|
## @param extraVolumeMounts **DEPRECATED** Additional volume mounts for init containers and the Gitea main container
|
||||||
|
extraVolumeMounts: []
|
||||||
# - name: postgres-ssl-vol
|
# - name: postgres-ssl-vol
|
||||||
# readOnly: true
|
# readOnly: true
|
||||||
# mountPath: "/pg-ssl"
|
# mountPath: "/pg-ssl"
|
||||||
|
Loading…
Reference in New Issue
Block a user