Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
c742b5dbc3 | |||
ec8a26ecfc | |||
8d8dd0d84e | |||
0f1e991889 | |||
1eb0eee3bc | |||
9106d68cdc | |||
551f4e312e | |||
d1c58a2e77 | |||
9213f0d1f5 | |||
7ed82c7a63 | |||
33903d8f6c | |||
4682597b04 | |||
790d0405c2 | |||
28e94f96e3 | |||
b5ab7201d1 | |||
4ad5cf1d19 | |||
7f828e87f6 | |||
57479bdf37 | |||
0c8f226f1f | |||
daba777e24 | |||
54cc78b43a |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
charts
|
charts
|
||||||
Chart.lock
|
Chart.lock
|
||||||
|
.DS_Store
|
||||||
|
@ -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.0
|
appVersion: 1.13.7
|
||||||
icon: https://docs.gitea.io/images/gitea.png
|
icon: https://docs.gitea.io/images/gitea.png
|
||||||
|
|
||||||
keywords:
|
keywords:
|
||||||
|
129
README.md
129
README.md
@ -5,12 +5,12 @@
|
|||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
This helm chart has taken some inspiration from <https://github.com/jfelten/gitea-helm-chart>
|
This helm chart has taken some inspiration from <https://github.com/jfelten/gitea-helm-chart>
|
||||||
But takes a completly different approach in providing database and cache with dependencies.
|
But takes a completely different approach in providing a database and cache with dependencies.
|
||||||
Also this chart provides LDAP and admin user configuration with values as well as it is deployed as statefulset to retain stored repositories.
|
Additionally, this chart provides LDAP and admin user configuration with values, as well as being deployed as a statefulset to retain stored repositories.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
Gitea can be run with external database and cache. This chart provides those dependencies, which can be
|
Gitea can be run with an external database and cache. This chart provides those dependencies, which can be
|
||||||
enabled, or disabled via [configuration](#configuration).
|
enabled, or disabled via [configuration](#configuration).
|
||||||
|
|
||||||
Dependencies:
|
Dependencies:
|
||||||
@ -36,7 +36,7 @@ Dependencies:
|
|||||||
|
|
||||||
### Gitea Configuration
|
### Gitea Configuration
|
||||||
|
|
||||||
Gitea offers lots of configuration. This is fully described in the [Gitea Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/).
|
Gitea offers lots of configuration options. This is fully described in the [Gitea Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/).
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
gitea:
|
gitea:
|
||||||
@ -58,7 +58,7 @@ INSTALL_LOCK is always set to true, since we want to configure gitea with this h
|
|||||||
|
|
||||||
#### Database defaults
|
#### Database defaults
|
||||||
|
|
||||||
If a builtIn database is enabled the database configuration is set automatically. For example postgresql builtIn which will appear in the app.ini as:
|
If a builtIn database is enabled the database configuration is set automatically. For example, postgresql builtIn will appear in the app.ini as:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[database]
|
[database]
|
||||||
@ -71,7 +71,7 @@ USER = gitea
|
|||||||
|
|
||||||
#### Memcached defaults
|
#### Memcached defaults
|
||||||
|
|
||||||
Memcached is handled the exakt same way as database builtIn. Once memcached builtIn is enabled, this chart will generate the following part in the app.ini:
|
Memcached is handled the exact same way as database builtIn. Once memcached builtIn is enabled, this chart will generate the following part in the app.ini:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[cache]
|
[cache]
|
||||||
@ -95,6 +95,16 @@ ROOT_URL = http://git.example.com
|
|||||||
SSH_DOMAIN = git.example.com
|
SSH_DOMAIN = git.example.com
|
||||||
SSH_LISTEN_PORT = 22
|
SSH_LISTEN_PORT = 22
|
||||||
SSH_PORT = 22
|
SSH_PORT = 22
|
||||||
|
ENABLE_PPROF = false
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Metrics defaults
|
||||||
|
|
||||||
|
The Prometheus `/metrics` endpoint is disabled by default.
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[metrics]
|
||||||
|
ENABLED = false
|
||||||
```
|
```
|
||||||
|
|
||||||
### External Database
|
### External Database
|
||||||
@ -186,8 +196,8 @@ If the built in cache should not be used simply configure the cache in gitea.con
|
|||||||
### Persistence
|
### Persistence
|
||||||
|
|
||||||
Gitea will be deployed as a statefulset. By simply enabling the persistence and setting the storage class according to your cluster
|
Gitea will be deployed as a statefulset. By simply enabling the persistence and setting the storage class according to your cluster
|
||||||
everything else will be taken care of. The following example will create a PVC as a part of the statefulset. This PVC will not be deleted
|
everything else will be taken care of. The following example will create a PVC as a part of the statefulset. This PVC will not be deleted even if you uninstall the chart.
|
||||||
even if you uninstall the chart.
|
|
||||||
When using Postgresql as dependency, this will also be deployed as a statefulset by default.
|
When using Postgresql as dependency, this will also be deployed as a statefulset by default.
|
||||||
|
|
||||||
If you want to manage your own PVC you can simply pass the PVC name to the chart.
|
If you want to manage your own PVC you can simply pass the PVC name to the chart.
|
||||||
@ -224,6 +234,7 @@ You can interact with the postgres settings as displayed in the following exampl
|
|||||||
|
|
||||||
This chart enables you to create a default admin user. It is also possible to update the password for this user by upgrading or redeloying the chart.
|
This chart enables you to create a default admin user. It is also possible to update the password for this user by upgrading or redeloying the chart.
|
||||||
It is not possible to delete an admin user after it has been created. This has to be done in the ui.
|
It is not possible to delete an admin user after it has been created. This has to be done in the ui.
|
||||||
|
You cannot use `admin` as username.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
gitea:
|
gitea:
|
||||||
@ -235,7 +246,7 @@ It is not possible to delete an admin user after it has been created. This has t
|
|||||||
|
|
||||||
### LDAP Settings
|
### LDAP Settings
|
||||||
|
|
||||||
Like the admin user the LDAP settings can be updated but also disabled or deleted.
|
Like the admin user the LDAP settings can be updated, but also disabled or deleted.
|
||||||
All LDAP values from <https://docs.gitea.io/en-us/command-line/#admin> are available.
|
All LDAP values from <https://docs.gitea.io/en-us/command-line/#admin> are available.
|
||||||
You can either use them in camel case or kebab case.
|
You can either use them in camel case or kebab case.
|
||||||
|
|
||||||
@ -256,6 +267,7 @@ camelCase:
|
|||||||
bindDn: CN=ldap read,OU=Spezial,DC=example,DC=com
|
bindDn: CN=ldap read,OU=Spezial,DC=example,DC=com
|
||||||
bindPassword: JustAnotherBindPw
|
bindPassword: JustAnotherBindPw
|
||||||
usernameAttribute: CN
|
usernameAttribute: CN
|
||||||
|
sshPublicKeyAttribute: sshPublicKey
|
||||||
```
|
```
|
||||||
|
|
||||||
kebab-case:
|
kebab-case:
|
||||||
@ -276,6 +288,65 @@ kebab-case:
|
|||||||
bind-password: JustAnotherBindPw
|
bind-password: JustAnotherBindPw
|
||||||
username-attribute: CN
|
username-attribute: CN
|
||||||
```
|
```
|
||||||
|
### OAuth2 Settings
|
||||||
|
|
||||||
|
Like the admin user the OAuth2 settings can be updated but also disabled or deleted.
|
||||||
|
All OAuth2 values from <https://docs.gitea.io/en-us/command-line/#admin> are available.
|
||||||
|
You can either use them in camel case or kebab case.
|
||||||
|
|
||||||
|
camelCase:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
oauth:
|
||||||
|
enabled: true
|
||||||
|
name: 'MyAwesomeGiteaOAuth'
|
||||||
|
provider: 'openidConnect'
|
||||||
|
key: 'hello'
|
||||||
|
secret: 'world'
|
||||||
|
autoDiscoverUrl: 'https://gitea.example.com/.well-known/openid-configuration'
|
||||||
|
#useCustomUrls:
|
||||||
|
#customAuthUrl:
|
||||||
|
#customTokenUrl:
|
||||||
|
#customProfileUrl:
|
||||||
|
#customEmailUrl:
|
||||||
|
```
|
||||||
|
|
||||||
|
kebab-case:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
oauth:
|
||||||
|
enabled: true
|
||||||
|
name: 'MyAwesomeGiteaOAuth'
|
||||||
|
provider: 'openidConnect'
|
||||||
|
key: 'hello'
|
||||||
|
secret: 'world'
|
||||||
|
auto-discover-url: 'https://gitea.example.com/.well-known/openid-configuration'
|
||||||
|
#use-custom-urls:
|
||||||
|
#custom-auth-url:
|
||||||
|
#custom-token-url:
|
||||||
|
#custom-profile-url:
|
||||||
|
#custom-email-url:
|
||||||
|
```
|
||||||
|
|
||||||
|
### Metrics and profiling
|
||||||
|
|
||||||
|
A Prometheus `/metrics` endpoint on the `HTTP_PORT` and `pprof` profiling endpoints on port 6060 can be enabled under `gitea`. Beware that the metrics endpoint is exposed via the ingress, manage access using ingress annotations for example.
|
||||||
|
|
||||||
|
To deploy the `ServiceMonitor`, you first need to ensure that you have deployed `prometheus-operator` and its CRDs: https://github.com/prometheus-operator/prometheus-operator#customresourcedefinitions.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
gitea:
|
||||||
|
metrics:
|
||||||
|
enabled: true
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
config:
|
||||||
|
server:
|
||||||
|
ENABLE_PPROF: true
|
||||||
|
```
|
||||||
|
|
||||||
### Pod Annotations
|
### Pod Annotations
|
||||||
|
|
||||||
@ -291,16 +362,20 @@ Annotations can be added to the Gitea pod.
|
|||||||
### Others
|
### Others
|
||||||
|
|
||||||
| Parameter | Description | Default |
|
| Parameter | Description | Default |
|
||||||
|---------------------|-----------------------------------|------------------------------|
|
|-------------------------------------------|--------------------------------------------------------|-------------|
|
||||||
| statefulset.terminationGracePeriodSeconds | Image to start for this pod | gitea/gitea |
|
| statefulset.terminationGracePeriodSeconds | Image to start for this pod | gitea/gitea |
|
||||||
| statefulset.env | Additional environment variables to pass to containers | [] |
|
| statefulset.env | Additional environment variables to pass to containers | [] |
|
||||||
|
| extraVolumes | Additional volumes to mount to the Gitea statefulset | {} |
|
||||||
|
| extraVolumeMounts | Additional volumes mounts for the Gitea containers | {} |
|
||||||
|
| initPreScript | Bash script copied verbatim to start of init container | |
|
||||||
|
| securityContext | Run as a specific securityContext | {} |
|
||||||
|
|
||||||
### Image
|
### Image
|
||||||
|
|
||||||
| Parameter | Description | Default |
|
| Parameter | Description | Default |
|
||||||
|---------------------|-----------------------------------|------------------------------|
|
|---------------------|-----------------------------------|------------------------------|
|
||||||
|image.repository| Image to start for this pod | gitea/gitea |
|
|image.repository| Image to start for this pod | gitea/gitea |
|
||||||
|image.tag| [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated) | 1.13.0 |
|
|image.tag| [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated) | 1.13.7 |
|
||||||
|image.pullPolicy| Image pull policy | Always |
|
|image.pullPolicy| Image pull policy | Always |
|
||||||
|
|
||||||
### Persistence
|
### Persistence
|
||||||
@ -312,6 +387,8 @@ Annotations can be added to the Gitea pod.
|
|||||||
|persistence.size| Size for persistence to store repo information | 10Gi |
|
|persistence.size| Size for persistence to store repo information | 10Gi |
|
||||||
|persistence.accessModes|AccessMode for persistence||
|
|persistence.accessModes|AccessMode for persistence||
|
||||||
|persistence.storageClass|Storage class for repository persistence||
|
|persistence.storageClass|Storage class for repository persistence||
|
||||||
|
|persistence.labels|Labels for the persistence volume claim to be created|{}|
|
||||||
|
|persistence.annotations|Annotations for the persistence volume claim to be created|{}|
|
||||||
|
|
||||||
### Ingress
|
### Ingress
|
||||||
|
|
||||||
@ -340,6 +417,34 @@ Annotations can be added to the Gitea pod.
|
|||||||
|---------------------|-----------------------------------|------------------------------|
|
|---------------------|-----------------------------------|------------------------------|
|
||||||
|gitea.config | Everything in app.ini can be configured with this dict. See Examples for more details | {} |
|
|gitea.config | Everything in app.ini can be configured with this dict. See Examples for more details | {} |
|
||||||
|
|
||||||
|
### Gitea Probes
|
||||||
|
|
||||||
|
Configure Liveness, Readiness and Startup [Probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
|
||||||
|
|
||||||
|
| Parameter | Description | Default |
|
||||||
|
|---------------------|-----------------------------------|------------------------------|
|
||||||
|
|gitea.livenessProbe.enabled | Enable liveness probe | true |
|
||||||
|
|gitea.livenessProbe.initialDelaySeconds | Delay before probe start| 200 |
|
||||||
|
|gitea.livenessProbe.timeoutSeconds | probe timeout | 1 |
|
||||||
|
|gitea.livenessProbe.periodSeconds | period between probes | 10 |
|
||||||
|
|gitea.livenessProbe.successThreshold | Minimum consecutive success probes | 1 |
|
||||||
|
|gitea.livenessProbe.failureThreshold | Minimum consecutive error probes | 10 |
|
||||||
|
|gitea.readinessProbe.enabled | Enable readiness probe | true |
|
||||||
|
|gitea.readinessProbe.initialDelaySeconds | Delay before probe start| 200 |
|
||||||
|
|gitea.readinessProbe.timeoutSeconds | probe timeout | 1 |
|
||||||
|
|gitea.readinessProbe.periodSeconds | period between probes | 10 |
|
||||||
|
|gitea.readinessProbe.successThreshold | Minimum consecutive success probes | 1 |
|
||||||
|
|gitea.readinessProbe.failureThreshold | Minimum consecutive error probes | 10 |
|
||||||
|
|gitea.startupProbe.enabled | Enable startup probe | false |
|
||||||
|
|gitea.startupProbe.initialDelaySeconds | Delay before probe start| 200 |
|
||||||
|
|gitea.startupProbe.timeoutSeconds | probe timeout | 1 |
|
||||||
|
|gitea.startupProbe.periodSeconds | period between probes | 10 |
|
||||||
|
|gitea.startupProbe.successThreshold | Minimum consecutive success probes | 1 |
|
||||||
|
|gitea.startupProbe.failureThreshold | Minimum consecutive error probes | 10 |
|
||||||
|
|gitea.customLivenessProbe | Custom liveness probe (needs `gitea.livenessProbe.enabled: false`) | |
|
||||||
|
|gitea.customReadinessProbe | Custom readiness probe (needs `gitea.readinessProbe.enabled: false`) | |
|
||||||
|
|gitea.customStartupProbe | Custom startup probe (needs `gitea.startupProbe.enabled: false`) | |
|
||||||
|
|
||||||
### Memcached BuiltIn
|
### Memcached BuiltIn
|
||||||
|
|
||||||
Memcached is loaded as a dependency from [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/memcached) if enabled in the values. Complete Configuration can be taken from their website.
|
Memcached is loaded as a dependency from [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/memcached) if enabled in the values. Complete Configuration can be taken from their website.
|
||||||
@ -367,7 +472,7 @@ The following parameters are the defaults set by this chart
|
|||||||
|
|
||||||
### Postgresql BuiltIn
|
### Postgresql BuiltIn
|
||||||
|
|
||||||
Postgresql is loaded as a dependency from bitnami. Configuration can be found from this [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/postgresql)
|
Postgresql is loaded as a dependency from Bitnami. The chart configuration can be found from this [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/postgresql) repository.
|
||||||
|
|
||||||
The following parameters are the defaults set by this chart
|
The following parameters are the defaults set by this chart
|
||||||
|
|
||||||
|
@ -36,9 +36,11 @@ 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 +60,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 -}}
|
||||||
@ -99,10 +101,18 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
|||||||
{{- range $key, $val := .Values.gitea.ldap -}}
|
{{- range $key, $val := .Values.gitea.ldap -}}
|
||||||
{{- if ne $key "enabled" -}}
|
{{- if ne $key "enabled" -}}
|
||||||
{{- if eq $key "port" -}}
|
{{- if eq $key "port" -}}
|
||||||
{{- printf "--%s %s " ($key | kebabcase) $val -}}
|
{{- printf "--%s %d " ($key | kebabcase) ($val | int) -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- printf "--%s %s " ($key | kebabcase) ($val | quote) -}}
|
{{- printf "--%s %s " ($key | kebabcase) ($val | quote) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- 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 -}}
|
||||||
@ -65,6 +69,14 @@ stringData:
|
|||||||
{{- 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 -}}
|
||||||
|
@ -8,19 +8,29 @@ 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 }}
|
||||||
|
|
||||||
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
|
||||||
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" . }}
|
||||||
nc -v -w2 -z {{ include "db.servicename" . }} {{ include "db.port" . }} && \
|
nc -v -w2 -z {{ include "db.servicename" . }} {{ include "db.port" . }} && \
|
||||||
|
{{- end }}
|
||||||
su git -c ' \
|
su git -c ' \
|
||||||
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 --must-change-password=false \
|
gitea admin create-user --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }} --email {{ .Values.gitea.admin.email }} --admin --must-change-password=false \
|
||||||
|| \
|
|| \
|
||||||
gitea admin change-password --username {{ .Values.gitea.admin.username }} --password '{{ .Values.gitea.admin.password }}'; \
|
gitea admin 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 \
|
||||||
@ -32,4 +42,14 @@ stringData:
|
|||||||
{{- include "gitea.ldap_settings" . | nindent 6 }} \
|
{{- include "gitea.ldap_settings" . | nindent 6 }} \
|
||||||
) \
|
) \
|
||||||
{{- 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 }}
|
||||||
'
|
'
|
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 -}}
|
@ -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,16 +9,24 @@ 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 }}
|
{{- with .Values.imagePullSecrets }}
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@ -30,6 +38,11 @@ spec:
|
|||||||
- name: init
|
- name: init
|
||||||
image: "{{ .Values.image.repository }}:{{ ternary .Values.image.version .Values.image.tag (hasKey .Values.image "version") }}"
|
image: "{{ .Values.image.repository }}:{{ ternary .Values.image.version .Values.image.tag (hasKey .Values.image "version") }}"
|
||||||
command: ["/usr/sbin/init_gitea.sh"]
|
command: ["/usr/sbin/init_gitea.sh"]
|
||||||
|
env:
|
||||||
|
{{- range .Values.statefulset.env }}
|
||||||
|
- name: {{ .name | quote | nospace }}
|
||||||
|
value: {{ .value | quote }}
|
||||||
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: init
|
- name: init
|
||||||
mountPath: /usr/sbin
|
mountPath: /usr/sbin
|
||||||
@ -37,6 +50,9 @@ 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 }}
|
||||||
@ -57,26 +73,59 @@ spec:
|
|||||||
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: 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,6 +146,9 @@ spec:
|
|||||||
- name: config
|
- name: config
|
||||||
secret:
|
secret:
|
||||||
secretName: {{ include "gitea.fullname" . }}
|
secretName: {{ include "gitea.fullname" . }}
|
||||||
|
{{- if .Values.extraVolumes }}
|
||||||
|
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
||||||
- name: data
|
- name: data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
@ -108,6 +160,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 }}
|
||||||
|
99
values.yaml
99
values.yaml
@ -8,11 +8,13 @@ clusterDomain: cluster.local
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: gitea/gitea
|
repository: gitea/gitea
|
||||||
tag: 1.13.0
|
tag: 1.13.7
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
securityContext: {}
|
||||||
|
|
||||||
service:
|
service:
|
||||||
http:
|
http:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
@ -29,6 +31,7 @@ service:
|
|||||||
#nodePort:
|
#nodePort:
|
||||||
#externalTrafficPolicy:
|
#externalTrafficPolicy:
|
||||||
#externalIPs:
|
#externalIPs:
|
||||||
|
loadBalancerSourceRanges: []
|
||||||
annotations:
|
annotations:
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
@ -66,6 +69,7 @@ statefulset:
|
|||||||
# - name: VARIABLE
|
# - name: VARIABLE
|
||||||
# value: my-value
|
# value: my-value
|
||||||
terminationGracePeriodSeconds: 60
|
terminationGracePeriodSeconds: 60
|
||||||
|
labels: {}
|
||||||
|
|
||||||
persistence:
|
persistence:
|
||||||
enabled: true
|
enabled: true
|
||||||
@ -73,6 +77,33 @@ persistence:
|
|||||||
size: 10Gi
|
size: 10Gi
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
|
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:
|
||||||
@ -80,6 +111,12 @@ 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:
|
||||||
@ -93,6 +130,20 @@ gitea:
|
|||||||
#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"
|
||||||
@ -119,6 +170,52 @@ 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
|
||||||
|
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