Files
la-huasca-ts/k8s/app.yaml
T

106 lines
2.3 KiB
YAML

apiVersion: v1
kind: Namespace
metadata:
name: ${NAMESPACE}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: la-huasca-nextjs
namespace: ${NAMESPACE}
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: la-huasca-nextjs
template:
metadata:
labels:
app: la-huasca-nextjs
spec:
imagePullSecrets:
- name: la-huasca-registry
containers:
- name: nextjs
image: gitea.ajavasoft.com/muken/la-huasca-ts:${TAG}
ports:
- containerPort: 3000
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: la-huasca-db-secrets
key: DATABASE_URL
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: la-huasca-app-secrets
key: JWT_SECRET
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 15
periodSeconds: 10
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
---
apiVersion: v1
kind: Service
metadata:
name: la-huasca-nextjs
namespace: ${NAMESPACE}
spec:
selector:
app: la-huasca-nextjs
ports:
- port: 80
targetPort: 3000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: la-huasca-nextjs
namespace: ${NAMESPACE}
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
spec:
ingressClassName: traefik
rules:
- host: lahuasca.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: la-huasca-nextjs
port:
number: 80
- host: www.lahuasca.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: la-huasca-nextjs
port:
number: 80