gitops/scripts/setup-gitea.sh
2025-05-23 21:19:18 +08:00

84 lines
1.5 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

helm repo add gitea https://dl.gitea.com/charts
helm repo update
kubectl create ns gitea || true
cat > gitea-values.yaml <<EOF
gitea:
admin:
username: admin
password: 'xxxx'
email: "gitea@local.domain"
passwordMode: keepUpdated
# 关闭 cloud 风格的数据库和 Redis 集群
redis-cluster:
enabled: false
postgresql-ha:
enabled: false
# 启用单实例 Redis 和 PostgreSQL
redis:
enabled: true
architecture: standalone
global:
redis:
password: changeme
master:
count: 1
postgresql:
enabled: true
global:
postgresql:
auth:
username: gitea
password: gitea
database: gitea
service:
ports:
postgresql: 5432
primary:
persistence:
size: 5Gi
# 使用本地默认 StorageClass如 K3s 的 local-path
persistence:
enabled: true
storageClass: "" # "" 表示使用默认 storageClass
size: 10Gi
# 启用 NodePort适配无云 LoadBalancer 的集群
service:
http:
type: NodePort
nodePort: 31080
ssh:
type: NodePort
nodePort: 31022
# 可选:关闭 Ingress
ingress:
enabled: false
# 设置资源限制
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
# 设置 Gitea 管理员账户
gitea:
admin:
username: giteaadmin
password: changeme
email: gitea@example.com
passwordMode: keepUpdated
# 启用 Actions 功能
actions:
enabled: false
EOF
helm upgrade --install gitea ./gitea -n gitea -f gitea-values.yaml