1
0
Fork 0

refactor: add /api/livez endpoint for kubernetes liveness probe, remove readiness probe

This commit is contained in:
Vojtěch Mareš 2023-09-09 01:10:42 +02:00
parent 57dc162ba1
commit 56069dbda5
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D
2 changed files with 15 additions and 5 deletions

View file

@ -39,11 +39,7 @@ spec:
protocol: TCP protocol: TCP
livenessProbe: livenessProbe:
httpGet: httpGet:
path: / path: /api/livez
port: {{ .Values.service.portName }}
readinessProbe:
httpGet:
path: /
port: {{ .Values.service.portName }} port: {{ .Values.service.portName }}
envFrom: envFrom:
- configMapRef: - configMapRef:

14
src/pages/api/livez.ts Normal file
View file

@ -0,0 +1,14 @@
import type {NextApiRequest, NextApiResponse} from 'next'
// GET /api/livez
export default async function handle(
req: NextApiRequest,
res: NextApiResponse,
) {
if (req.method !== 'GET') {
res.status(405).end();
return;
}
res.status(200).json({status: 'ok'});
}