fix: disable ssl-redirect on nextgen ingresses to resolve Cloudflare redirect loop
This commit is contained in:
parent
eb0d42d835
commit
9388422c14
|
|
@ -0,0 +1,125 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: next-gen-main
|
||||||
|
namespace: nextgen
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: next-gen-main
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: next-gen-main
|
||||||
|
spec:
|
||||||
|
nodeName: vmi2853337
|
||||||
|
containers:
|
||||||
|
- name: app
|
||||||
|
image: node:20-slim
|
||||||
|
command: ["sh", "-c", "cd /app/server && ([ -f ../data/school.db ] || node src/database/init.js) && node src/index.js"]
|
||||||
|
workingDir: /app
|
||||||
|
env:
|
||||||
|
- name: NODE_ENV
|
||||||
|
value: "production"
|
||||||
|
- name: PORT
|
||||||
|
value: "3001"
|
||||||
|
- name: DB_PATH
|
||||||
|
value: "/app/data/school.db"
|
||||||
|
- name: JWT_SECRET
|
||||||
|
value: "africa-alert-production-secret-2024"
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 3001
|
||||||
|
volumeMounts:
|
||||||
|
- name: app-source
|
||||||
|
mountPath: /app
|
||||||
|
volumes:
|
||||||
|
- name: app-source
|
||||||
|
hostPath:
|
||||||
|
path: /root/geocrop/apps/nextgen-main
|
||||||
|
type: Directory
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: next-gen-dev
|
||||||
|
namespace: nextgen
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: next-gen-dev
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: next-gen-dev
|
||||||
|
spec:
|
||||||
|
nodeName: vmi2853337
|
||||||
|
containers:
|
||||||
|
- name: app
|
||||||
|
image: node:20-slim
|
||||||
|
command: ["sh", "-c", "cd /app/server && ([ -f ../data/school.db ] || node src/database/init.js) && node src/index.js"]
|
||||||
|
workingDir: /app
|
||||||
|
env:
|
||||||
|
- name: NODE_ENV
|
||||||
|
value: "production"
|
||||||
|
- name: PORT
|
||||||
|
value: "3001"
|
||||||
|
- name: DB_PATH
|
||||||
|
value: "/app/data/school.db"
|
||||||
|
- name: JWT_SECRET
|
||||||
|
value: "africa-alert-dev-secret-2024"
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 3001
|
||||||
|
volumeMounts:
|
||||||
|
- name: app-source
|
||||||
|
mountPath: /app
|
||||||
|
volumes:
|
||||||
|
- name: app-source
|
||||||
|
hostPath:
|
||||||
|
path: /root/geocrop/apps/nextgen-dev
|
||||||
|
type: Directory
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: next-gen-dev
|
||||||
|
namespace: nextgen
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: next-gen-dev
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: http
|
||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: next-gen-dev
|
||||||
|
namespace: nextgen
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
nginx.ingress.kubernetes.io/proxy-body-size: "100m"
|
||||||
|
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
||||||
|
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- dev.next-gen.techarvest.co.zw
|
||||||
|
secretName: next-gen-dev-tls
|
||||||
|
rules:
|
||||||
|
- host: dev.next-gen.techarvest.co.zw
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: next-gen-dev
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
|
|
@ -17,6 +17,8 @@ ingress:
|
||||||
className: nginx
|
className: nginx
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||||
|
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
||||||
|
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
|
||||||
host: "next-gen.techarvest.co.zw" # Default host
|
host: "next-gen.techarvest.co.zw" # Default host
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue