Initial commit with 2026 World Cup Quant Platform core modules and CI/CD
This commit is contained in:
326
platform/deploy/k3s-manifests.yaml
Normal file
326
platform/deploy/k3s-manifests.yaml
Normal file
@@ -0,0 +1,326 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: fifa2026
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: fifa2026-platform-config
|
||||
namespace: fifa2026
|
||||
data:
|
||||
APP_TIME_ZONE: Asia/Taipei
|
||||
NEXT_PUBLIC_WS_URL: wss://2026fifa.wooo.work/ws/matches
|
||||
NEXT_PUBLIC_API_ORIGIN: http://fifa2026-api:8000
|
||||
DATABASE_URL: postgresql://fifa_user:change_me@fifa2026-postgres:5432/fifa2026
|
||||
REDIS_URL: redis://fifa2026-redis:6379/0
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: fifa2026-secrets
|
||||
namespace: fifa2026
|
||||
type: Opaque
|
||||
stringData:
|
||||
NEXTAUTH_SECRET: changeme-nextauth-secret
|
||||
TELEGRAM_BOT_TOKEN: changeme-telegram-token
|
||||
TELEGRAM_CHAT_ID: changeme-chat-id
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fifa2026-postgres
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fifa2026-postgres
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fifa2026-postgres
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:16-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: fifa2026
|
||||
- name: POSTGRES_USER
|
||||
value: fifa_user
|
||||
- name: POSTGRES_PASSWORD
|
||||
value: change_me
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
volumeMounts:
|
||||
- name: pgdata
|
||||
mountPath: /var/lib/postgresql/data
|
||||
volumes:
|
||||
- name: pgdata
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: fifa2026-postgres
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
selector:
|
||||
app: fifa2026-postgres
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fifa2026-redis
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fifa2026-redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fifa2026-redis
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: fifa2026-redis
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
selector:
|
||||
app: fifa2026-redis
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: 6379
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fifa2026-api
|
||||
namespace: fifa2026
|
||||
labels:
|
||||
app: fifa2026-api
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fifa2026-api
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fifa2026-api
|
||||
spec:
|
||||
containers:
|
||||
- name: api
|
||||
image: ghcr.io/YOUR_ORG/2026fifa-backend:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
env:
|
||||
- name: PORT
|
||||
value: "8000"
|
||||
- name: REDIS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: REDIS_URL
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: DATABASE_URL
|
||||
- name: NEXTAUTH_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: fifa2026-secrets
|
||||
key: NEXTAUTH_SECRET
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 15
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: fifa2026-api
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
selector:
|
||||
app: fifa2026-api
|
||||
ports:
|
||||
- port: 8000
|
||||
targetPort: 8000
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fifa2026-web
|
||||
namespace: fifa2026
|
||||
labels:
|
||||
app: fifa2026-web
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fifa2026-web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fifa2026-web
|
||||
spec:
|
||||
containers:
|
||||
- name: web
|
||||
image: ghcr.io/YOUR_ORG/2026fifa-web:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
env:
|
||||
- name: NEXT_PUBLIC_WS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: NEXT_PUBLIC_WS_URL
|
||||
- name: NEXT_PUBLIC_API_ORIGIN
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: NEXT_PUBLIC_API_ORIGIN
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: DATABASE_URL
|
||||
- name: REDIS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: REDIS_URL
|
||||
- name: NEXTAUTH_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: fifa2026-secrets
|
||||
key: NEXTAUTH_SECRET
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 3000
|
||||
initialDelaySeconds: 6
|
||||
periodSeconds: 8
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 3000
|
||||
initialDelaySeconds: 12
|
||||
periodSeconds: 12
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: fifa2026-web
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
selector:
|
||||
app: fifa2026-web
|
||||
ports:
|
||||
- port: 3000
|
||||
targetPort: 3000
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fifa2026-alert-worker
|
||||
namespace: fifa2026
|
||||
labels:
|
||||
app: fifa2026-alert-worker
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fifa2026-alert-worker
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fifa2026-alert-worker
|
||||
spec:
|
||||
containers:
|
||||
- name: worker
|
||||
image: ghcr.io/YOUR_ORG/2026fifa-alerts:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: REDIS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: REDIS_URL
|
||||
- name: TELEGRAM_BOT_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: fifa2026-secrets
|
||||
key: TELEGRAM_BOT_TOKEN
|
||||
- name: TELEGRAM_CHAT_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: fifa2026-secrets
|
||||
key: TELEGRAM_CHAT_ID
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: fifa2026-ingress
|
||||
namespace: fifa2026
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
tls:
|
||||
- hosts:
|
||||
- 2026fifa.wooo.work
|
||||
secretName: fifa2026-tls
|
||||
rules:
|
||||
- host: 2026fifa.wooo.work
|
||||
http:
|
||||
paths:
|
||||
- path: /ws/
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: fifa2026-api
|
||||
port:
|
||||
number: 8000
|
||||
- path: /api/
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: fifa2026-api
|
||||
port:
|
||||
number: 8000
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: fifa2026-web
|
||||
port:
|
||||
number: 3000
|
||||
32
platform/deploy/k3s/alerts-deployment.yaml
Normal file
32
platform/deploy/k3s/alerts-deployment.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fifa2026-alert-worker
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fifa2026-alert-worker
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fifa2026-alert-worker
|
||||
spec:
|
||||
containers:
|
||||
- name: worker
|
||||
image: ghcr.io/your-org/2026fifa-alerts:latest
|
||||
env:
|
||||
- name: REDIS_URL
|
||||
value: redis://fifa2026-redis:6379/0
|
||||
- name: TELEGRAM_BOT_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: fifa2026-secrets
|
||||
key: TELEGRAM_BOT_TOKEN
|
||||
- name: TELEGRAM_CHAT_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: fifa2026-secrets
|
||||
key: TELEGRAM_CHAT_ID
|
||||
|
||||
61
platform/deploy/k3s/backend-deployment.yaml
Normal file
61
platform/deploy/k3s/backend-deployment.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fifa2026-api
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fifa2026-api
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fifa2026-api
|
||||
spec:
|
||||
containers:
|
||||
- name: api
|
||||
image: ghcr.io/your-org/2026fifa-backend:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
env:
|
||||
- name: PORT
|
||||
value: "8000"
|
||||
- name: REDIS_URL
|
||||
value: redis://fifa2026-redis:6379/0
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: DATABASE_URL
|
||||
- name: NEXTAUTH_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: fifa2026-secrets
|
||||
key: NEXTAUTH_SECRET
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 15
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: fifa2026-api
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
selector:
|
||||
app: fifa2026-api
|
||||
ports:
|
||||
- port: 8000
|
||||
targetPort: 8000
|
||||
|
||||
11
platform/deploy/k3s/configmap.yaml
Normal file
11
platform/deploy/k3s/configmap.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: fifa2026-platform-config
|
||||
namespace: fifa2026
|
||||
data:
|
||||
APP_TIME_ZONE: Asia/Taipei
|
||||
NEXT_PUBLIC_WS_URL: wss://2026fifa.wooo.work/ws/matches
|
||||
NEXT_PUBLIC_API_ORIGIN: http://fifa2026-api:8000
|
||||
DATABASE_URL: postgresql://fifa_user:change_me@fifa2026-postgres:5432/fifa2026
|
||||
REDIS_URL: redis://fifa2026-redis:6379/0
|
||||
40
platform/deploy/k3s/ingress.yaml
Normal file
40
platform/deploy/k3s/ingress.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: fifa2026-ingress
|
||||
namespace: fifa2026
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: nginx
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- 2026fifa.wooo.work
|
||||
secretName: fifa2026-tls
|
||||
rules:
|
||||
- host: 2026fifa.wooo.work
|
||||
http:
|
||||
paths:
|
||||
- path: /ws/
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: fifa2026-api
|
||||
port:
|
||||
number: 8000
|
||||
- path: /api/
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: fifa2026-api
|
||||
port:
|
||||
number: 8000
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: fifa2026-web
|
||||
port:
|
||||
number: 3000
|
||||
|
||||
5
platform/deploy/k3s/namespace.yaml
Normal file
5
platform/deploy/k3s/namespace.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: fifa2026
|
||||
|
||||
47
platform/deploy/k3s/postgres-deployment.yaml
Normal file
47
platform/deploy/k3s/postgres-deployment.yaml
Normal file
@@ -0,0 +1,47 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fifa2026-postgres
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fifa2026-postgres
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fifa2026-postgres
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:16-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: fifa2026
|
||||
- name: POSTGRES_USER
|
||||
value: fifa_user
|
||||
- name: POSTGRES_PASSWORD
|
||||
value: change_me
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
volumeMounts:
|
||||
- name: pgdata
|
||||
mountPath: /var/lib/postgresql/data
|
||||
volumes:
|
||||
- name: pgdata
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: fifa2026-postgres
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
selector:
|
||||
app: fifa2026-postgres
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
|
||||
34
platform/deploy/k3s/redis-deployment.yaml
Normal file
34
platform/deploy/k3s/redis-deployment.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fifa2026-redis
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fifa2026-redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fifa2026-redis
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: fifa2026-redis
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
selector:
|
||||
app: fifa2026-redis
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: 6379
|
||||
|
||||
11
platform/deploy/k3s/secret.yaml
Normal file
11
platform/deploy/k3s/secret.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: fifa2026-secrets
|
||||
namespace: fifa2026
|
||||
type: Opaque
|
||||
stringData:
|
||||
NEXTAUTH_SECRET: changeme-nextauth-secret
|
||||
TELEGRAM_BOT_TOKEN: changeme-telegram-token
|
||||
TELEGRAM_CHAT_ID: changeme-chat-id
|
||||
|
||||
56
platform/deploy/k3s/web-deployment.yaml
Normal file
56
platform/deploy/k3s/web-deployment.yaml
Normal file
@@ -0,0 +1,56 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fifa2026-web
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fifa2026-web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fifa2026-web
|
||||
spec:
|
||||
containers:
|
||||
- name: web
|
||||
image: ghcr.io/your-org/2026fifa-web:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
env:
|
||||
- name: NEXTAUTH_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: fifa2026-secrets
|
||||
key: NEXTAUTH_SECRET
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: DATABASE_URL
|
||||
- name: REDIS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: REDIS_URL
|
||||
- name: NEXT_PUBLIC_WS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fifa2026-platform-config
|
||||
key: NEXT_PUBLIC_WS_URL
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: fifa2026-web
|
||||
namespace: fifa2026
|
||||
spec:
|
||||
selector:
|
||||
app: fifa2026-web
|
||||
ports:
|
||||
- port: 3000
|
||||
targetPort: 3000
|
||||
|
||||
Reference in New Issue
Block a user