// docs / Development / Gitea

Gitea

Gitea serves as my self-hosted Git server. It handles source/version control for all apps, tools, and infrastructure configs that represent the homelab.

I chose Gitea because its fast, easy to manage, and super lightweight. The webhooks allow it to easily integrates cleanly into a GitOps workflow. All repos including IaC and cluster manifests live here.

Install Gitea


kubectl apply -f gitea/deployments/local/

###############################
# Namespace for Gitea
###############################
---
apiVersion: v1
kind: Namespace
metadata:
  name: gitea-local

###############################
# Deployment for Gitea
###############################
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gitea-local
  namespace: gitea-local
  labels:
    app: gitea-local
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gitea-local
  template:
    metadata:
      labels:
        app: gitea-local
    spec:
      containers:
      - name: gitea-local
        image: gitea/gitea:1.21.7
        ports:
        - containerPort: 3000
          name: gitea-http
        - containerPort: 22
          name: git-ssh
        volumeMounts:
        - mountPath: /data
          name: gitea-data
      volumes:
      - name: gitea-data
        persistentVolumeClaim:
          claimName: gitea-local-pv-claim

###############################
# PVC for Gitea
###############################
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: gitea-local-pv-claim
  namespace: gitea-local
spec:
  storageClassName: longhorn
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 3Gi

###############################
# Service for Gitea
###############################
---
apiVersion: v1
kind: Service
metadata:
  name: gitea-local-service
  namespace: gitea-local
spec:
  selector:
    app: gitea-local
  type: LoadBalancer
  ports:
  - name: gitea-http
    port: 80
    protocol: TCP
    targetPort: 3000
  - name: gitea-ssh
    port: 22
  loadBalancerIP: 192.168.56.112

As part of the configuration - create a user for drone later as well as your own user(s).