Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
4ad5cf1d19 | |||
7f828e87f6 | |||
57479bdf37 | |||
0c8f226f1f | |||
daba777e24 | |||
54cc78b43a |
@ -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.1
|
||||||
icon: https://docs.gitea.io/images/gitea.png
|
icon: https://docs.gitea.io/images/gitea.png
|
||||||
|
|
||||||
keywords:
|
keywords:
|
||||||
|
45
README.md
45
README.md
@ -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
|
||||||
@ -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:
|
||||||
@ -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:
|
||||||
@ -277,6 +289,24 @@ kebab-case:
|
|||||||
username-attribute: CN
|
username-attribute: CN
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 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:
|
||||||
|
PPROF_ENABLED: true
|
||||||
|
```
|
||||||
|
|
||||||
### Pod Annotations
|
### Pod Annotations
|
||||||
|
|
||||||
Annotations can be added to the Gitea pod.
|
Annotations can be added to the Gitea pod.
|
||||||
@ -290,17 +320,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 | |
|
||||||
|
|
||||||
### 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.1 |
|
||||||
|image.pullPolicy| Image pull policy | Always |
|
|image.pullPolicy| Image pull policy | Always |
|
||||||
|
|
||||||
### Persistence
|
### Persistence
|
||||||
@ -312,6 +345,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
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ 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 -}}
|
||||||
|
@ -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 "PPROF_ENABLED") -}}
|
||||||
|
{{- $_ := set .Values.gitea.config.server "PPROF_ENABLED" 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,6 +8,14 @@ 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
|
||||||
@ -32,4 +40,4 @@ stringData:
|
|||||||
{{- include "gitea.ldap_settings" . | nindent 6 }} \
|
{{- include "gitea.ldap_settings" . | nindent 6 }} \
|
||||||
) \
|
) \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
'
|
'
|
||||||
|
14
templates/gitea/servicemonitor.yaml
Normal file
14
templates/gitea/servicemonitor.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{{- if .Values.gitea.metrics.serviceMonitor.enabled -}}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: {{ include "gitea.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
||||||
|
endpoints:
|
||||||
|
- port: http
|
||||||
|
{{- end -}}
|
@ -14,6 +14,7 @@ spec:
|
|||||||
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 }}
|
||||||
{{- with .Values.gitea.podAnnotations }}
|
{{- with .Values.gitea.podAnnotations }}
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@ -30,6 +31,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 +43,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,6 +66,10 @@ 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.PPROF_ENABLED }}
|
||||||
|
- name: profiler
|
||||||
|
containerPort: 6060
|
||||||
|
{{- end }}
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
tcpSocket:
|
tcpSocket:
|
||||||
port: http
|
port: http
|
||||||
@ -77,6 +90,9 @@ spec:
|
|||||||
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 +113,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 +127,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 }}
|
||||||
|
41
values.yaml
41
values.yaml
@ -8,7 +8,7 @@ clusterDomain: cluster.local
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: gitea/gitea
|
repository: gitea/gitea
|
||||||
tag: 1.13.0
|
tag: 1.13.1
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
@ -69,10 +69,37 @@ statefulset:
|
|||||||
|
|
||||||
persistence:
|
persistence:
|
||||||
enabled: true
|
enabled: true
|
||||||
# existingClaim:
|
# existingClaim:
|
||||||
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 +107,11 @@ gitea:
|
|||||||
password: r8sA8CPHD9!bt6d
|
password: r8sA8CPHD9!bt6d
|
||||||
email: "gitea@local.domain"
|
email: "gitea@local.domain"
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
enabled: false
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
ldap:
|
ldap:
|
||||||
enabled: false
|
enabled: false
|
||||||
#name:
|
#name:
|
||||||
@ -93,11 +125,12 @@ gitea:
|
|||||||
#bindDn:
|
#bindDn:
|
||||||
#bindPassword:
|
#bindPassword:
|
||||||
#usernameAttribute:
|
#usernameAttribute:
|
||||||
|
#sshPublicKeyAttribute:
|
||||||
|
|
||||||
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
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user