From 24db0e97f69f0b5a610e4a8a899d2f24f9476316 Mon Sep 17 00:00:00 2001 From: Celes Renata Date: Tue, 28 Apr 2026 14:29:58 +0000 Subject: [PATCH] feat: add Gitea NFS PV, declarative deployment, and wire into runmefirst.sh --- pipelines/gitea/deployment.yaml | 66 +++++++++++++++++++++++++++++++++ pipelines/pvs/gitea-pv.yaml | 19 ++++++++++ pipelines/runmefirst.sh | 11 ++++++ 3 files changed, 96 insertions(+) create mode 100644 pipelines/gitea/deployment.yaml create mode 100644 pipelines/pvs/gitea-pv.yaml diff --git a/pipelines/gitea/deployment.yaml b/pipelines/gitea/deployment.yaml new file mode 100644 index 0000000..27084cc --- /dev/null +++ b/pipelines/gitea/deployment.yaml @@ -0,0 +1,66 @@ +# Gitea deployment with NFS-backed PVC +# Replaces the old hostPath volume with a PersistentVolumeClaim +# bound to the gitea-data-nfs PV (see pvs/gitea-pv.yaml). +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: gitea-data + namespace: git-server +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + volumeName: gitea-data-nfs + storageClassName: "" +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gitea + namespace: git-server +spec: + replicas: 1 + selector: + matchLabels: + app: gitea + template: + metadata: + labels: + app: gitea + spec: + containers: + - name: gitea + image: gitea/gitea:latest + imagePullPolicy: Always + ports: + - containerPort: 3000 + - containerPort: 22 + volumeMounts: + - mountPath: /data + name: gitea-data + volumes: + - name: gitea-data + persistentVolumeClaim: + claimName: gitea-data +--- +apiVersion: v1 +kind: Service +metadata: + name: gitea-service + namespace: git-server +spec: + type: NodePort + selector: + app: gitea + ports: + - name: http + port: 3000 + targetPort: 3000 + nodePort: 30300 + - name: ssh + port: 22 + targetPort: 22 + nodePort: 30022 diff --git a/pipelines/pvs/gitea-pv.yaml b/pipelines/pvs/gitea-pv.yaml new file mode 100644 index 0000000..913bf7d --- /dev/null +++ b/pipelines/pvs/gitea-pv.yaml @@ -0,0 +1,19 @@ +# Gitea NFS PersistentVolume +# NFS path: nfs://192.168.42.8:/volume1/Kubernetes/gitea +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: gitea-data-nfs + labels: + app: gitea +spec: + capacity: + storage: 10Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + storageClassName: "" + nfs: + server: 192.168.42.8 + path: /volume1/Kubernetes/gitea diff --git a/pipelines/runmefirst.sh b/pipelines/runmefirst.sh index ba437ff..a6bcd3b 100755 --- a/pipelines/runmefirst.sh +++ b/pipelines/runmefirst.sh @@ -53,12 +53,23 @@ echo "" # ------------------------------------------------------- echo "--- Step 3: Applying NFS PersistentVolumes ---" kubectl apply -f pvs/argocd-pv.yaml +kubectl apply -f pvs/gitea-pv.yaml kubectl apply -f pvs/kargo-pv.yaml kubectl apply -f pvs/woodpecker-pv.yaml kubectl apply -f pvs/harbor-pv.yaml echo " ✓ PVs applied" echo "" +# ------------------------------------------------------- +# 3a. Apply Gitea deployment (NFS-backed) +# ------------------------------------------------------- +echo "--- Step 3a: Applying Gitea deployment ---" +kubectl create namespace git-server --dry-run=client -o yaml | kubectl apply -f - +kubectl apply -f gitea/deployment.yaml +kubectl rollout status deployment/gitea -n git-server --timeout=60s +echo " ✓ Gitea deployed with NFS storage" +echo "" + # ------------------------------------------------------- # 3b. Install Harbor container registry # -------------------------------------------------------