From 9ed1632003fc8786bec11f2dd60c869c43e797d1 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Sun, 23 Mar 2025 14:48:47 -0500 Subject: [PATCH] Set up monorepo structure: apps, clusters, and infrastructure --- apps/production/gitea/deployment.yaml | 34 +++++++++++++++++++ apps/production/gitea/kustomization.yaml | 7 ++++ apps/production/gitea/pvc.yaml | 10 ++++++ apps/production/gitea/service.yaml | 16 +++++++++ .../production/flux-cluster.yaml | 7 ++-- clusters/production/kustomization.yaml | 5 +++ infrastructure/production/README.md | 0 7 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 apps/production/gitea/deployment.yaml create mode 100644 apps/production/gitea/kustomization.yaml create mode 100644 apps/production/gitea/pvc.yaml create mode 100644 apps/production/gitea/service.yaml rename apps/gitea/kustomization.yaml => clusters/production/flux-cluster.yaml (67%) create mode 100644 clusters/production/kustomization.yaml create mode 100644 infrastructure/production/README.md diff --git a/apps/production/gitea/deployment.yaml b/apps/production/gitea/deployment.yaml new file mode 100644 index 0000000..761d6ff --- /dev/null +++ b/apps/production/gitea/deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gitea + labels: + app: gitea +spec: + replicas: 1 + selector: + matchLabels: + app: gitea + template: + metadata: + labels: + app: gitea + spec: + containers: + - name: gitea + image: gitea/gitea:1.23 + ports: + - containerPort: 3000 + env: + - name: USER_UID + value: "1000" + - name: USER_GID + value: "1000" + volumeMounts: + - name: gitea-data + mountPath: /data + volumes: + - name: gitea-data + persistentVolumeClaim: + claimName: gitea-data + diff --git a/apps/production/gitea/kustomization.yaml b/apps/production/gitea/kustomization.yaml new file mode 100644 index 0000000..c3f35e2 --- /dev/null +++ b/apps/production/gitea/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - deployment.yaml + - service.yaml + - pvc.yaml + diff --git a/apps/production/gitea/pvc.yaml b/apps/production/gitea/pvc.yaml new file mode 100644 index 0000000..4dad42a --- /dev/null +++ b/apps/production/gitea/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: gitea-data +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 25Gi diff --git a/apps/production/gitea/service.yaml b/apps/production/gitea/service.yaml new file mode 100644 index 0000000..0fb8d6b --- /dev/null +++ b/apps/production/gitea/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: gitea + labels: + app: gitea +spec: + type: ClusterIP + ports: + - port: 3000 + targetPort: 3000 + protocol: TCP + name: http + selector: + app: gitea + diff --git a/apps/gitea/kustomization.yaml b/clusters/production/flux-cluster.yaml similarity index 67% rename from apps/gitea/kustomization.yaml rename to clusters/production/flux-cluster.yaml index bed8fb3..24e2cdd 100644 --- a/apps/gitea/kustomization.yaml +++ b/clusters/production/flux-cluster.yaml @@ -1,12 +1,13 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1beta2 kind: Kustomization metadata: - name: gitea + name: production-cluster namespace: flux-system spec: interval: 10m - path: "./apps/gitea" + path: "./clusters/production" prune: true sourceRef: kind: GitRepository - name: flux-system + name: flux_bootstrap + diff --git a/clusters/production/kustomization.yaml b/clusters/production/kustomization.yaml new file mode 100644 index 0000000..a65fa3d --- /dev/null +++ b/clusters/production/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../apps/production/gitea + - ../../infrastructure/production diff --git a/infrastructure/production/README.md b/infrastructure/production/README.md new file mode 100644 index 0000000..e69de29