add global values support (#322)
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/322 Reviewed-by: luhahn <luhahn@noreply.gitea.io> Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io> Co-authored-by: cnfatal <cnfatal@noreply.gitea.io> Co-committed-by: cnfatal <cnfatal@noreply.gitea.io>
This commit is contained in:
parent
e59fbc4008
commit
9cb822f41c
@ -35,10 +35,40 @@ Create chart name and version as used by the chart label.
|
|||||||
Create image name and tag used by the deployment.
|
Create image name and tag used by the deployment.
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "gitea.image" -}}
|
{{- define "gitea.image" -}}
|
||||||
|
{{- $registry := .Values.global.imageRegistry | default .Values.image.registry -}}
|
||||||
{{- $name := .Values.image.repository -}}
|
{{- $name := .Values.image.repository -}}
|
||||||
{{- $tag := .Values.image.tag | default .Chart.AppVersion -}}
|
{{- $tag := .Values.image.tag | default .Chart.AppVersion -}}
|
||||||
{{- $rootless := ternary "-rootless" "" (.Values.image.rootless) -}}
|
{{- $rootless := ternary "-rootless" "" (.Values.image.rootless) -}}
|
||||||
{{- printf "%s:%s%s" $name $tag $rootless -}}
|
{{- if $registry -}}
|
||||||
|
{{- printf "%s/%s:%s%s" $registry $name $tag $rootless -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s:%s%s" $name $tag $rootless -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Docker Image Registry Secret Names evaluating values as templates
|
||||||
|
*/}}
|
||||||
|
{{- define "gitea.images.pullSecrets" -}}
|
||||||
|
{{- $pullSecrets := .Values.imagePullSecrets -}}
|
||||||
|
{{- range .Values.global.imagePullSecrets -}}
|
||||||
|
{{- $pullSecrets = append $pullSecrets (dict "name" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if (not (empty $pullSecrets)) }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{ toYaml $pullSecrets }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Storage Class
|
||||||
|
*/}}
|
||||||
|
{{- define "gitea.persistence.storageClass" -}}
|
||||||
|
{{- $storageClass := .Values.global.storageClass | default .Values.persistence.storageClass }}
|
||||||
|
{{- if $storageClass }}
|
||||||
|
storageClassName: {{ $storageClass | quote }}
|
||||||
|
{{- end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
|
@ -39,10 +39,7 @@ spec:
|
|||||||
{{- if .Values.schedulerName }}
|
{{- if .Values.schedulerName }}
|
||||||
schedulerName: "{{ .Values.schedulerName }}"
|
schedulerName: "{{ .Values.schedulerName }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.imagePullSecrets }}
|
{{- include "gitea.images.pullSecrets" . | nindent 6 }}
|
||||||
imagePullSecrets:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||||
initContainers:
|
initContainers:
|
||||||
@ -342,9 +339,7 @@ spec:
|
|||||||
{{- range .Values.persistence.accessModes }}
|
{{- range .Values.persistence.accessModes }}
|
||||||
- {{ . | quote }}
|
- {{ . | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.persistence.storageClass }}
|
{{- include "gitea.persistence.storageClass" . | indent 8 }}
|
||||||
storageClassName: {{ .Values.persistence.storageClass | quote }}
|
|
||||||
{{- end }}
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: {{ .Values.persistence.size | quote }}
|
storage: {{ .Values.persistence.size | quote }}
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
# Default values for gitea.
|
# Default values for gitea.
|
||||||
# This is a YAML-formatted file.
|
# This is a YAML-formatted file.
|
||||||
# Declare variables to be passed into your templates.
|
# Declare variables to be passed into your templates.
|
||||||
|
global:
|
||||||
|
imageRegistry: ""
|
||||||
|
## E.g.
|
||||||
|
## imagePullSecrets:
|
||||||
|
## - myRegistryKeySecretName
|
||||||
|
##
|
||||||
|
imagePullSecrets: []
|
||||||
|
storageClass: ""
|
||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user