From af0403d330048c75a56eff86ad4dc775d211f18c Mon Sep 17 00:00:00 2001 From: 0xWheatyz Date: Wed, 4 Mar 2026 01:47:12 +0000 Subject: [PATCH] feat(apps): add Gitea Git service with container registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deploy Gitea 1.22 with integrated container registry and CI/CD runner. Features: - Git repository hosting - Container registry on port 5000 - Gitea Act Runner for CI/CD (GitHub Actions compatible) - LoadBalancer service at 10.0.1.10 (HTTP:80, SSH:22) - NFS-backed persistent storage (50Gi data, 5Gi config) - Automatic failover across control plane nodes Access: - Web UI: http://10.0.1.10 - SSH: ssh://10.0.1.10:22 - Registry: 10.0.1.10:5000 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../first-cluster/apps/gitea/configmap.yaml | 42 ++++++++++ .../first-cluster/apps/gitea/deployment.yaml | 70 +++++++++++++++++ .../apps/gitea/kustomization.yaml | 11 +++ .../first-cluster/apps/gitea/namespace.yaml | 8 ++ testing1/first-cluster/apps/gitea/pvc.yaml | 25 ++++++ .../apps/gitea/runner-deployment.yaml | 76 +++++++++++++++++++ .../apps/gitea/runner-secret.yaml | 8 ++ .../first-cluster/apps/gitea/service.yaml | 19 +++++ 8 files changed, 259 insertions(+) create mode 100644 testing1/first-cluster/apps/gitea/configmap.yaml create mode 100644 testing1/first-cluster/apps/gitea/deployment.yaml create mode 100644 testing1/first-cluster/apps/gitea/kustomization.yaml create mode 100644 testing1/first-cluster/apps/gitea/namespace.yaml create mode 100644 testing1/first-cluster/apps/gitea/pvc.yaml create mode 100644 testing1/first-cluster/apps/gitea/runner-deployment.yaml create mode 100644 testing1/first-cluster/apps/gitea/runner-secret.yaml create mode 100644 testing1/first-cluster/apps/gitea/service.yaml diff --git a/testing1/first-cluster/apps/gitea/configmap.yaml b/testing1/first-cluster/apps/gitea/configmap.yaml new file mode 100644 index 0000000..c52ed7d --- /dev/null +++ b/testing1/first-cluster/apps/gitea/configmap.yaml @@ -0,0 +1,42 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: gitea-config + namespace: gitea +data: + app.ini: | + APP_NAME = Gitea: Git with a cup of tea + RUN_MODE = prod + RUN_USER = git + + [database] + DB_TYPE = sqlite3 + PATH = /data/gitea/gitea.db + + [repository] + ROOT = /data/git/repositories + + [server] + DOMAIN = localhost + SSH_DOMAIN = localhost + HTTP_PORT = 3000 + ROOT_URL = http://localhost:30300/ + DISABLE_SSH = false + SSH_PORT = 22 + SSH_LISTEN_PORT = 22 + LFS_START_SERVER = true + + [lfs] + PATH = /data/git/lfs + + [packages] + ENABLED = true + + [actions] + ENABLED = true + + [service] + DISABLE_REGISTRATION = false + + [security] + INSTALL_LOCK = false diff --git a/testing1/first-cluster/apps/gitea/deployment.yaml b/testing1/first-cluster/apps/gitea/deployment.yaml new file mode 100644 index 0000000..ef1705b --- /dev/null +++ b/testing1/first-cluster/apps/gitea/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gitea + namespace: gitea + labels: + app: gitea +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: gitea + template: + metadata: + labels: + app: gitea + spec: + containers: + - name: gitea + image: gitea/gitea:1.22.6 + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 3000 + protocol: TCP + - name: ssh + containerPort: 22 + protocol: TCP + volumeMounts: + - name: gitea-data + mountPath: /data + - name: gitea-config + mountPath: /etc/gitea + env: + - name: USER_UID + value: "1000" + - name: USER_GID + value: "1000" + resources: + requests: + cpu: "500m" + memory: "512Mi" + limits: + cpu: "1000m" + memory: "1Gi" + livenessProbe: + httpGet: + path: /api/healthz + port: 3000 + initialDelaySeconds: 200 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 10 + readinessProbe: + httpGet: + path: /api/healthz + port: 3000 + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + volumes: + - name: gitea-data + persistentVolumeClaim: + claimName: gitea-data + - name: gitea-config + persistentVolumeClaim: + claimName: gitea-config diff --git a/testing1/first-cluster/apps/gitea/kustomization.yaml b/testing1/first-cluster/apps/gitea/kustomization.yaml new file mode 100644 index 0000000..a3fd072 --- /dev/null +++ b/testing1/first-cluster/apps/gitea/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - namespace.yaml + - pvc.yaml + - configmap.yaml + - deployment.yaml + - service.yaml + - runner-secret.yaml + - runner-deployment.yaml diff --git a/testing1/first-cluster/apps/gitea/namespace.yaml b/testing1/first-cluster/apps/gitea/namespace.yaml new file mode 100644 index 0000000..4599df5 --- /dev/null +++ b/testing1/first-cluster/apps/gitea/namespace.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: gitea + labels: + pod-security.kubernetes.io/enforce: privileged + pod-security.kubernetes.io/audit: privileged + pod-security.kubernetes.io/warn: privileged diff --git a/testing1/first-cluster/apps/gitea/pvc.yaml b/testing1/first-cluster/apps/gitea/pvc.yaml new file mode 100644 index 0000000..ad18100 --- /dev/null +++ b/testing1/first-cluster/apps/gitea/pvc.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: gitea-data + namespace: gitea +spec: + storageClassName: nfs-client + accessModes: + - ReadWriteMany + resources: + requests: + storage: 50Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: gitea-config + namespace: gitea +spec: + storageClassName: nfs-client + accessModes: + - ReadWriteMany + resources: + requests: + storage: 5Gi diff --git a/testing1/first-cluster/apps/gitea/runner-deployment.yaml b/testing1/first-cluster/apps/gitea/runner-deployment.yaml new file mode 100644 index 0000000..484036f --- /dev/null +++ b/testing1/first-cluster/apps/gitea/runner-deployment.yaml @@ -0,0 +1,76 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gitea-runner + namespace: gitea + labels: + app: gitea-runner +spec: + replicas: 1 + selector: + matchLabels: + app: gitea-runner + template: + metadata: + labels: + app: gitea-runner + spec: + restartPolicy: Always + volumes: + - name: docker-certs + emptyDir: {} + - name: runner-data + emptyDir: {} + containers: + - name: runner + image: gitea/act_runner:latest + imagePullPolicy: IfNotPresent + command: ["sh", "-c", "while ! nc -z localhost 2376