Compare commits
48 Commits
Author | SHA1 | Date | |
---|---|---|---|
4ef9a3ec35 | |||
ba0e8b18b5 | |||
9e7387f0f8 | |||
6342a4dabd | |||
7de326d931 | |||
767a073a0a | |||
b7dbb22025 | |||
9059229acb | |||
6a6eb35106 | |||
7a3515c2f2 | |||
2901671d23 | |||
0e191bfc7a | |||
d6eb50ca35 | |||
f0ed41de9e | |||
f344b4559d | |||
e3b03cd61a | |||
c49dc047a4 | |||
6e841e6e26 | |||
f0070ef64b | |||
6b8b64f607 | |||
6fa80222a6 | |||
031b58c90e | |||
178bc0ab79 | |||
441f0748e9 | |||
5ab596937a | |||
5b5ea7173a | |||
b88bbd6d4d | |||
2b01e6ece6 | |||
c742b5dbc3 | |||
ec8a26ecfc | |||
8d8dd0d84e | |||
0f1e991889 | |||
1eb0eee3bc | |||
9106d68cdc | |||
551f4e312e | |||
d1c58a2e77 | |||
9213f0d1f5 | |||
7ed82c7a63 | |||
33903d8f6c | |||
4682597b04 | |||
790d0405c2 | |||
28e94f96e3 | |||
b5ab7201d1 | |||
4ad5cf1d19 | |||
7f828e87f6 | |||
57479bdf37 | |||
0c8f226f1f | |||
daba777e24 |
@ -9,7 +9,7 @@ platform:
|
|||||||
steps:
|
steps:
|
||||||
- name: lint
|
- name: lint
|
||||||
pull: always
|
pull: always
|
||||||
image: alpine:3.12
|
image: alpine:3.13
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
||||||
- helm lint
|
- helm lint
|
||||||
@ -42,21 +42,22 @@ trigger:
|
|||||||
steps:
|
steps:
|
||||||
- name: generate-chart
|
- name: generate-chart
|
||||||
pull: always
|
pull: always
|
||||||
image: alpine:3.12
|
image: alpine:3.13
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
||||||
|
- apk add --no-cache curl
|
||||||
- helm dependency update
|
- helm dependency update
|
||||||
- helm package --version "${DRONE_TAG##v}" ./
|
- helm package --version "${DRONE_TAG##v}" ./
|
||||||
- mkdir gitea
|
- mkdir gitea
|
||||||
- mv gitea*.tgz gitea/
|
- mv gitea*.tgz gitea/
|
||||||
- wget -O gitea/index.yaml https://dl.gitea.io/charts/index.yaml
|
- curl -L -o gitea/index.yaml https://dl.gitea.io/charts/index.yaml
|
||||||
- helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml
|
- helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml
|
||||||
|
|
||||||
- name: upload-chart
|
- name: upload-chart
|
||||||
pull: always
|
pull: always
|
||||||
image: plugins/s3:latest
|
image: plugins/s3:latest
|
||||||
settings:
|
settings:
|
||||||
bucket: releases
|
bucket: gitea-artifacts
|
||||||
endpoint: https://storage.gitea.io
|
endpoint: https://storage.gitea.io
|
||||||
path_style: true
|
path_style: true
|
||||||
access_key:
|
access_key:
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
charts
|
charts
|
||||||
Chart.lock
|
Chart.lock
|
||||||
|
.DS_Store
|
||||||
|
10
Chart.yaml
10
Chart.yaml
@ -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.1
|
appVersion: 1.14.6
|
||||||
icon: https://docs.gitea.io/images/gitea.png
|
icon: https://docs.gitea.io/images/gitea.png
|
||||||
|
|
||||||
keywords:
|
keywords:
|
||||||
@ -26,11 +26,13 @@ maintainers:
|
|||||||
email: konrad.lother@novum-rgi.de
|
email: konrad.lother@novum-rgi.de
|
||||||
- name: Lucas Hahn
|
- name: Lucas Hahn
|
||||||
email: lucas.hahn@novum-rgi.de
|
email: lucas.hahn@novum-rgi.de
|
||||||
|
- name: Steven Kriegler
|
||||||
|
email: sk.bunsenbrenner@gmail.com
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: memcached
|
- name: memcached
|
||||||
repository: https://charts.bitnami.com/bitnami
|
repository: https://charts.bitnami.com/bitnami
|
||||||
version: 4.2.20
|
version: 5.9.0
|
||||||
condition: gitea.cache.builtIn.enabled
|
condition: gitea.cache.builtIn.enabled
|
||||||
- name: mysql
|
- name: mysql
|
||||||
repository: https://charts.bitnami.com/bitnami
|
repository: https://charts.bitnami.com/bitnami
|
||||||
@ -38,9 +40,9 @@ dependencies:
|
|||||||
condition: gitea.database.builtIn.mysql.enabled
|
condition: gitea.database.builtIn.mysql.enabled
|
||||||
- name: postgresql
|
- name: postgresql
|
||||||
repository: https://charts.bitnami.com/bitnami
|
repository: https://charts.bitnami.com/bitnami
|
||||||
version: 9.7.2
|
version: 10.3.17
|
||||||
condition: gitea.database.builtIn.postgresql.enabled
|
condition: gitea.database.builtIn.postgresql.enabled
|
||||||
- name: mariadb
|
- name: mariadb
|
||||||
repository: https://charts.bitnami.com/bitnami
|
repository: https://charts.bitnami.com/bitnami
|
||||||
version: 8.0.0
|
version: 9.3.6
|
||||||
condition: gitea.database.builtIn.mariadb.enabled
|
condition: gitea.database.builtIn.mariadb.enabled
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
1. Get the application URL by running these commands:
|
1. Get the application URL by running these commands:
|
||||||
{{- if .Values.ingress.enabled }}
|
{{- if .Values.ingress.enabled }}
|
||||||
{{- range $host := .Values.ingress.hosts }}
|
{{- range $host := .Values.ingress.hosts }}
|
||||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}/
|
{{- range .paths }}
|
||||||
|
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else if contains "NodePort" .Values.service.http.type }}
|
{{- else if contains "NodePort" .Values.service.http.type }}
|
||||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "gitea.fullname" . }})
|
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "gitea.fullname" . }})
|
||||||
|
@ -31,14 +31,26 @@ 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
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "gitea.labels" -}}
|
{{- define "gitea.labels" -}}
|
||||||
helm.sh/chart: {{ include "gitea.chart" . }}
|
helm.sh/chart: {{ include "gitea.chart" . }}
|
||||||
|
app: {{ include "gitea.name" . }}
|
||||||
{{ include "gitea.selectorLabels" . }}
|
{{ include "gitea.selectorLabels" . }}
|
||||||
{{- if .Chart.AppVersion }}
|
{{- if .Chart.AppVersion }}
|
||||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
version: {{ .Chart.AppVersion | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@ -58,7 +70,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
|||||||
{{- printf "%s-mysql" .Release.Name -}}
|
{{- printf "%s-mysql" .Release.Name -}}
|
||||||
{{- else if .Values.gitea.database.builtIn.mariadb.enabled -}}
|
{{- else if .Values.gitea.database.builtIn.mariadb.enabled -}}
|
||||||
{{- printf "%s-mariadb" .Release.Name -}}
|
{{- printf "%s-mariadb" .Release.Name -}}
|
||||||
{{- else -}}
|
{{- else if ne .Values.gitea.config.database.DB_TYPE "sqlite3" -}}
|
||||||
{{- $parts := split ":" .Values.gitea.config.database.HOST -}}
|
{{- $parts := split ":" .Values.gitea.config.database.HOST -}}
|
||||||
{{- printf "%s %s" $parts._0 $parts._1 -}}
|
{{- printf "%s %s" $parts._0 $parts._1 -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@ -96,13 +108,36 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "gitea.ldap_settings" -}}
|
{{- define "gitea.ldap_settings" -}}
|
||||||
|
{{- if not (hasKey .Values.gitea.ldap "bindDn") -}}
|
||||||
|
{{- $_ := set .Values.gitea.ldap "bindDn" "" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not (hasKey .Values.gitea.ldap "bindPassword") -}}
|
||||||
|
{{- $_ := set .Values.gitea.ldap "bindPassword" "" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $flags := list "notActive" "skipTlsVerify" "allowDeactivateAll" "synchronizeUsers" "attributesInBind" -}}
|
||||||
{{- range $key, $val := .Values.gitea.ldap -}}
|
{{- range $key, $val := .Values.gitea.ldap -}}
|
||||||
{{- if ne $key "enabled" -}}
|
{{- if and (ne $key "enabled") (ne $key "existingSecret") -}}
|
||||||
{{- if eq $key "port" -}}
|
{{- if eq $key "bindDn" -}}
|
||||||
{{- printf "--%s %s " ($key | kebabcase) $val -}}
|
{{- printf "--%s %s " ($key | kebabcase) ("${GITEA_LDAP_BIND_DN}" | quote ) -}}
|
||||||
|
{{- else if eq $key "bindPassword" -}}
|
||||||
|
{{- printf "--%s %s " ($key | kebabcase) ("${GITEA_LDAP_PASSWORD}" | quote ) -}}
|
||||||
|
{{- else if eq $key "port" -}}
|
||||||
|
{{- printf "--%s %d " $key ($val | int) -}}
|
||||||
|
{{- else if has $key $flags -}}
|
||||||
|
{{- printf "--%s " ($key | kebabcase) -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- printf "--%s %s " ($key | kebabcase) ($val | quote) -}}
|
{{- printf "--%s %s " ($key | kebabcase) ($val | squote) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "gitea.oauth_settings" -}}
|
||||||
|
{{- range $key, $val := .Values.gitea.oauth -}}
|
||||||
|
{{- if ne $key "enabled" -}}
|
||||||
|
{{- printf "--%s %s " ($key | kebabcase) ($val | squote) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
|
@ -15,6 +15,10 @@ stringData:
|
|||||||
{{- $_ := set .Values.gitea.config "server" dict -}}
|
{{- $_ := set .Values.gitea.config "server" dict -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not (hasKey .Values.gitea.config "metrics") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config "metrics" dict -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{- if not (hasKey .Values.gitea.config "database") -}}
|
{{- if not (hasKey .Values.gitea.config "database") -}}
|
||||||
{{- $_ := set .Values.gitea.config "database" dict -}}
|
{{- $_ := set .Values.gitea.config "database" dict -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@ -23,12 +27,21 @@ stringData:
|
|||||||
{{- $_ := set .Values.gitea.config "security" dict -}}
|
{{- $_ := set .Values.gitea.config "security" dict -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- /* security default settings */ -}}
|
{{- 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 */ -}}
|
||||||
{{- 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" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- /* server default settings */ -}}
|
{{- /* server default settings */ -}}
|
||||||
{{- if not (hasKey .Values.gitea.config.server "HTTP_PORT") -}}
|
{{- if not (hasKey .Values.gitea.config.server "HTTP_PORT") -}}
|
||||||
{{- $_ := set .Values.gitea.config.server "HTTP_PORT" .Values.service.http.port -}}
|
{{- $_ := set .Values.gitea.config.server "HTTP_PORT" .Values.service.http.port -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@ -37,7 +50,7 @@ stringData:
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if not (.Values.gitea.config.server.DOMAIN) -}}
|
{{- if not (.Values.gitea.config.server.DOMAIN) -}}
|
||||||
{{- if gt (len .Values.ingress.hosts) 0 -}}
|
{{- if gt (len .Values.ingress.hosts) 0 -}}
|
||||||
{{- $_ := set .Values.gitea.config.server "DOMAIN" (index .Values.ingress.hosts 0) -}}
|
{{- $_ := set .Values.gitea.config.server "DOMAIN" (index .Values.ingress.hosts 0).host -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $_ := set .Values.gitea.config.server "DOMAIN" (include "gitea.default_domain" .) -}}
|
{{- $_ := set .Values.gitea.config.server "DOMAIN" (include "gitea.default_domain" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@ -47,7 +60,7 @@ stringData:
|
|||||||
{{- if gt (len .Values.ingress.tls) 0 -}}
|
{{- if gt (len .Values.ingress.tls) 0 -}}
|
||||||
{{- $_ := set .Values.gitea.config.server "ROOT_URL" (printf "%s://%s" .Values.gitea.config.server.PROTOCOL (index (index .Values.ingress.tls 0).hosts 0)) -}}
|
{{- $_ := set .Values.gitea.config.server "ROOT_URL" (printf "%s://%s" .Values.gitea.config.server.PROTOCOL (index (index .Values.ingress.tls 0).hosts 0)) -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $_ := set .Values.gitea.config.server "ROOT_URL" (printf "%s://%s" .Values.gitea.config.server.PROTOCOL (index .Values.ingress.hosts 0)) -}}
|
{{- $_ := set .Values.gitea.config.server "ROOT_URL" (printf "%s://%s" .Values.gitea.config.server.PROTOCOL (index .Values.ingress.hosts 0).host) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $_ := set .Values.gitea.config.server "ROOT_URL" (printf "%s://%s" .Values.gitea.config.server.PROTOCOL .Values.gitea.config.server.DOMAIN) -}}
|
{{- $_ := set .Values.gitea.config.server "ROOT_URL" (printf "%s://%s" .Values.gitea.config.server.PROTOCOL .Values.gitea.config.server.DOMAIN) -}}
|
||||||
@ -60,15 +73,32 @@ 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" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- if not (hasKey .Values.gitea.config.server "ENABLE_PPROF") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.server "ENABLE_PPROF" false -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* metrics default settings */ -}}
|
||||||
|
{{- if not (hasKey .Values.gitea.config.metrics "ENABLED") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.metrics "ENABLED" .Values.gitea.metrics.enabled -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{- /* database default settings */ -}}
|
{{- /* database default settings */ -}}
|
||||||
{{- if .Values.gitea.database.builtIn.postgresql.enabled -}}
|
{{- if .Values.gitea.database.builtIn.postgresql.enabled -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
|
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
|
||||||
{{- if not (.Values.gitea.config.database.HOST) -}}
|
{{- if not (.Values.gitea.config.database.HOST) -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}}
|
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@ -76,7 +106,7 @@ stringData:
|
|||||||
{{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.postgresqlUsername -}}
|
{{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.postgresqlUsername -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.postgresqlPassword -}}
|
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.postgresqlPassword -}}
|
||||||
{{ else if .Values.gitea.database.builtIn.mysql.enabled -}}
|
{{ else if .Values.gitea.database.builtIn.mysql.enabled -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "mysql" -}}
|
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "mysql" -}}
|
||||||
{{- if not (.Values.gitea.config.database.HOST) -}}
|
{{- if not (.Values.gitea.config.database.HOST) -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "HOST" (include "mysql.dns" .) -}}
|
{{- $_ := set .Values.gitea.config.database "HOST" (include "mysql.dns" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@ -101,7 +131,7 @@ stringData:
|
|||||||
{{- $_ := set .Values.gitea.config.cache "HOST" (include "memcached.dns" .) -}}
|
{{- $_ := set .Values.gitea.config.cache "HOST" (include "memcached.dns" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- /* autogenerate app.ini */ -}}
|
{{- /* autogenerate app.ini */ -}}
|
||||||
{{- range $key, $value := .Values.gitea.config }}
|
{{- range $key, $value := .Values.gitea.config }}
|
||||||
{{- if kindIs "map" $value }}
|
{{- if kindIs "map" $value }}
|
||||||
@ -115,4 +145,4 @@ stringData:
|
|||||||
{{- else }}
|
{{- else }}
|
||||||
{{ $key | upper }} = {{ $value }}
|
{{ $key | upper }} = {{ $value }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -11,6 +11,19 @@ spec:
|
|||||||
{{- if and .Values.service.http.loadBalancerIP (eq .Values.service.http.type "LoadBalancer") }}
|
{{- if and .Values.service.http.loadBalancerIP (eq .Values.service.http.type "LoadBalancer") }}
|
||||||
loadBalancerIP: {{ .Values.service.http.loadBalancerIP }}
|
loadBalancerIP: {{ .Values.service.http.loadBalancerIP }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.service.http.loadBalancerSourceRanges }}
|
||||||
|
loadBalancerSourceRanges:
|
||||||
|
{{- range .Values.service.http.loadBalancerSourceRanges }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.service.http.externalIPs }}
|
||||||
|
externalIPs:
|
||||||
|
{{- toYaml .Values.service.http.externalIPs | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.service.http.externalTrafficPolicy }}
|
||||||
|
externalTrafficPolicy: {{ .Values.service.http.externalTrafficPolicy }}
|
||||||
|
{{- end }}
|
||||||
{{- if and .Values.service.http.clusterIP (eq .Values.service.http.type "ClusterIP") }}
|
{{- if and .Values.service.http.clusterIP (eq .Values.service.http.type "ClusterIP") }}
|
||||||
clusterIP: {{ .Values.service.http.clusterIP }}
|
clusterIP: {{ .Values.service.http.clusterIP }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -29,13 +29,14 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.ingress.hosts }}
|
{{- range .Values.ingress.hosts }}
|
||||||
- host: {{ . | quote }}
|
- host: {{ .host | quote }}
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
{{- range .paths }}
|
||||||
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
|
- path: {{ .path }}
|
||||||
pathType: Prefix
|
{{- if and .pathType ($.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") }}
|
||||||
|
pathType: {{ .pathType }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
backend:
|
backend:
|
||||||
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
|
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
|
||||||
@ -47,5 +48,6 @@ spec:
|
|||||||
serviceName: {{ $fullName }}-http
|
serviceName: {{ $fullName }}-http
|
||||||
servicePort: {{ $httpPort }}
|
servicePort: {{ $httpPort }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -6,30 +6,120 @@ metadata:
|
|||||||
{{- include "gitea.labels" . | nindent 4 }}
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
init_gitea.sh: |-
|
init_directory_structure.sh: |-
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
{{- if .Values.initPreScript }}
|
||||||
|
# BEGIN: initPreScript
|
||||||
|
{{- with .Values.initPreScript -}}
|
||||||
|
{{ . | nindent 4}}
|
||||||
|
{{- end -}}
|
||||||
|
# END: initPreScript
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
{{- if not .Values.image.rootless }}
|
||||||
|
chown 1000:1000 /data
|
||||||
|
{{- end }}
|
||||||
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
|
[ ! -d /data/gitea ] && mkdir -p /data/gitea/conf
|
||||||
|
|
||||||
|
# prepare temp directory structure
|
||||||
|
mkdir -p "${GITEA_TEMP}"
|
||||||
|
chown 1000:1000 "${GITEA_TEMP}"
|
||||||
|
chmod ug+rwx "${GITEA_TEMP}"
|
||||||
|
|
||||||
|
# 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
|
||||||
nc -v -w2 -z {{ include "db.servicename" . }} {{ include "db.port" . }} && \
|
configure_gitea.sh: |-
|
||||||
su git -c ' \
|
#!/usr/bin/env bash
|
||||||
set -x; \
|
|
||||||
gitea migrate; \
|
set -euo pipefail
|
||||||
{{- if and .Values.gitea.admin.username .Values.gitea.admin.password }}
|
|
||||||
gitea admin create-user --username {{ .Values.gitea.admin.username }} --password '{{ .Values.gitea.admin.password }}' --email {{ .Values.gitea.admin.email }} --admin --must-change-password=false \
|
{{- if include "db.servicename" . }}
|
||||||
|| \
|
# Connection retry inspired by https://gist.github.com/dublx/e99ea94858c07d2ca6de
|
||||||
gitea admin change-password --username {{ .Values.gitea.admin.username }} --password '{{ .Values.gitea.admin.password }}'; \
|
function test_db_connection() {
|
||||||
|
local RETRY=0
|
||||||
|
local MAX=30
|
||||||
|
|
||||||
|
echo 'Wait for database to become avialable...'
|
||||||
|
until [ "${RETRY}" -ge "${MAX}" ]; do
|
||||||
|
nc -vz -w2 {{ include "db.servicename" . }} {{ include "db.port" . }} && break
|
||||||
|
RETRY=$[${RETRY}+1]
|
||||||
|
echo "...not ready yet (${RETRY}/${MAX})"
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "${RETRY}" -ge "${MAX}" ]; then
|
||||||
|
echo "Database not reachable after '${MAX}' attempts!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
test_db_connection
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
echo '==== BEGIN GITEA CONFIGURATION ===='
|
||||||
|
|
||||||
|
gitea migrate
|
||||||
|
|
||||||
|
{{- if or .Values.gitea.admin.existingSecret (and .Values.gitea.admin.username .Values.gitea.admin.password) }}
|
||||||
|
function configure_admin_user() {
|
||||||
|
local ACCOUNT_ID=$(gitea admin user list --admin | grep -e "\s\+${GITEA_ADMIN_USERNAME}\s\+" | awk -F " " "{printf \$1}")
|
||||||
|
if [[ -z "${ACCOUNT_ID}" ]]; then
|
||||||
|
echo "No admin user '${GITEA_ADMIN_USERNAME}' found. Creating now..."
|
||||||
|
gitea admin user create --admin --username "${GITEA_ADMIN_USERNAME}" --password "${GITEA_ADMIN_PASSWORD}" --email {{ .Values.gitea.admin.email | quote }} --must-change-password=false
|
||||||
|
echo '...created.'
|
||||||
|
else
|
||||||
|
echo "Admin account '${GITEA_ADMIN_USERNAME}' already exist. Running update to sync password..."
|
||||||
|
gitea admin user change-password --username "${GITEA_ADMIN_USERNAME}" --password "${GITEA_ADMIN_PASSWORD}"
|
||||||
|
echo '...password sync done.'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
configure_admin_user
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.gitea.ldap.enabled }}
|
{{- if .Values.gitea.ldap.enabled }}
|
||||||
gitea admin auth add-ldap \
|
function configure_ldap() {
|
||||||
{{- include "gitea.ldap_settings" . | nindent 6 }} \
|
local LDAP_NAME={{ (printf "%s" .Values.gitea.ldap.name) | squote }}
|
||||||
|| \
|
local GITEA_AUTH_ID=$(gitea admin auth list --vertical-bars | grep -E "\|${LDAP_NAME}\s+\|" | grep -iE '\|LDAP \(via BindDN\)\s+\|' | awk -F " " "{print \$1}")
|
||||||
( \
|
|
||||||
export GITEA_AUTH_ID=$(gitea admin auth list | grep {{ .Values.gitea.ldap.name | quote }} | awk -F " " "{print \$1}"); \
|
if [[ -z "${GITEA_AUTH_ID}" ]]; then
|
||||||
gitea admin auth update-ldap --id ${GITEA_AUTH_ID} \
|
echo "No ldap configuration found with name '${LDAP_NAME}'. Installing it now..."
|
||||||
{{- include "gitea.ldap_settings" . | nindent 6 }} \
|
gitea admin auth add-ldap {{- include "gitea.ldap_settings" . | indent 1 }}
|
||||||
) \
|
echo '...installed.'
|
||||||
|
else
|
||||||
|
echo "Existing ldap configuration with name '${LDAP_NAME}': '${GITEA_AUTH_ID}'. Running update to sync settings..."
|
||||||
|
gitea admin auth update-ldap --id "${GITEA_AUTH_ID}" {{- include "gitea.ldap_settings" . | indent 1 }}
|
||||||
|
echo '...sync settings done.'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
configure_ldap
|
||||||
{{- end }}
|
{{- end }}
|
||||||
'
|
|
||||||
|
{{- if .Values.gitea.oauth.enabled }}
|
||||||
|
function configure_oauth() {
|
||||||
|
local OAUTH_NAME={{ (printf "%s" .Values.gitea.oauth.name) | squote }}
|
||||||
|
local AUTH_ID=$(gitea admin auth list --vertical-bars | grep -E "\|${OAUTH_NAME}\s+\|" | grep -iE '\|OAuth2\s+\|' | awk -F " " "{print \$1}")
|
||||||
|
|
||||||
|
if [[ -z "${AUTH_ID}" ]]; then
|
||||||
|
echo "No oauth configuration found with name '${OAUTH_NAME}'. Installing it now..."
|
||||||
|
gitea admin auth add-oauth {{- include "gitea.oauth_settings" . | indent 1 }}
|
||||||
|
echo '...installed.'
|
||||||
|
else
|
||||||
|
echo "Existing oauth configuration with name '${OAUTH_NAME}': '${AUTH_ID}'. Running update to sync settings..."
|
||||||
|
gitea admin auth update-oauth --id "${AUTH_ID}" {{- include "gitea.oauth_settings" . | indent 1 }}
|
||||||
|
echo '...sync settings done.'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
configure_oauth
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
echo '==== END GITEA CONFIGURATION ===='
|
||||||
|
17
templates/gitea/servicemonitor.yaml
Normal file
17
templates/gitea/servicemonitor.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{{- if .Values.gitea.metrics.serviceMonitor.enabled -}}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: {{ include "gitea.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
|
{{- if .Values.gitea.metrics.serviceMonitor.additionalLabels }}
|
||||||
|
{{- toYaml .Values.gitea.metrics.serviceMonitor.additionalLabels | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
||||||
|
endpoints:
|
||||||
|
- port: http
|
||||||
|
{{- end -}}
|
@ -8,8 +8,16 @@ metadata:
|
|||||||
{{- toYaml .Values.service.ssh.annotations | nindent 4 }}
|
{{- toYaml .Values.service.ssh.annotations | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.service.ssh.type }}
|
type: {{ .Values.service.ssh.type }}
|
||||||
{{- if and .Values.service.ssh.loadBalancerIP (eq .Values.service.ssh.type "LoadBalancer") }}
|
{{- if eq .Values.service.ssh.type "LoadBalancer" }}
|
||||||
|
{{- if .Values.service.ssh.loadBalancerIP }}
|
||||||
loadBalancerIP: {{ .Values.service.ssh.loadBalancerIP }}
|
loadBalancerIP: {{ .Values.service.ssh.loadBalancerIP }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .Values.service.ssh.loadBalancerSourceRanges }}
|
||||||
|
loadBalancerSourceRanges:
|
||||||
|
{{- range .Values.service.ssh.loadBalancerSourceRanges }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if and .Values.service.ssh.clusterIP (eq .Values.service.ssh.type "ClusterIP") }}
|
{{- if and .Values.service.ssh.clusterIP (eq .Values.service.ssh.type "ClusterIP") }}
|
||||||
clusterIP: {{ .Values.service.ssh.clusterIP }}
|
clusterIP: {{ .Values.service.ssh.clusterIP }}
|
||||||
|
@ -9,17 +9,28 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
||||||
|
{{- if .Values.statefulset.labels }}
|
||||||
|
{{- toYaml .Values.statefulset.labels | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
serviceName: {{ include "gitea.fullname" . }}
|
serviceName: {{ include "gitea.fullname" . }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
checksum/config: {{ include (print $.Template.BasePath "/gitea/config.yaml") . | sha256sum }}
|
checksum/config: {{ include (print $.Template.BasePath "/gitea/config.yaml") . | sha256sum }}
|
||||||
|
checksum/ldap: {{ include "gitea.ldap_settings" . | sha256sum }}
|
||||||
|
checksum/oauth: {{ include "gitea.oauth_settings" . | sha256sum }}
|
||||||
{{- with .Values.gitea.podAnnotations }}
|
{{- with .Values.gitea.podAnnotations }}
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "gitea.selectorLabels" . | nindent 8 }}
|
{{- include "gitea.labels" . | nindent 8 }}
|
||||||
|
{{- if .Values.statefulset.labels }}
|
||||||
|
{{- toYaml .Values.statefulset.labels | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
|
{{- if .Values.schedulerName }}
|
||||||
|
schedulerName: "{{ .Values.schedulerName }}"
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.imagePullSecrets }}
|
{{- with .Values.imagePullSecrets }}
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
@ -27,20 +38,100 @@ spec:
|
|||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 1000
|
fsGroup: 1000
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: init
|
- name: init-directories
|
||||||
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_directory_structure.sh"]
|
||||||
|
env:
|
||||||
|
- name: GITEA_APP_INI
|
||||||
|
value: /data/gitea/conf/app.ini
|
||||||
|
- 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 }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: init
|
- name: init
|
||||||
mountPath: /usr/sbin
|
mountPath: /usr/sbin
|
||||||
|
- name: temp
|
||||||
|
mountPath: /tmp
|
||||||
- name: config
|
- name: config
|
||||||
mountPath: /etc/gitea/conf
|
mountPath: /etc/gitea/conf
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
|
{{- if .Values.extraVolumeMounts }}
|
||||||
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
- name: configure-gitea
|
||||||
|
image: "{{ include "gitea.image" . }}"
|
||||||
|
command: ["/usr/sbin/configure_gitea.sh"]
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
env:
|
||||||
|
- name: GITEA_APP_INI
|
||||||
|
value: /data/gitea/conf/app.ini
|
||||||
|
- name: GITEA_CUSTOM
|
||||||
|
value: /data/gitea
|
||||||
|
- name: GITEA_WORK_DIR
|
||||||
|
value: /data
|
||||||
|
- name: GITEA_TEMP
|
||||||
|
value: /tmp/gitea
|
||||||
|
{{- if .Values.gitea.ldap.enabled }}
|
||||||
|
{{- if .Values.gitea.ldap.existingSecret }}
|
||||||
|
- name: GITEA_LDAP_BIND_DN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: bindDn
|
||||||
|
name: {{ .Values.gitea.ldap.existingSecret }}
|
||||||
|
- name: GITEA_LDAP_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: bindPassword
|
||||||
|
name: {{ .Values.gitea.ldap.existingSecret }}
|
||||||
|
{{- else }}
|
||||||
|
- name: GITEA_LDAP_BIND_DN
|
||||||
|
value: {{ .Values.gitea.ldap.bindDn | quote }}
|
||||||
|
- name: GITEA_LDAP_PASSWORD
|
||||||
|
value: {{ .Values.gitea.ldap.bindPassword | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.gitea.admin.existingSecret }}
|
||||||
|
- name: GITEA_ADMIN_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: username
|
||||||
|
name: {{ .Values.gitea.admin.existingSecret }}
|
||||||
|
- name: GITEA_ADMIN_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: password
|
||||||
|
name: {{ .Values.gitea.admin.existingSecret }}
|
||||||
|
{{- else }}
|
||||||
|
- name: GITEA_ADMIN_USERNAME
|
||||||
|
value: {{ .Values.gitea.admin.username | quote }}
|
||||||
|
- name: GITEA_ADMIN_PASSWORD
|
||||||
|
value: {{ .Values.gitea.admin.password | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.statefulset.env }}
|
||||||
|
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: init
|
||||||
|
mountPath: /usr/sbin
|
||||||
|
- name: temp
|
||||||
|
mountPath: /tmp
|
||||||
|
- name: data
|
||||||
|
mountPath: /data
|
||||||
|
{{- if .Values.extraVolumeMounts }}
|
||||||
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
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
|
||||||
@ -48,35 +139,83 @@ 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
|
||||||
|
- name: TMPDIR
|
||||||
|
value: /tmp/gitea
|
||||||
|
{{- if .Values.signing.enabled }}
|
||||||
|
- name: GNUPGHOME
|
||||||
|
value: {{ .Values.signing.gpgHome }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.statefulset.env }}
|
||||||
|
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
- name: ssh
|
- name: ssh
|
||||||
containerPort: {{ .Values.gitea.config.server.SSH_LISTEN_PORT }}
|
containerPort: {{ .Values.gitea.config.server.SSH_LISTEN_PORT }}
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.gitea.config.server.HTTP_PORT }}
|
containerPort: {{ .Values.gitea.config.server.HTTP_PORT }}
|
||||||
|
{{- if .Values.gitea.config.server.ENABLE_PPROF }}
|
||||||
|
- name: profiler
|
||||||
|
containerPort: 6060
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.gitea.livenessProbe.enabled }}
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
tcpSocket:
|
tcpSocket:
|
||||||
port: http
|
port: http
|
||||||
initialDelaySeconds: 200
|
initialDelaySeconds: {{ .Values.gitea.livenessProbe.initialDelaySeconds }}
|
||||||
timeoutSeconds: 1
|
periodSeconds: {{ .Values.gitea.livenessProbe.periodSeconds }}
|
||||||
periodSeconds: 10
|
timeoutSeconds: {{ .Values.gitea.livenessProbe.timeoutSeconds }}
|
||||||
successThreshold: 1
|
successThreshold: {{ .Values.gitea.livenessProbe.successThreshold }}
|
||||||
failureThreshold: 10
|
failureThreshold: {{ .Values.gitea.livenessProbe.failureThreshold }}
|
||||||
|
{{- else if .Values.gitea.customLivenessProbe }}
|
||||||
|
livenessProbe:
|
||||||
|
{{- toYaml .Values.gitea.customLivenessProbe | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.gitea.readinessProbe.enabled }}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
tcpSocket:
|
tcpSocket:
|
||||||
port: http
|
port: http
|
||||||
initialDelaySeconds: 5
|
initialDelaySeconds: {{ .Values.gitea.readinessProbe.initialDelaySeconds }}
|
||||||
periodSeconds: 10
|
periodSeconds: {{ .Values.gitea.readinessProbe.periodSeconds }}
|
||||||
successThreshold: 1
|
timeoutSeconds: {{ .Values.gitea.readinessProbe.timeoutSeconds }}
|
||||||
failureThreshold: 3
|
successThreshold: {{ .Values.gitea.readinessProbe.successThreshold }}
|
||||||
|
failureThreshold: {{ .Values.gitea.readinessProbe.failureThreshold }}
|
||||||
|
{{- else if .Values.gitea.customReadinessProbe }}
|
||||||
|
readinessProbe:
|
||||||
|
{{- toYaml .Values.gitea.customReadinessProbe | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.gitea.startupProbe.enabled }}
|
||||||
|
startupProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: {{ .Values.gitea.startupProbe.initialDelaySeconds }}
|
||||||
|
periodSeconds: {{ .Values.gitea.startupProbe.periodSeconds }}
|
||||||
|
timeoutSeconds: {{ .Values.gitea.startupProbe.timeoutSeconds }}
|
||||||
|
successThreshold: {{ .Values.gitea.startupProbe.successThreshold }}
|
||||||
|
failureThreshold: {{ .Values.gitea.startupProbe.failureThreshold }}
|
||||||
|
{{- else if .Values.gitea.customStartupProbe }}
|
||||||
|
startupProbe:
|
||||||
|
{{- toYaml .Values.gitea.customStartupProbe | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
- name: temp
|
||||||
|
mountPath: /tmp
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
|
{{- if .Values.extraVolumeMounts }}
|
||||||
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
@ -97,10 +236,17 @@ spec:
|
|||||||
- name: config
|
- name: config
|
||||||
secret:
|
secret:
|
||||||
secretName: {{ include "gitea.fullname" . }}
|
secretName: {{ include "gitea.fullname" . }}
|
||||||
|
{{- if .Values.extraVolumes }}
|
||||||
|
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
||||||
|
{{- 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:
|
||||||
claimName: {{ .Values.persistence.existingClaim }}
|
{{- with .Values.persistence.existingClaim }}
|
||||||
|
claimName: {{ tpl . $ }}
|
||||||
|
{{- end }}
|
||||||
{{- else if not .Values.persistence.enabled }}
|
{{- else if not .Values.persistence.enabled }}
|
||||||
- name: data
|
- name: data
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
@ -108,6 +254,18 @@ spec:
|
|||||||
volumeClaimTemplates:
|
volumeClaimTemplates:
|
||||||
- metadata:
|
- metadata:
|
||||||
name: data
|
name: data
|
||||||
|
{{- with .Values.persistence.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- range $key, $value := . }}
|
||||||
|
{{ $key }}: {{ $value }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.persistence.labels }}
|
||||||
|
labels:
|
||||||
|
{{- range $key, $value := . }}
|
||||||
|
{{ $key }}: {{ $value }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
{{- range .Values.persistence.accessModes }}
|
{{- range .Values.persistence.accessModes }}
|
||||||
|
167
values.yaml
167
values.yaml
@ -8,11 +8,31 @@ clusterDomain: cluster.local
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: gitea/gitea
|
repository: gitea/gitea
|
||||||
tag: 1.13.1
|
tag: 1.14.6
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
rootless: false # only possible when running 1.14 or later
|
||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
# only usable with rootless image due to image design
|
||||||
|
securityContext: {}
|
||||||
|
# allowPrivilegeEscalation: false
|
||||||
|
# capabilities:
|
||||||
|
# drop:
|
||||||
|
# - ALL
|
||||||
|
# # Add the SYS_CHROOT capability for root and rootless images if you intend to
|
||||||
|
# # run pods on nodes that use the container runtime cri-o. Otherwise, you will
|
||||||
|
# # get an error message from the SSH server that it is not possible to read from
|
||||||
|
# # the repository.
|
||||||
|
# # https://gitea.com/gitea/helm-chart/issues/161
|
||||||
|
# add:
|
||||||
|
# - SYS_CHROOT
|
||||||
|
# privileged: false
|
||||||
|
# readOnlyRootFilesystem: true
|
||||||
|
# runAsGroup: 1000
|
||||||
|
# runAsNonRoot: true
|
||||||
|
# runAsUser: 1000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
http:
|
http:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
@ -20,6 +40,9 @@ service:
|
|||||||
clusterIP: None
|
clusterIP: None
|
||||||
#loadBalancerIP:
|
#loadBalancerIP:
|
||||||
#nodePort:
|
#nodePort:
|
||||||
|
#externalTrafficPolicy:
|
||||||
|
#externalIPs:
|
||||||
|
loadBalancerSourceRanges: []
|
||||||
annotations:
|
annotations:
|
||||||
ssh:
|
ssh:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
@ -29,6 +52,7 @@ service:
|
|||||||
#nodePort:
|
#nodePort:
|
||||||
#externalTrafficPolicy:
|
#externalTrafficPolicy:
|
||||||
#externalIPs:
|
#externalIPs:
|
||||||
|
loadBalancerSourceRanges: []
|
||||||
annotations:
|
annotations:
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
@ -37,7 +61,10 @@ ingress:
|
|||||||
# kubernetes.io/ingress.class: nginx
|
# kubernetes.io/ingress.class: nginx
|
||||||
# kubernetes.io/tls-acme: "true"
|
# kubernetes.io/tls-acme: "true"
|
||||||
hosts:
|
hosts:
|
||||||
- git.example.com
|
- host: git.example.com
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
tls: []
|
tls: []
|
||||||
# - secretName: chart-example-tls
|
# - secretName: chart-example-tls
|
||||||
# hosts:
|
# hosts:
|
||||||
@ -55,6 +82,11 @@ resources: {}
|
|||||||
# cpu: 100m
|
# cpu: 100m
|
||||||
# memory: 128Mi
|
# memory: 128Mi
|
||||||
|
|
||||||
|
## Use an alternate scheduler, e.g. "stork".
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||||
|
##
|
||||||
|
# schedulerName:
|
||||||
|
|
||||||
nodeSelector: {}
|
nodeSelector: {}
|
||||||
|
|
||||||
tolerations: []
|
tolerations: []
|
||||||
@ -66,38 +98,94 @@ statefulset:
|
|||||||
# - name: VARIABLE
|
# - name: VARIABLE
|
||||||
# value: my-value
|
# value: my-value
|
||||||
terminationGracePeriodSeconds: 60
|
terminationGracePeriodSeconds: 60
|
||||||
|
labels: {}
|
||||||
|
|
||||||
persistence:
|
persistence:
|
||||||
enabled: true
|
enabled: true
|
||||||
# existingClaim:
|
# existingClaim:
|
||||||
size: 10Gi
|
size: 10Gi
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
|
labels: {}
|
||||||
|
annotations: {}
|
||||||
|
# storageClass:
|
||||||
|
|
||||||
|
# additional volumes to add to the Gitea statefulset.
|
||||||
|
extraVolumes:
|
||||||
|
# - name: postgres-ssl-vol
|
||||||
|
# secret:
|
||||||
|
# secretName: gitea-postgres-ssl
|
||||||
|
|
||||||
|
|
||||||
|
# additional volumes to mount, both to the init container and to the main
|
||||||
|
# container. As an example, can be used to mount a client cert when connecting
|
||||||
|
# to an external Postgres server.
|
||||||
|
extraVolumeMounts:
|
||||||
|
# - name: postgres-ssl-vol
|
||||||
|
# readOnly: true
|
||||||
|
# mountPath: "/pg-ssl"
|
||||||
|
|
||||||
|
# bash shell script copied verbatim to the start of the init-container.
|
||||||
|
initPreScript: ""
|
||||||
|
#
|
||||||
|
# initPreScript: |
|
||||||
|
# mkdir -p /data/git/.postgresql
|
||||||
|
# cp /pg-ssl/* /data/git/.postgresql/
|
||||||
|
# chown -R git:git /data/git/.postgresql/
|
||||||
|
# chmod 400 /data/git/.postgresql/postgresql.key
|
||||||
|
|
||||||
|
# Configure commit/action signing prerequisites
|
||||||
|
signing:
|
||||||
|
enabled: false
|
||||||
|
gpgHome: /data/git/.gnupg
|
||||||
|
|
||||||
gitea:
|
gitea:
|
||||||
admin:
|
admin:
|
||||||
|
#existingSecret: gitea-admin-secret
|
||||||
username: gitea_admin
|
username: gitea_admin
|
||||||
password: r8sA8CPHD9!bt6d
|
password: r8sA8CPHD9!bt6d
|
||||||
email: "gitea@local.domain"
|
email: "gitea@local.domain"
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
enabled: false
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: false
|
||||||
|
# additionalLabels:
|
||||||
|
# prometheus-release: prom1
|
||||||
|
|
||||||
ldap:
|
ldap:
|
||||||
enabled: false
|
enabled: false
|
||||||
#name:
|
#existingSecret: gitea-ldap-secret
|
||||||
#securityProtocol:
|
#name:
|
||||||
#host:
|
#securityProtocol:
|
||||||
#port:
|
#host:
|
||||||
#userSearchBase:
|
#port:
|
||||||
#userFilter:
|
#userSearchBase:
|
||||||
#adminFilter:
|
#userFilter:
|
||||||
#emailAttribute:
|
#adminFilter:
|
||||||
#bindDn:
|
#emailAttribute:
|
||||||
#bindPassword:
|
#bindDn:
|
||||||
#usernameAttribute:
|
#bindPassword:
|
||||||
|
#usernameAttribute:
|
||||||
|
#sshPublicKeyAttribute:
|
||||||
|
|
||||||
|
oauth:
|
||||||
|
enabled: false
|
||||||
|
#name:
|
||||||
|
#provider:
|
||||||
|
#key:
|
||||||
|
#secret:
|
||||||
|
#autoDiscoverUrl:
|
||||||
|
#useCustomUrls:
|
||||||
|
#customAuthUrl:
|
||||||
|
#customTokenUrl:
|
||||||
|
#customProfileUrl:
|
||||||
|
#customEmailUrl:
|
||||||
|
|
||||||
config: {}
|
config: {}
|
||||||
# APP_NAME: "Gitea: Git with a cup of tea"
|
# APP_NAME: "Gitea: Git with a cup of tea"
|
||||||
# RUN_MODE: dev
|
# RUN_MODE: dev
|
||||||
#
|
#
|
||||||
# server:
|
# server:
|
||||||
# SSH_PORT: 22
|
# SSH_PORT: 22
|
||||||
#
|
#
|
||||||
@ -119,6 +207,53 @@ gitea:
|
|||||||
builtIn:
|
builtIn:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
livenessProbe:
|
||||||
|
enabled: true
|
||||||
|
initialDelaySeconds: 200
|
||||||
|
timeoutSeconds: 1
|
||||||
|
periodSeconds: 10
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 10
|
||||||
|
readinessProbe:
|
||||||
|
enabled: true
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 1
|
||||||
|
periodSeconds: 10
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
startupProbe:
|
||||||
|
enabled: false
|
||||||
|
initialDelaySeconds: 60
|
||||||
|
timeoutSeconds: 1
|
||||||
|
periodSeconds: 10
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 10
|
||||||
|
|
||||||
|
# customLivenessProbe:
|
||||||
|
# httpGet:
|
||||||
|
# path: /user/login
|
||||||
|
# port: http
|
||||||
|
# initialDelaySeconds: 60
|
||||||
|
# periodSeconds: 10
|
||||||
|
# successThreshold: 1
|
||||||
|
# failureThreshold: 10
|
||||||
|
# customReadinessProbe:
|
||||||
|
# httpGet:
|
||||||
|
# path: /user/login
|
||||||
|
# port: http
|
||||||
|
# initialDelaySeconds: 5
|
||||||
|
# periodSeconds: 10
|
||||||
|
# successThreshold: 1
|
||||||
|
# failureThreshold: 3
|
||||||
|
# customStartupProbe:
|
||||||
|
# httpGet:
|
||||||
|
# path: /user/login
|
||||||
|
# port: http
|
||||||
|
# initialDelaySeconds: 60
|
||||||
|
# periodSeconds: 10
|
||||||
|
# successThreshold: 1
|
||||||
|
# failureThreshold: 10
|
||||||
|
|
||||||
memcached:
|
memcached:
|
||||||
service:
|
service:
|
||||||
port: 11211
|
port: 11211
|
||||||
|
Reference in New Issue
Block a user