mirror of
https://gitea.com/gitea/helm-chart.git
synced 2024-07-04 23:34:12 +02:00
Add support for metrics and pprof (#100)
Adds support for toggling support for `pprof` and metrics: ```yaml gitea: pprofEnabled: true metrics: enabled: true serviceMonitor: enabled: true ``` Co-authored-by: josef <josef.nilsen@outlook.com> Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/100 Reviewed-by: luhahn <luhahn@noreply.gitea.io> Reviewed-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: JosefWN <josefwn@noreply.gitea.io> Co-committed-by: JosefWN <josefwn@noreply.gitea.io>
This commit is contained in:
parent
57479bdf37
commit
7f828e87f6
28
README.md
28
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
|
||||||
@ -278,6 +288,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.
|
||||||
|
@ -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 -}}
|
||||||
|
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 -}}
|
@ -66,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
|
||||||
|
@ -105,6 +105,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:
|
||||||
|
Loading…
Reference in New Issue
Block a user