diff --git a/manifest/autoscale.yaml b/manifest/autoscale.yaml index 7d1d7d3..4ea20d2 100644 --- a/manifest/autoscale.yaml +++ b/manifest/autoscale.yaml @@ -13,7 +13,7 @@ spec: service: techaro-lol port: 80 replicas: - min: 0 + min: 1 max: 10 scaledownPeriod: 300 scalingMetric: diff --git a/manifest/deployment.yaml b/manifest/deployment.yaml index 0ffb94c..205764c 100644 --- a/manifest/deployment.yaml +++ b/manifest/deployment.yaml @@ -44,10 +44,12 @@ spec: type: RuntimeDefault livenessProbe: httpGet: - path: / + path: /_healthz port: 3000 httpHeaders: - - name: X-Real-Ip - value: "127.0.0.1" + - name: x-real-ip + value: "100.100.100.100" + - name: user-agent + value: "Kubernetes healthchecks" initialDelaySeconds: 3 periodSeconds: 3 \ No newline at end of file diff --git a/middleware.ts b/middleware.ts index e55c76f..3695e8a 100644 --- a/middleware.ts +++ b/middleware.ts @@ -4,7 +4,7 @@ import { NextRequest, NextResponse } from "next/server"; export const config = { // matcher tells Next.js which routes to run the middleware on. // This runs the middleware on all routes except for static assets. - matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"], + matcher: ["/((?!_next/static|_next/image|favicon.ico|/_healthz).*)"], }; const aj = arcjet({ @@ -30,6 +30,7 @@ export default async function middleware(request: NextRequest) { console.log(req.ip); const decision = await aj.protect(req); + console.log(decision); if ( // If this deny comes from a bot rule then block the request. You can