From ccb968f72669937497fa4b8024350db8685f3890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Groothuis?= Date: Tue, 17 Mar 2026 09:28:04 +0100 Subject: [PATCH] feat(grainlab): Added Staging environment to ArgoCD. --- .../apps/grainlab-staging/app-project.yaml | 17 ++++++ .../apps/grainlab-staging/application.yaml | 24 ++++++++ .../apps/grainlab-staging/kustomization.yaml | 7 +++ clusters/artemis/apps/kustomization.yaml | 1 + .../grainlab-staging/app-deployment.yaml | 57 +++++++++++++++++++ .../artemis/grainlab-staging/app-ingress.yaml | 24 ++++++++ .../artemis/grainlab-staging/app-service.yaml | 11 ++++ .../artemis/grainlab-staging/namespace.yaml | 4 ++ .../grainlab-staging/postgres-cluster.yaml | 24 ++++++++ 9 files changed, 169 insertions(+) create mode 100644 clusters/artemis/apps/grainlab-staging/app-project.yaml create mode 100644 clusters/artemis/apps/grainlab-staging/application.yaml create mode 100644 clusters/artemis/apps/grainlab-staging/kustomization.yaml create mode 100644 manifests/artemis/grainlab-staging/app-deployment.yaml create mode 100644 manifests/artemis/grainlab-staging/app-ingress.yaml create mode 100644 manifests/artemis/grainlab-staging/app-service.yaml create mode 100644 manifests/artemis/grainlab-staging/namespace.yaml create mode 100644 manifests/artemis/grainlab-staging/postgres-cluster.yaml diff --git a/clusters/artemis/apps/grainlab-staging/app-project.yaml b/clusters/artemis/apps/grainlab-staging/app-project.yaml new file mode 100644 index 0000000..7477bc4 --- /dev/null +++ b/clusters/artemis/apps/grainlab-staging/app-project.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + name: grainlab-staging +spec: + description: GrianLab Staging environment + sourceRepos: + - '*' + sourceNamespaces: + - '*' + destinations: + - namespace: 'grainlab-staging' + server: '*' + clusterResourceWhitelist: + - group: '*' + kind: '*' diff --git a/clusters/artemis/apps/grainlab-staging/application.yaml b/clusters/artemis/apps/grainlab-staging/application.yaml new file mode 100644 index 0000000..5ad1e74 --- /dev/null +++ b/clusters/artemis/apps/grainlab-staging/application.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: grainlab-staging + namespace: grainlab-staging + labels: + platform.dgse.cloud/cluster: artemis + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: homebox + source: + repoURL: 'https://git.dgse.cloud/DGSE/kubernetes.git' + path: manifests/artemis/grainlab-staging + targetRevision: staging + destination: + namespace: grainlab-staging + name: in-cluster + syncPolicy: + syncOptions: + - CreateNamespace=true + automated: + prune: true + selfHeal: true diff --git a/clusters/artemis/apps/grainlab-staging/kustomization.yaml b/clusters/artemis/apps/grainlab-staging/kustomization.yaml new file mode 100644 index 0000000..f9b2a4b --- /dev/null +++ b/clusters/artemis/apps/grainlab-staging/kustomization.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - app-project.yaml + - application.yaml diff --git a/clusters/artemis/apps/kustomization.yaml b/clusters/artemis/apps/kustomization.yaml index ba5bd95..9568a5f 100644 --- a/clusters/artemis/apps/kustomization.yaml +++ b/clusters/artemis/apps/kustomization.yaml @@ -17,3 +17,4 @@ resources: - immich - digital-garden - homebox + - grainlab-staging diff --git a/manifests/artemis/grainlab-staging/app-deployment.yaml b/manifests/artemis/grainlab-staging/app-deployment.yaml new file mode 100644 index 0000000..cd2862d --- /dev/null +++ b/manifests/artemis/grainlab-staging/app-deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: grainlab + namespace: grainlab-staging +spec: + replicas: 1 + selector: + matchLabels: + app: grainlab + template: + metadata: + labels: + app: grainlab + spec: + imagePullSecrets: + - name: ghcr-cred + containers: + - name: grainlab + image: ghcr.io/daniel-luke/grainlab:staging + imagePullPolicy: Always + + ports: + - containerPort: 3000 + env: + - name: NODE_ENV + value: "production" + - name: PORT + value: "3000" + - name: HOST + value: "0.0.0.0" + envFrom: + - secretRef: + name: grainlab-app + - secretRef: + name: grainlab-database + - secretRef: + name: grainlab-s3 + readinessProbe: + httpGet: + path: / + port: 3000 + initialDelaySeconds: 10 + periodSeconds: 5 + failureThreshold: 6 + livenessProbe: + httpGet: + path: / + port: 3000 + initialDelaySeconds: 30 + periodSeconds: 10 + resources: + requests: + cpu: 100m + memory: 256Mi + limits: + memory: 512Mi diff --git a/manifests/artemis/grainlab-staging/app-ingress.yaml b/manifests/artemis/grainlab-staging/app-ingress.yaml new file mode 100644 index 0000000..0252677 --- /dev/null +++ b/manifests/artemis/grainlab-staging/app-ingress.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: grainlab + namespace: grainlab-staging + annotations: + cert-manager.io/cluster-issuer: letsencrypt +spec: + rules: + - host: staging.grainlab.app + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: grainlab + port: + number: 80 + tls: + - hosts: + - staging.grainlab.app + secretName: letsencrypt diff --git a/manifests/artemis/grainlab-staging/app-service.yaml b/manifests/artemis/grainlab-staging/app-service.yaml new file mode 100644 index 0000000..404aa0b --- /dev/null +++ b/manifests/artemis/grainlab-staging/app-service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: grainlab + namespace: grainlab-staging +spec: + selector: + app: grainlab + ports: + - port: 80 + targetPort: 3000 diff --git a/manifests/artemis/grainlab-staging/namespace.yaml b/manifests/artemis/grainlab-staging/namespace.yaml new file mode 100644 index 0000000..56ac282 --- /dev/null +++ b/manifests/artemis/grainlab-staging/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: grainlab-staging diff --git a/manifests/artemis/grainlab-staging/postgres-cluster.yaml b/manifests/artemis/grainlab-staging/postgres-cluster.yaml new file mode 100644 index 0000000..85235c7 --- /dev/null +++ b/manifests/artemis/grainlab-staging/postgres-cluster.yaml @@ -0,0 +1,24 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: grainlab-db + namespace: grainlab-staging +spec: + instances: 1 + + bootstrap: + initdb: + database: grainlab + owner: grainlab + secret: + name: grainlab-db-credentials + + storage: + size: 10Gi + + resources: + requests: + cpu: 100m + memory: 256Mi + limits: + memory: 512Mi