Self-Hosted Version Control with Gitea
In this post we will be deploying and configuring Gitea, which is an open source version control system.
Prepare Deployment using ArgoCD
We will be deploying Gitea with the following configuration:
- Path in the gitops repo:
apps/gitea/
- Namespace:
gitea
- Ingress:
git.int.sektorlab.xyz
- Persistence:
local-path
- Database:
postgresql
First we need to get the chart details from artifacthub: - https://artifacthub.io/packages/helm/gitea/gitea/10.1.4
At the time of writing the latest version of the chart is 10.1.4
, so first we need to define our Chart.yaml
inside our gitea directory within our gitops repository, at apps/gitea/Chart.yaml
:
apiVersion: v2
name: gitea
description: Gitea helm chart
type: application
version: 10.1.4
dependencies:
- name: gitea
version: 10.1.4
repository: https://dl.gitea.io/charts
The next part is to configure the values.yaml
inside our directory at apps/gitea/values.yaml
:
gitea:
replicaCount: 1
global:
storageClass: "local-path"
replicaCount: 1
service:
http:
type: ClusterIP
port: 3000
ssh:
type: LoadBalancer
port: 22
annotations:
metallb.universe.tf/allow-shared-ip: nginx
metallb.universe.tf/loadBalancerIPs: 10.8.0.115
ingress:
enabled: true
className: nginx
hosts:
- host: git.int.sektorlab.xyz
paths:
- path: /
pathType: Prefix
apiVersion: networking.k8s.io/v1
persistence:
enabled: true
create: true
mount: true
size: 10Gi
accessModes:
- ReadWriteOnce
storageClass: local-path
annotations:
helm.sh/resource-policy: keep
gitea:
admin:
# existingSecret: gitea-admin-secret
existingSecret:
username: gitea_admin
password: gitea_admin
email: "gitea@local.domain"
config:
server:
SSH_PORT: 22
SSH_LISTEN_PORT: 2222
DOMAIN: git.int.sektorlab.xyz
ROOT_URL: https://git.int.sektorlab.xyz
SSH_DOMAIN: git.int.sektorlab.xyz
redis-cluster:
enabled: true
usePassword: false
cluster:
nodes: 3
replicas: 0
postgresql-ha:
enabled: true
global:
postgresql:
database: gitea
password: gitea
username: gitea
primary:
persistence:
size: 10Gi
Once we have our values defined, we need to download and package our dependencies, so first go to the directory:
Then run a dependency update with helm:
And push the changes up to the remote branch for our gitops repository so that argocd can deploy.
Deploying with Helm
If you are using helm to deploy the changes, you can add the repository:
Then save the mentioned values as values.yaml
but just remove the top gitea:
key and indent everything one step to the left and deploy using:
Verify
Verify that gitea has been deployed, which can be done using kubectl:
Access
Then we can view our ingress using:
And then we can access gitea using the username/password that we have set in the values.