File tree Expand file tree Collapse file tree 1 file changed +82
-0
lines changed
docs/content/doc/installation Expand file tree Collapse file tree 1 file changed +82
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ date : " 2020-03-19T19:27:00+02:00"
3+ title : " 在 Kubernetes 安装 Gitea"
4+ slug : " install-on-kubernetes"
5+ weight : 10
6+ toc : false
7+ draft : false
8+ menu :
9+ sidebar :
10+ parent : " installation"
11+ name : " Kubernetes"
12+ weight : 50
13+ identifier : " install-on-kubernetes"
14+ ---
15+
16+ # 使用 Helm 在 Kubernetes 云原生环境中安装 Gitea
17+
18+ Gitea 已经提供了便于在 Kubernetes 云原生环境中安装所需的 Helm Chart
19+
20+ 默认安装指令为:
21+
22+ ``` bash
23+ helm repo add gitea https://dl.gitea.io/charts
24+ helm repo update
25+ helm install gitea gitea/gitea
26+ ```
27+
28+ 如果采用默认安装指令,Helm 会部署单实例的 Gitea, PostgreSQL, Memcached。若您想实现自定义安装(包括配置 Gitea 集群、NGINX Ingress、MySQL、MariaDB、持久存储等),请前往阅读:[ Gitea Helm Chart] ( https://gitea.com/gitea/helm-chart/ )
29+
30+ 您也可以通过 ` helm show ` 命令导出 ` README.md ` 和配置文件 ` values.yaml ` 进行学习和编辑,例如:
31+
32+ ``` bash
33+ helm show values gitea > values.yaml
34+ helm show readme gitea > README.md
35+
36+ # 使用自定义的配置文件 values.yaml
37+ helm install gitea -f values.yaml gitea/gitea
38+ ```
39+
40+ ## 运行状况检查接口
41+
42+ Gitea 附带了一个运行状况检查接口 ` /api/healthz ` ,你可以像这样在 Kubernetes 中配置它:
43+
44+ ``` yaml
45+ livenessProbe :
46+ httpGet :
47+ path : /api/healthz
48+ port : http
49+ initialDelaySeconds : 200
50+ timeoutSeconds : 5
51+ periodSeconds : 10
52+ successThreshold : 1
53+ failureThreshold : 10
54+ ` ` `
55+
56+ 成功的运行状况检查响应代码为 HTTP ` 200`,下面是示例:
57+
58+ ```
59+ HTTP/1.1 200 OK
60+
61+
62+ {
63+ "status": "pass",
64+ "description": "Gitea: Git with a cup of tea",
65+ "checks": {
66+ "cache: ping ": [
67+ {
68+ "status": "pass",
69+ "time": "2022-02-19T09:16:08Z"
70+ }
71+ ] ,
72+ "database: ping ": [
73+ {
74+ "status": "pass",
75+ "time": "2022-02-19T09:16:08Z"
76+ }
77+ ]
78+ }
79+ }
80+ ```
81+
82+ 有关更多信息,请参考 Kubernetes 文档 [配置存活、就绪和启动探测器](https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
You can’t perform that action at this time.
0 commit comments