feat: add Gitea NFS PV, declarative deployment, and wire into runmefirst.sh
This commit is contained in:
@@ -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
|
||||||
@@ -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
|
||||||
@@ -53,12 +53,23 @@ echo ""
|
|||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
echo "--- Step 3: Applying NFS PersistentVolumes ---"
|
echo "--- Step 3: Applying NFS PersistentVolumes ---"
|
||||||
kubectl apply -f pvs/argocd-pv.yaml
|
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/kargo-pv.yaml
|
||||||
kubectl apply -f pvs/woodpecker-pv.yaml
|
kubectl apply -f pvs/woodpecker-pv.yaml
|
||||||
kubectl apply -f pvs/harbor-pv.yaml
|
kubectl apply -f pvs/harbor-pv.yaml
|
||||||
echo " ✓ PVs applied"
|
echo " ✓ PVs applied"
|
||||||
echo ""
|
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
|
# 3b. Install Harbor container registry
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user