跳转到内容
免费试用 Gitea Cloud ☁️ 30 天,加速你的开发与部署!
技术支持
这是 22.6.1 的文档,已不是最新发布版本。查看最新发布版本

Install on Kubernetes

该版本的文档尚未翻译,以下内容为英文原文。

Deploy Gitea Enterprise to Kubernetes using the upstream Helm chart and container image.

  • Kubernetes 1.24+ cluster with persistent storage and ingress support.

  • Recommended hardware sized for your expected user base:

    Team size (approx.) Memory CPU cores SSD capacity
    ~10 users 2-4 GB 2-4 cores 50-100 GB
    ~100 users 4-8 GB 4-8 cores 200-500 GB
    ~1000 users 16-32 GB 8-16 cores 2-5 TB
  • kubectl configured for the target cluster.

  • Helm 3 installed locally.

  • Access to a container registry that can pull the commitgo/gitea-ee image if your cluster requires mirroring.

  • Git is bundled inside the Enterprise container image so no extra package install is necessary on the nodes.

  • (Optional) An Enterprise license to enable premium features. Use License Activation to request a trial and upload the license after deployment.

Terminal window
helm repo add gitea https://dl.gitea.io/charts/
helm repo update

The chart documented at gitea/charts supports Enterprise deployments out of the box.

Terminal window
kubectl create namespace gitea
kubectl -n gitea create secret generic gitea-admin \
--from-literal=username=admin \
--from-literal=password='replace-with-strong-password'

Save the configuration below as values-enterprise.yaml and adjust domains, storage classes, and database settings for your environment:

image:
repository: commitgo/gitea-ee
tag: 24.6.0
pullPolicy: IfNotPresent
service:
http:
type: ClusterIP
ssh:
type: ClusterIP
ingress:
enabled: true
className: nginx
hosts:
- host: gitea.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: gitea-tls
hosts:
- gitea.example.com
gitea:
admin:
existingSecret: gitea-admin
config:
server:
DOMAIN: gitea.example.com
ROOT_URL: https://gitea.example.com/
SSH_PORT: 3022
database:
DB_TYPE: postgres
HOST: gitea-postgresql.gitea.svc.cluster.local:5432
NAME: gitea
USER: gitea
PASSWD: gitea
persistence:
size: 20Gi
storageClass: standard
  • Update tag to the Enterprise release you plan to deploy.
  • Upload the Enterprise license manually after deployment (see License Activation).
  • Swap the database section for MySQL or PostgreSQL according to the chart reference.

If your cluster provides MySQL or MariaDB, replace the gitea.config.database section:

gitea:
config:
database:
DB_TYPE: mysql
HOST: mysql.internal:3306
NAME: gitea
USER: gitea
PASSWD: gitea-secret
SSL_MODE: disable

Add CA certificates or MySQL client configuration via additionalConfigSources when TLS or custom SSL modes are required.

Terminal window
helm upgrade --install gitea gitea/gitea \
--namespace gitea \
-f values-enterprise.yaml

Verify that the pods are running and the ingress is reachable:

Terminal window
kubectl -n gitea get pods
kubectl -n gitea get ingress
  • Sign in to https://gitea.example.com/ with the admin credentials stored in gitea-admin.
  • Complete License Activation.
  • Configure object storage, SMTP, and other integrations using the upstream Helm values.
  • Review the upstream Configuration Cheat Sheet for the full list of app.ini options and apply them via Helm values or additionalConfigSources.
  • Update the image.tag in your values file to the newer Enterprise version, then rerun the helm upgrade command.
  • Back up the persistent volume and database before applying upgrades.
  • Use helm diff upgrade (with the diff plugin) to preview manifest changes in CI/CD pipelines.
  • Monitor the pods with kubectl logs and standard Kubernetes observability tooling.
  • Plan high availability by scaling Redis, object storage, and load balancing components according to your Kubernetes topology and recovery objectives.

Gitea Enterprise follows the same chart structure across releases, so existing GitOps workflows only need the image override to adopt Enterprise features.