Compare commits
51 Commits
Author | SHA1 | Date | |
---|---|---|---|
b88bbd6d4d | |||
2b01e6ece6 | |||
c742b5dbc3 | |||
ec8a26ecfc | |||
8d8dd0d84e | |||
0f1e991889 | |||
1eb0eee3bc | |||
9106d68cdc | |||
551f4e312e | |||
d1c58a2e77 | |||
9213f0d1f5 | |||
7ed82c7a63 | |||
33903d8f6c | |||
4682597b04 | |||
790d0405c2 | |||
28e94f96e3 | |||
b5ab7201d1 | |||
4ad5cf1d19 | |||
7f828e87f6 | |||
57479bdf37 | |||
0c8f226f1f | |||
daba777e24 | |||
54cc78b43a | |||
94ee162ad5 | |||
9b2e76c9cf | |||
2c066d7c9e | |||
2826258cfc | |||
943eda6d5f | |||
5311243a6e | |||
1b21ce2810 | |||
4fdf4ef41b | |||
63bc10e393 | |||
fea1abddd9 | |||
33ee018b52 | |||
13e210c75f | |||
a26b4e10d1 | |||
76aee7b25b | |||
bf1f5601be | |||
729a412803 | |||
79690ee488 | |||
5398b99514 | |||
f62b82e956 | |||
ed0ce3d192 | |||
8f70a4b9a0 | |||
a4e5943ca5 | |||
fc9c49179f | |||
4c17cc839e | |||
d1fac6ce7d | |||
37bc343ca9 | |||
b96da586db | |||
0877cc81ca |
21
.drone.yml
21
.drone.yml
@ -4,19 +4,19 @@ name: lint
|
|||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
arch: amd64
|
arch: arm64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: lint
|
- name: lint
|
||||||
pull: always
|
pull: always
|
||||||
image: pelotech/drone-helm3
|
image: alpine:3.12
|
||||||
settings:
|
commands:
|
||||||
helm_command: lint
|
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
||||||
chart: ./
|
- helm lint
|
||||||
|
|
||||||
- name: discord
|
- name: discord
|
||||||
pull: always
|
pull: always
|
||||||
image: appleboy/drone-discord:1.0.0
|
image: appleboy/drone-discord:1.2.4
|
||||||
environment:
|
environment:
|
||||||
DISCORD_WEBHOOK_ID:
|
DISCORD_WEBHOOK_ID:
|
||||||
from_secret: discord_webhook_id
|
from_secret: discord_webhook_id
|
||||||
@ -41,20 +41,19 @@ trigger:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: generate-chart
|
- name: generate-chart
|
||||||
pull: default
|
pull: always
|
||||||
image: alpine:3.12
|
image: alpine:3.12
|
||||||
commands:
|
commands:
|
||||||
- wget -q https://get.helm.sh/helm-v3.3.1-linux-arm64.tar.gz -O - | tar -xzO linux-arm64/helm > /usr/local/bin/helm
|
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
|
||||||
- chmod +x /usr/local/bin/helm
|
|
||||||
- helm dependency update
|
- helm dependency update
|
||||||
- helm package ./
|
- 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
|
- wget -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: default
|
pull: always
|
||||||
image: plugins/s3:latest
|
image: plugins/s3:latest
|
||||||
settings:
|
settings:
|
||||||
bucket: releases
|
bucket: releases
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
charts
|
charts
|
||||||
Chart.lock
|
Chart.lock
|
||||||
|
.DS_Store
|
||||||
|
13
Chart.yaml
13
Chart.yaml
@ -2,8 +2,8 @@ apiVersion: v2
|
|||||||
name: gitea
|
name: gitea
|
||||||
description: Gitea Helm chart for Kubernetes
|
description: Gitea Helm chart for Kubernetes
|
||||||
type: application
|
type: application
|
||||||
version: 1.5.1
|
version: 0.0.0
|
||||||
appVersion: 1.12.4
|
appVersion: 1.14.1
|
||||||
icon: https://docs.gitea.io/images/gitea.png
|
icon: https://docs.gitea.io/images/gitea.png
|
||||||
|
|
||||||
keywords:
|
keywords:
|
||||||
@ -14,6 +14,7 @@ keywords:
|
|||||||
- gitea
|
- gitea
|
||||||
- gogs
|
- gogs
|
||||||
sources:
|
sources:
|
||||||
|
- https://gitea.com/gitea/helm-chart
|
||||||
- https://github.com/go-gitea/gitea
|
- https://github.com/go-gitea/gitea
|
||||||
- https://hub.docker.com/r/gitea/gitea/
|
- https://hub.docker.com/r/gitea/gitea/
|
||||||
maintainers:
|
maintainers:
|
||||||
@ -33,9 +34,13 @@ dependencies:
|
|||||||
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
|
||||||
version: 6.14.8
|
version: 6.14.10
|
||||||
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: 8.6.4
|
version: 9.7.2
|
||||||
condition: gitea.database.builtIn.postgresql.enabled
|
condition: gitea.database.builtIn.postgresql.enabled
|
||||||
|
- name: mariadb
|
||||||
|
repository: https://charts.bitnami.com/bitnami
|
||||||
|
version: 8.0.0
|
||||||
|
condition: gitea.database.builtIn.mariadb.enabled
|
||||||
|
@ -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 -}}
|
||||||
@ -51,16 +63,14 @@ app.kubernetes.io/name: {{ include "gitea.name" . }}
|
|||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "postgresql.dns" -}}
|
|
||||||
{{- printf "%s-postgresql.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.postgresql.global.postgresql.servicePort -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "db.servicename" -}}
|
{{- define "db.servicename" -}}
|
||||||
{{- if .Values.gitea.database.builtIn.postgresql.enabled -}}
|
{{- if .Values.gitea.database.builtIn.postgresql.enabled -}}
|
||||||
{{- printf "%s-postgresql" .Release.Name -}}
|
{{- printf "%s-postgresql" .Release.Name -}}
|
||||||
{{- else if .Values.gitea.database.builtIn.mysql.enabled -}}
|
{{- else if .Values.gitea.database.builtIn.mysql.enabled -}}
|
||||||
{{- printf "%s-mysql" .Release.Name -}}
|
{{- printf "%s-mysql" .Release.Name -}}
|
||||||
{{- else -}}
|
{{- else if .Values.gitea.database.builtIn.mariadb.enabled -}}
|
||||||
|
{{- printf "%s-mariadb" .Release.Name -}}
|
||||||
|
{{- 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 -}}
|
||||||
@ -71,19 +81,48 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
|||||||
{{ .Values.postgresql.global.postgresql.servicePort }}
|
{{ .Values.postgresql.global.postgresql.servicePort }}
|
||||||
{{- else if .Values.gitea.database.builtIn.mysql.enabled -}}
|
{{- else if .Values.gitea.database.builtIn.mysql.enabled -}}
|
||||||
{{ .Values.mysql.service.port }}
|
{{ .Values.mysql.service.port }}
|
||||||
|
{{- else if .Values.gitea.database.builtIn.mariadb.enabled -}}
|
||||||
|
{{ .Values.mariadb.primary.service.port }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "postgresql.dns" -}}
|
||||||
|
{{- printf "%s-postgresql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.postgresql.global.postgresql.servicePort -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mysql.dns" -}}
|
{{- define "mysql.dns" -}}
|
||||||
{{- printf "%s-mysql.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.mysql.service.port | trunc 63 | trimSuffix "-" -}}
|
{{- printf "%s-mysql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.mysql.service.port | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "mariadb.dns" -}}
|
||||||
|
{{- printf "%s-mariadb.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.mariadb.primary.service.port | trunc 63 | trimSuffix "-" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "memcached.dns" -}}
|
{{- define "memcached.dns" -}}
|
||||||
{{- printf "%s-memcached.%s.svc.cluster.local:%g" .Release.Name .Release.Namespace .Values.memcached.service.port | trunc 63 | trimSuffix "-" -}}
|
{{- printf "%s-memcached.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.memcached.service.port | trunc 63 | trimSuffix "-" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "gitea.default_domain" -}}
|
{{- define "gitea.default_domain" -}}
|
||||||
{{- printf "%s-gitea.%s.svc.cluster.local" (include "gitea.fullname" .) .Release.Namespace | trunc 63 | trimSuffix "-" -}}
|
{{- printf "%s-gitea.%s.svc.%s" (include "gitea.fullname" .) .Release.Namespace .Values.clusterDomain | trunc 63 | trimSuffix "-" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "gitea.ldap_settings" -}}
|
||||||
|
{{- range $key, $val := .Values.gitea.ldap -}}
|
||||||
|
{{- if ne $key "enabled" -}}
|
||||||
|
{{- if eq $key "port" -}}
|
||||||
|
{{- printf "--%s %d " ($key | kebabcase) ($val | int) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "--%s %s " ($key | kebabcase) ($val | quote) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "gitea.oauth_settings" -}}
|
||||||
|
{{- range $key, $val := .Values.gitea.oauth -}}
|
||||||
|
{{- if ne $key "enabled" -}}
|
||||||
|
{{- printf "--%s %s " ($key | kebabcase) ($val | quote) -}}
|
||||||
|
{{- 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 -}}
|
||||||
@ -60,12 +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 -}}
|
||||||
|
{{- if not (hasKey .Values.gitea.config.server "APP_DATA_PATH") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.server "APP_DATA_PATH" "/data" -}}
|
||||||
|
{{- 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 -}}
|
{{- 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 -}}
|
||||||
@ -73,13 +106,21 @@ 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 -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "NAME" .Values.mysql.db.name -}}
|
{{- $_ := set .Values.gitea.config.database "NAME" .Values.mysql.db.name -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "USER" .Values.mysql.db.user -}}
|
{{- $_ := set .Values.gitea.config.database "USER" .Values.mysql.db.user -}}
|
||||||
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mysql.db.password -}}
|
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mysql.db.password -}}
|
||||||
|
{{ else if .Values.gitea.database.builtIn.mariadb.enabled -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "mysql" -}}
|
||||||
|
{{- if not (.Values.gitea.config.database.HOST) -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.database "HOST" (include "mariadb.dns" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.database "NAME" .Values.mariadb.auth.database -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.database "USER" .Values.mariadb.auth.username -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mariadb.auth.password -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- /* cache default settings */ -}}
|
{{- /* cache default settings */ -}}
|
||||||
@ -90,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 }}
|
||||||
@ -104,4 +145,4 @@ stringData:
|
|||||||
{{- else }}
|
{{- else }}
|
||||||
{{ $key | upper }} = {{ $value }}
|
{{ $key | upper }} = {{ $value }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -4,9 +4,16 @@ metadata:
|
|||||||
name: {{ include "gitea.fullname" . }}-http
|
name: {{ include "gitea.fullname" . }}-http
|
||||||
labels:
|
labels:
|
||||||
{{- include "gitea.labels" . | nindent 4 }}
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml .Values.service.http.annotations | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.service.http.type }}
|
type: {{ .Values.service.http.type }}
|
||||||
clusterIP: None
|
{{- if and .Values.service.http.loadBalancerIP (eq .Values.service.http.type "LoadBalancer") }}
|
||||||
|
loadBalancerIP: {{ .Values.service.http.loadBalancerIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.service.http.clusterIP (eq .Values.service.http.type "ClusterIP") }}
|
||||||
|
clusterIP: {{ .Values.service.http.clusterIP }}
|
||||||
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
port: {{ .Values.service.http.port }}
|
port: {{ .Values.service.http.port }}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
{{- if .Values.ingress.enabled -}}
|
{{- if .Values.ingress.enabled -}}
|
||||||
{{- $fullName := include "gitea.fullname" . -}}
|
{{- $fullName := include "gitea.fullname" . -}}
|
||||||
{{- $httpPort := .Values.service.http.port -}}
|
{{- $httpPort := .Values.service.http.port -}}
|
||||||
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress" -}}
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: extensions/v1beta1
|
||||||
@ -32,8 +34,18 @@ spec:
|
|||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
|
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
|
||||||
|
pathType: Prefix
|
||||||
|
{{- end }}
|
||||||
backend:
|
backend:
|
||||||
|
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
|
||||||
|
service:
|
||||||
|
name: {{ $fullName }}-http
|
||||||
|
port:
|
||||||
|
number: {{ $httpPort }}
|
||||||
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}-http
|
serviceName: {{ $fullName }}-http
|
||||||
servicePort: {{ $httpPort }}
|
servicePort: {{ $httpPort }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -8,50 +8,60 @@ type: Opaque
|
|||||||
stringData:
|
stringData:
|
||||||
init_gitea.sh: |-
|
init_gitea.sh: |-
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
{{- if .Values.initPreScript }}
|
||||||
|
# BEGIN: initPreScript
|
||||||
|
{{- with .Values.initPreScript -}}
|
||||||
|
{{ . | nindent 4}}
|
||||||
|
{{- end -}}
|
||||||
|
# END: initPreScript
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
chown 1000:1000 /data
|
||||||
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" . }}
|
||||||
|
# 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 }}
|
||||||
|
{{- 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 }}' --email {{ .Values.gitea.admin.email }} --admin \
|
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 }}'; \
|
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 \
|
||||||
--name {{ .Values.gitea.ldap.name | quote }} \
|
{{- include "gitea.ldap_settings" . | nindent 6 }} \
|
||||||
--security-protocol {{ .Values.gitea.ldap.securityProtocol | quote }} \
|
|
||||||
--host {{ .Values.gitea.ldap.host | quote }} \
|
|
||||||
--port {{ .Values.gitea.ldap.port | int}} \
|
|
||||||
--user-search-base {{ .Values.gitea.ldap.userSearchBase | quote }} \
|
|
||||||
--user-filter {{ .Values.gitea.ldap.userFilter | quote }} \
|
|
||||||
--admin-filter {{ .Values.gitea.ldap.adminFilter | quote }} \
|
|
||||||
--email-attribute {{ .Values.gitea.ldap.emailAttribute | quote }} \
|
|
||||||
--bind-dn {{ .Values.gitea.ldap.bindDn | quote }} \
|
|
||||||
--bind-password {{ .Values.gitea.ldap.bindPassword | quote }} \
|
|
||||||
--synchronize-users \
|
|
||||||
--username-attribute {{ .Values.gitea.ldap.usernameAttribute | quote }} \
|
|
||||||
|| \
|
|| \
|
||||||
( \
|
( \
|
||||||
export GITEA_AUTH_ID=$(gitea admin auth list | grep {{ .Values.gitea.ldap.name | quote }} | awk -F " " "{print \$1}"); \
|
export GITEA_AUTH_ID=$(gitea admin auth list | grep {{ .Values.gitea.ldap.name | quote }} | awk -F " " "{print \$1}"); \
|
||||||
gitea admin auth update-ldap --id ${GITEA_AUTH_ID} \
|
gitea admin auth update-ldap --id ${GITEA_AUTH_ID} \
|
||||||
--name {{ .Values.gitea.ldap.name | quote }} \
|
{{- include "gitea.ldap_settings" . | nindent 6 }} \
|
||||||
--security-protocol {{ .Values.gitea.ldap.securityProtocol | quote }} \
|
|
||||||
--host {{ .Values.gitea.ldap.host | quote }} \
|
|
||||||
--port {{ .Values.gitea.ldap.port | int}} \
|
|
||||||
--user-search-base {{ .Values.gitea.ldap.userSearchBase | quote }} \
|
|
||||||
--user-filter {{ .Values.gitea.ldap.userFilter | quote }} \
|
|
||||||
--admin-filter {{ .Values.gitea.ldap.adminFilter | quote }} \
|
|
||||||
--email-attribute {{ .Values.gitea.ldap.emailAttribute | quote }} \
|
|
||||||
--bind-dn {{ .Values.gitea.ldap.bindDn | quote }} \
|
|
||||||
--bind-password {{ .Values.gitea.ldap.bindPassword | quote }} \
|
|
||||||
--synchronize-users \
|
|
||||||
--username-attribute {{ .Values.gitea.ldap.usernameAttribute | quote }} \
|
|
||||||
) \
|
) \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
'
|
{{- if .Values.gitea.oauth.enabled }}
|
||||||
|
gitea admin auth add-oauth \
|
||||||
|
{{- include "gitea.oauth_settings" . | nindent 6 }} \
|
||||||
|
|| \
|
||||||
|
( \
|
||||||
|
export GITEA_AUTH_ID=$(gitea admin auth list | grep {{ .Values.gitea.oauth.name | quote }} | awk -F " " "{print \$1}"); \
|
||||||
|
gitea admin auth update-oauth --id ${GITEA_AUTH_ID} \
|
||||||
|
{{- include "gitea.oauth_settings" . | nindent 6 }} \
|
||||||
|
) \
|
||||||
|
{{- end }}
|
||||||
|
{{- if not .Values.image.rootless }}
|
||||||
|
'
|
||||||
|
{{- end }}
|
||||||
|
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.prometheusSelector }}
|
||||||
|
prometheus: {{ .Values.gitea.metrics.serviceMonitor.prometheusSelector }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
||||||
|
endpoints:
|
||||||
|
- port: http
|
||||||
|
{{- end -}}
|
@ -5,18 +5,26 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
{{- include "gitea.labels" . | nindent 4 }}
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
{{ toYaml .Values.service.ssh.annotations | indent 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 }}
|
||||||
{{- if eq .Values.service.ssh.type "ClusterIP" }}
|
{{- end }}
|
||||||
clusterIP: None
|
{{- end }}
|
||||||
|
{{- if and .Values.service.ssh.clusterIP (eq .Values.service.ssh.type "ClusterIP") }}
|
||||||
|
clusterIP: {{ .Values.service.ssh.clusterIP }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.service.ssh.externalIPs }}
|
{{- if .Values.service.ssh.externalIPs }}
|
||||||
externalIPs:
|
externalIPs:
|
||||||
{{ toYaml .Values.service.ssh.externalIPs | indent 4 }}
|
{{- toYaml .Values.service.ssh.externalIPs | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.service.ssh.externalTrafficPolicy }}
|
{{- if .Values.service.ssh.externalTrafficPolicy }}
|
||||||
externalTrafficPolicy: {{ .Values.service.ssh.externalTrafficPolicy }}
|
externalTrafficPolicy: {{ .Values.service.ssh.externalTrafficPolicy }}
|
||||||
|
@ -9,23 +9,45 @@ 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:
|
||||||
|
{{- with .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 1000
|
fsGroup: 1000
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: init
|
- name: init
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
|
image: "{{ include "gitea.image" . }}"
|
||||||
command: ["/usr/sbin/init_gitea.sh"]
|
command: ["/usr/sbin/init_gitea.sh"]
|
||||||
|
env:
|
||||||
|
- name: GITEA_APP_INI
|
||||||
|
value: /data/gitea/conf/app.ini
|
||||||
|
- name: GITEA_CUSTOM
|
||||||
|
value: /data/gitea
|
||||||
|
- name: GITEA_WORK_DIR
|
||||||
|
value: /data
|
||||||
|
{{- if .Values.statefulset.env }}
|
||||||
|
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: init
|
- name: init
|
||||||
mountPath: /usr/sbin
|
mountPath: /usr/sbin
|
||||||
@ -33,10 +55,13 @@ spec:
|
|||||||
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 }}
|
||||||
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
|
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .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
|
||||||
@ -44,35 +69,77 @@ 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
|
||||||
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/gitea
|
||||||
- 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 }}
|
||||||
@ -93,6 +160,11 @@ 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:
|
||||||
@ -104,12 +176,26 @@ 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 }}
|
||||||
- {{ . | quote }}
|
- {{ . | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
storageClassName: {{ .Values.persistence.storageClass | default "standard" | quote }}
|
{{- if .Values.persistence.storageClass }}
|
||||||
|
storageClassName: {{ .Values.persistence.storageClass | quote }}
|
||||||
|
{{- end }}
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: {{ .Values.persistence.size | quote }}
|
storage: {{ .Values.persistence.size | quote }}
|
||||||
|
@ -11,5 +11,5 @@ spec:
|
|||||||
- name: wget
|
- name: wget
|
||||||
image: busybox
|
image: busybox
|
||||||
command: ['wget']
|
command: ['wget']
|
||||||
args: ['{{ include "gitea.fullname" . }}:{{ .Values.service.port }}']
|
args: ['{{ include "gitea.fullname" . }}-http:{{ .Values.service.http.port }}']
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
159
values.yaml
159
values.yaml
@ -4,24 +4,44 @@
|
|||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 1
|
||||||
|
|
||||||
|
clusterDomain: cluster.local
|
||||||
|
|
||||||
image:
|
image:
|
||||||
repository: gitea/gitea
|
repository: gitea/gitea
|
||||||
version: 1.12.4
|
tag: 1.14.1
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
rootless: false # only possible when running 1.14 or later
|
||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
securityContext: {}
|
||||||
|
# allowPrivilegeEscalation: false
|
||||||
|
# capabilities:
|
||||||
|
# drop:
|
||||||
|
# - ALL
|
||||||
|
# privileged: false
|
||||||
|
# readOnlyRootFilesystem: true
|
||||||
|
# runAsGroup: 1000
|
||||||
|
# runAsNonRoot: true
|
||||||
|
# runAsUser: 1000
|
||||||
|
|
||||||
service:
|
service:
|
||||||
http:
|
http:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
port: 3000
|
port: 3000
|
||||||
|
clusterIP: None
|
||||||
|
#loadBalancerIP:
|
||||||
|
#nodePort:
|
||||||
|
annotations:
|
||||||
ssh:
|
ssh:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
port: 22
|
port: 22
|
||||||
|
clusterIP: None
|
||||||
#loadBalancerIP:
|
#loadBalancerIP:
|
||||||
#nodePort:
|
#nodePort:
|
||||||
#externalTrafficPolicy:
|
#externalTrafficPolicy:
|
||||||
#externalIPs:
|
#externalIPs:
|
||||||
|
loadBalancerSourceRanges: []
|
||||||
annotations:
|
annotations:
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
@ -59,14 +79,41 @@ 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
|
||||||
storageClass: standard
|
labels: {}
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
gitea:
|
gitea:
|
||||||
admin:
|
admin:
|
||||||
@ -74,24 +121,44 @@ gitea:
|
|||||||
password: r8sA8CPHD9!bt6d
|
password: r8sA8CPHD9!bt6d
|
||||||
email: "gitea@local.domain"
|
email: "gitea@local.domain"
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
enabled: false
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: false
|
||||||
|
# prometheusSelector: default
|
||||||
|
|
||||||
ldap:
|
ldap:
|
||||||
enabled: false
|
enabled: false
|
||||||
name: ""
|
#name:
|
||||||
securityProtocol: ""
|
#securityProtocol:
|
||||||
host: ""
|
#host:
|
||||||
port: ""
|
#port:
|
||||||
userSearchBase: ""
|
#userSearchBase:
|
||||||
userFilter: ""
|
#userFilter:
|
||||||
adminFilter: ""
|
#adminFilter:
|
||||||
emailAttribute: ""
|
#emailAttribute:
|
||||||
bindDn: ""
|
#bindDn:
|
||||||
bindPassword: ""
|
#bindPassword:
|
||||||
usernameAttribute: ""
|
#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
|
||||||
#
|
#
|
||||||
@ -106,11 +173,59 @@ gitea:
|
|||||||
enabled: true
|
enabled: true
|
||||||
mysql:
|
mysql:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
mariadb:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
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
|
||||||
|
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
|
||||||
@ -136,3 +251,15 @@ mysql:
|
|||||||
port: 3306
|
port: 3306
|
||||||
persistence:
|
persistence:
|
||||||
size: 10Gi
|
size: 10Gi
|
||||||
|
|
||||||
|
mariadb:
|
||||||
|
auth:
|
||||||
|
database: gitea
|
||||||
|
username: gitea
|
||||||
|
password: gitea
|
||||||
|
rootPassword: gitea
|
||||||
|
primary:
|
||||||
|
service:
|
||||||
|
port: 3306
|
||||||
|
persistence:
|
||||||
|
size: 10Gi
|
||||||
|
Reference in New Issue
Block a user