mirror of
https://gitea.com/gitea/helm-chart.git
synced 2024-06-30 21:40:35 +02:00
gitea-1.14.x-updates (#148)
This PR includes the changes from: - https://gitea.com/gitea/helm-chart/pulls/129 - https://gitea.com/gitea/helm-chart/pulls/140 In addition it adds the possibility to include secrets via environment variables as mentioned in #60 Co-authored-by: Hans Kristian Flaatten <hans.flaatten@evry.com> Co-authored-by: flavio.prado <flavio.prado@noreply.gitea.io> Co-authored-by: Lucas Hahn <lucas.hahn@novum-rgi.de> Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/148 Reviewed-by: techknowlogick <techknowlogick@gitea.io> Reviewed-by: Andrew Thornton <art27@cantab.net> Co-authored-by: luhahn <luhahn@noreply.gitea.io> Co-committed-by: luhahn <luhahn@noreply.gitea.io>
This commit is contained in:
parent
2b01e6ece6
commit
b88bbd6d4d
|
@ -3,7 +3,7 @@ name: gitea
|
||||||
description: Gitea Helm chart for Kubernetes
|
description: Gitea Helm chart for Kubernetes
|
||||||
type: application
|
type: application
|
||||||
version: 0.0.0
|
version: 0.0.0
|
||||||
appVersion: 1.13.7
|
appVersion: 1.14.1
|
||||||
icon: https://docs.gitea.io/images/gitea.png
|
icon: https://docs.gitea.io/images/gitea.png
|
||||||
|
|
||||||
keywords:
|
keywords:
|
||||||
|
|
10
README.md
10
README.md
|
@ -32,6 +32,13 @@ Dependencies:
|
||||||
* Helm 3.0+
|
* Helm 3.0+
|
||||||
* PV provisioner for persistent data support
|
* PV provisioner for persistent data support
|
||||||
|
|
||||||
|
## Gitea Version 1.14.X repository ROOT
|
||||||
|
|
||||||
|
Previously the ROOT folder for the gitea repositories was located at /data/git/gitea-repositories
|
||||||
|
1.14 changed this to /data/gitea-repositories.
|
||||||
|
|
||||||
|
This chart will set the gitea.config.repository.ROOT value default to /data/git/gitea-repositories
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Gitea Configuration
|
### Gitea Configuration
|
||||||
|
@ -375,8 +382,9 @@ Annotations can be added to the Gitea pod.
|
||||||
| Parameter | Description | Default |
|
| Parameter | Description | Default |
|
||||||
|---------------------|-----------------------------------|------------------------------|
|
|---------------------|-----------------------------------|------------------------------|
|
||||||
|image.repository| Image to start for this pod | gitea/gitea |
|
|image.repository| Image to start for this pod | gitea/gitea |
|
||||||
|image.tag| [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated) | 1.13.7 |
|
|image.tag| [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated) | 1.14.1 |
|
||||||
|image.pullPolicy| Image pull policy | Always |
|
|image.pullPolicy| Image pull policy | Always |
|
||||||
|
|image.rootless | Wether or not to pull the rootless version of gitea, only works on gitea 1.14.x or higher | false |
|
||||||
|
|
||||||
### Persistence
|
### Persistence
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,16 @@ Create chart name and version as used by the chart label.
|
||||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create image name and tag used by the deployment.
|
||||||
|
*/}}
|
||||||
|
{{- define "gitea.image" -}}
|
||||||
|
{{- $name := .Values.image.repository -}}
|
||||||
|
{{- $tag := ternary .Values.image.version .Values.image.tag (hasKey .Values.image "version") -}}
|
||||||
|
{{- $rootless := ternary "-rootless" "" (.Values.image.rootless) -}}
|
||||||
|
{{- printf "%s:%s%s" $name $tag $rootless -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Common labels
|
Common labels
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
@ -27,6 +27,15 @@ stringData:
|
||||||
{{- $_ := set .Values.gitea.config "security" dict -}}
|
{{- $_ := set .Values.gitea.config "security" dict -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not .Values.gitea.config.repository -}}
|
||||||
|
{{- $_ := set .Values.gitea.config "repository" dict -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* repository default settings */ -}}
|
||||||
|
{{- if not .Values.gitea.config.repository.ROOT -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.repository "ROOT" "/data/git/gitea-repositories" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{- /* security default settings */ -}}
|
{{- /* security default settings */ -}}
|
||||||
{{- if not .Values.gitea.config.security.INSTALL_LOCK -}}
|
{{- if not .Values.gitea.config.security.INSTALL_LOCK -}}
|
||||||
{{- $_ := set .Values.gitea.config.security "INSTALL_LOCK" "true" -}}
|
{{- $_ := set .Values.gitea.config.security "INSTALL_LOCK" "true" -}}
|
||||||
|
@ -64,7 +73,16 @@ stringData:
|
||||||
{{- $_ := set .Values.gitea.config.server "SSH_PORT" .Values.service.ssh.port -}}
|
{{- $_ := set .Values.gitea.config.server "SSH_PORT" .Values.service.ssh.port -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if not (hasKey .Values.gitea.config.server "SSH_LISTEN_PORT") -}}
|
{{- if not (hasKey .Values.gitea.config.server "SSH_LISTEN_PORT") -}}
|
||||||
|
{{- if not .Values.image.rootless -}}
|
||||||
{{- $_ := set .Values.gitea.config.server "SSH_LISTEN_PORT" .Values.gitea.config.server.SSH_PORT -}}
|
{{- $_ := set .Values.gitea.config.server "SSH_LISTEN_PORT" .Values.gitea.config.server.SSH_PORT -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.server "SSH_LISTEN_PORT" "2222" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (hasKey .Values.gitea.config.server "START_SSH_SERVER") -}}
|
||||||
|
{{- if .Values.image.rootless -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.server "START_SSH_SERVER" "true" -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if not (hasKey .Values.gitea.config.server "APP_DATA_PATH") -}}
|
{{- if not (hasKey .Values.gitea.config.server "APP_DATA_PATH") -}}
|
||||||
{{- $_ := set .Values.gitea.config.server "APP_DATA_PATH" "/data" -}}
|
{{- $_ := set .Values.gitea.config.server "APP_DATA_PATH" "/data" -}}
|
||||||
|
|
|
@ -20,18 +20,27 @@ stringData:
|
||||||
mkdir -p /data/git/.ssh
|
mkdir -p /data/git/.ssh
|
||||||
chmod -R 700 /data/git/.ssh
|
chmod -R 700 /data/git/.ssh
|
||||||
mkdir -p /data/gitea/conf
|
mkdir -p /data/gitea/conf
|
||||||
|
|
||||||
|
# Copy config file to writable volume
|
||||||
cp /etc/gitea/conf/app.ini /data/gitea/conf/app.ini
|
cp /etc/gitea/conf/app.ini /data/gitea/conf/app.ini
|
||||||
chmod a+rwx /data/gitea/conf/app.ini
|
chmod a+rwx /data/gitea/conf/app.ini
|
||||||
{{- if include "db.servicename" . }}
|
{{- if include "db.servicename" . }}
|
||||||
|
# Wait for database to become avialble
|
||||||
nc -v -w2 -z {{ include "db.servicename" . }} {{ include "db.port" . }} && \
|
nc -v -w2 -z {{ include "db.servicename" . }} {{ include "db.port" . }} && \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if not .Values.image.rootless }}
|
||||||
su git -c ' \
|
su git -c ' \
|
||||||
|
{{- end }}
|
||||||
set -x; \
|
set -x; \
|
||||||
gitea migrate; \
|
gitea migrate; \
|
||||||
{{- if and .Values.gitea.admin.username .Values.gitea.admin.password }}
|
{{- if and .Values.gitea.admin.username .Values.gitea.admin.password }}
|
||||||
gitea admin create-user --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }} --email {{ .Values.gitea.admin.email }} --admin --must-change-password=false \
|
gitea admin create-user --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }} --email {{ .Values.gitea.admin.email }} --admin --must-change-password=false \
|
||||||
|| \
|
|| \
|
||||||
gitea admin change-password --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }}; \
|
gitea admin change-password --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }} \
|
||||||
|
|| \
|
||||||
|
gitea admin user create --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }} --email {{ .Values.gitea.admin.email }} --admin --must-change-password=false \
|
||||||
|
|| \
|
||||||
|
gitea admin user change-password --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }}; \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.gitea.ldap.enabled }}
|
{{- if .Values.gitea.ldap.enabled }}
|
||||||
gitea admin auth add-ldap \
|
gitea admin auth add-ldap \
|
||||||
|
@ -53,4 +62,6 @@ stringData:
|
||||||
{{- include "gitea.oauth_settings" . | nindent 6 }} \
|
{{- include "gitea.oauth_settings" . | nindent 6 }} \
|
||||||
) \
|
) \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if not .Values.image.rootless }}
|
||||||
'
|
'
|
||||||
|
{{- end }}
|
||||||
|
|
|
@ -36,12 +36,17 @@ spec:
|
||||||
fsGroup: 1000
|
fsGroup: 1000
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: init
|
- name: init
|
||||||
image: "{{ .Values.image.repository }}:{{ ternary .Values.image.version .Values.image.tag (hasKey .Values.image "version") }}"
|
image: "{{ include "gitea.image" . }}"
|
||||||
command: ["/usr/sbin/init_gitea.sh"]
|
command: ["/usr/sbin/init_gitea.sh"]
|
||||||
env:
|
env:
|
||||||
{{- range .Values.statefulset.env }}
|
- name: GITEA_APP_INI
|
||||||
- name: {{ .name | quote | nospace }}
|
value: /data/gitea/conf/app.ini
|
||||||
value: {{ .value | quote }}
|
- name: GITEA_CUSTOM
|
||||||
|
value: /data/gitea
|
||||||
|
- name: GITEA_WORK_DIR
|
||||||
|
value: /data
|
||||||
|
{{- if .Values.statefulset.env }}
|
||||||
|
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: init
|
- name: init
|
||||||
|
@ -56,7 +61,7 @@ spec:
|
||||||
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
|
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ .Values.image.repository }}:{{ ternary .Values.image.version .Values.image.tag (hasKey .Values.image "version") }}"
|
image: "{{ include "gitea.image" . }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
# SSH Port values have to be set here as well for openssh configuration
|
# SSH Port values have to be set here as well for openssh configuration
|
||||||
|
@ -64,9 +69,16 @@ spec:
|
||||||
value: {{ .Values.gitea.config.server.SSH_LISTEN_PORT | quote }}
|
value: {{ .Values.gitea.config.server.SSH_LISTEN_PORT | quote }}
|
||||||
- name: SSH_PORT
|
- name: SSH_PORT
|
||||||
value: {{ .Values.gitea.config.server.SSH_PORT | quote }}
|
value: {{ .Values.gitea.config.server.SSH_PORT | quote }}
|
||||||
{{- range .Values.statefulset.env }}
|
- name: GITEA_APP_INI
|
||||||
- name: {{ .name | quote | nospace }}
|
value: /data/gitea/conf/app.ini
|
||||||
value: {{ .value | quote }}
|
- name: GITEA_CUSTOM
|
||||||
|
value: /data/gitea
|
||||||
|
- name: GITEA_WORK_DIR
|
||||||
|
value: /data
|
||||||
|
- name: GITEA_TEMP
|
||||||
|
value: /tmp/gitea
|
||||||
|
{{- if .Values.statefulset.env }}
|
||||||
|
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
- name: ssh
|
- name: ssh
|
||||||
|
@ -121,6 +133,8 @@ spec:
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
- name: temp
|
||||||
|
mountPath: /tmp/gitea
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
{{- if .Values.extraVolumeMounts }}
|
{{- if .Values.extraVolumeMounts }}
|
||||||
|
@ -149,6 +163,8 @@ spec:
|
||||||
{{- if .Values.extraVolumes }}
|
{{- if .Values.extraVolumes }}
|
||||||
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
- name: temp
|
||||||
|
emptyDir: {}
|
||||||
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
||||||
- name: data
|
- name: data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
|
|
12
values.yaml
12
values.yaml
|
@ -8,12 +8,22 @@ clusterDomain: cluster.local
|
||||||
|
|
||||||
image:
|
image:
|
||||||
repository: gitea/gitea
|
repository: gitea/gitea
|
||||||
tag: 1.13.7
|
tag: 1.14.1
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
rootless: false # only possible when running 1.14 or later
|
||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
|
|
||||||
securityContext: {}
|
securityContext: {}
|
||||||
|
# allowPrivilegeEscalation: false
|
||||||
|
# capabilities:
|
||||||
|
# drop:
|
||||||
|
# - ALL
|
||||||
|
# privileged: false
|
||||||
|
# readOnlyRootFilesystem: true
|
||||||
|
# runAsGroup: 1000
|
||||||
|
# runAsNonRoot: true
|
||||||
|
# runAsUser: 1000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
http:
|
http:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user