Gitea installation on k3s
Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket, and GitLab.
Project page: https://gitea.io
Requirements
- k3s cluster
- kubectl
- helm
- Longhorn installed on cluster
Installation
Create a namespace for gitea and related stuff
Install postgres
- The password for the postgres user is specified by the
POSTGRESS_PASSWORD
environment variable, which uses a secret (postgres/secret.yaml) - The data volume uses a
PersistentVolumeClaim
backed by Longhorn, so that it doesn't get deleted when the pod is restarted (postgres/statefulset.yaml) - Database is created by using initialization scripts in a ConfigMap. (postgres/configmap.yaml)
- The postgres instance needs to be exposed to the Gitea instance; use a ClusterIP service for that (postgres/service.yaml)
Install Gitea using Helm
Expose Gitea installation
The DNS record pointing to cluster IP should be created, the host should be set to ingress.yaml (spec.rules.host)
Expose http UI using Ingress service: