Files
bestofpb/k8s.yaml
2025-12-23 17:41:30 -08:00

124 lines
2.8 KiB
YAML

---
apiVersion: v1
kind: Service
metadata:
name: awards-svc
namespace: awards
spec:
ports:
- port: 80
targetPort: 4000
protocol: TCP
selector:
app: awards
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: awards-dep
namespace: awards
spec:
selector:
matchLabels:
app: awards
replicas: 2
template:
metadata:
labels:
app: awards
spec:
imagePullSecrets:
- name: harborcred
containers:
- name: awards
image: harbor.scottyah.com/secure/awards:latest
imagePullPolicy: Always
ports:
- containerPort: 4000
env:
- name: NODE_ENV
value: "production"
- name: PORT
value: "4000"
- name: DATABASE_PATH
value: "/app/data/awards.db"
- name: CORS_ORIGIN
value: "https://awards.scottyah.com"
- name: ADMIN_USERNAME
valueFrom:
secretKeyRef:
name: awards-secret
key: admin-username
- name: ADMIN_PASSWORD_HASH
valueFrom:
secretKeyRef:
name: awards-secret
key: admin-password-hash
- name: NOMINATIM_BASE_URL
value: "https://nominatim.openstreetmap.org"
- name: NOMINATIM_USER_AGENT
value: "BestOfPBAwardsApp/1.0"
- name: RATE_LIMIT_WINDOW_MS
value: "900000"
- name: RATE_LIMIT_MAX_REQUESTS
value: "100"
- name: RATE_LIMIT_NOMINATION_MAX
value: "10"
- name: RATE_LIMIT_EMOJI_MAX
value: "50"
volumeMounts:
- name: data
mountPath: /app/data
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
volumes:
- name: data
persistentVolumeClaim:
claimName: awards-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: awards-pvc
namespace: awards
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: awards-ingress
namespace: awards
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
traefik.ingress.kubernetes.io/router.tls: "true"
spec:
ingressClassName: traefik
tls:
- hosts:
- awards.scottyah.com
secretName: awards-tls
rules:
- host: awards.scottyah.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: awards-svc
port:
number: 80