deploy backend
Some checks failed
Deploy Backend / deploy (push) Failing after 27s
Deploy Website / deploy (push) Failing after 2m34s

This commit is contained in:
Lee 2024-10-04 21:46:49 +01:00
parent c1fe5f2884
commit 498492bb91
9 changed files with 85 additions and 16 deletions

@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: scoresaber-reloaded-backend
namespace: public-services
spec:
replicas: 1
selector:
matchLabels:
app: scoresaber-reloaded-backend
template:
metadata:
labels:
app: scoresaber-reloaded-backend
spec:
containers:
- name: scoresaber-reloaded-backend-container
image: git.fascinated.cc/fascinated/scoresaber-reloaded-backend:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 1000m # 1 vCPU
memory: 512Mi

@ -0,0 +1,24 @@
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: scoresaber-reloaded-backend-ingress
namespace: public-services
annotations:
kubernetes.io/ingress.class: traefik-external
spec:
entryPoints:
- websecure
routes:
- match: Host(`ssr.fascinated.cc`) && PathPrefix(`/api`)
kind: Rule
middlewares:
- name: default-headers
namespace: traefik
- name: compress
namespace: traefik
services:
- name: scoresaber-reloaded-backend-service
port: 3000
tls:
secretName: fascinated-cc

@ -0,0 +1,13 @@
---
apiVersion: v1
kind: Service
metadata:
name: scoresaber-reloaded-backend-service
namespace: public-services
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
selector:
app: scoresaber-reloaded-backend

@ -7,6 +7,8 @@ on:
- master - master
paths: paths:
- backend/** - backend/**
- .gitea/kubernetes/backend/**
- .gitea/workflows/deploy-backend.yml
jobs: jobs:
deploy: deploy:
@ -47,15 +49,15 @@ jobs:
with: with:
kubeconfig: ${{ secrets.KUBECONFIG }} kubeconfig: ${{ secrets.KUBECONFIG }}
# - name: Deploy to Kubernetes - name: Deploy to Kubernetes
# uses: Azure/k8s-deploy@v5 uses: Azure/k8s-deploy@v5
# with: with:
# action: deploy action: deploy
# namespace: public-services namespace: public-services
# manifests: | manifests: |
# .gitea/kubernetes/sealed-secrets.yaml .gitea/kubernetes/backend/sealed-secrets.yaml
# .gitea/kubernetes/deployment.yaml .gitea/kubernetes/backend/deployment.yaml
# .gitea/kubernetes/service.yaml .gitea/kubernetes/backend/service.yaml
# .gitea/kubernetes/ingress.yaml .gitea/kubernetes/backend/ingress.yaml
# images: | images: |
# git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }} git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}

@ -7,6 +7,8 @@ on:
- master - master
paths: paths:
- website/** - website/**
- .gitea/kubernetes/website/**
- .gitea/workflows/deploy-website.yml
jobs: jobs:
deploy: deploy:
@ -53,9 +55,9 @@ jobs:
action: deploy action: deploy
namespace: public-services namespace: public-services
manifests: | manifests: |
.gitea/kubernetes/sealed-secrets.yaml .gitea/kubernetes/website/sealed-secrets.yaml
.gitea/kubernetes/deployment.yaml .gitea/kubernetes/website/deployment.yaml
.gitea/kubernetes/service.yaml .gitea/kubernetes/website/service.yaml
.gitea/kubernetes/ingress.yaml .gitea/kubernetes/website/ingress.yaml
images: | images: |
git.fascinated.cc/fascinated/scoresaber-reloaded-website:${{ github.sha }} git.fascinated.cc/fascinated/scoresaber-reloaded-website:${{ github.sha }}