chore: update health check

This commit is contained in:
Jonas Kaninda
2024-11-25 17:40:03 +01:00
parent eb7f825969
commit 64de080158
6 changed files with 32 additions and 18 deletions

View File

@@ -143,7 +143,9 @@ docker run --rm --name goma-gateway \
```
### 4. Healthcheck
- Goma Gateway health check: `/health/live`
- Goma Gateway health check:
- `/readyz`
- `/healthz`
- Routes health check: `/health/routes`

View File

@@ -56,7 +56,7 @@ spec:
containers:
- name: goma-gateway
image: jkaninda/goma-gateway
command: ["goma","server"]
command: ["/usr/local/bin/goma","server"]
resources:
limits:
memory: "128Mi"
@@ -65,18 +65,16 @@ spec:
- containerPort: 8080
livenessProbe:
httpGet:
path: /health/live
path: /healthz
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /health/live
path: /readyz
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 10
initialDelaySeconds: 5
periodSeconds: 10
volumeMounts:
- name: config
mountPath: /etc/goma/
@@ -85,3 +83,5 @@ spec:
configMap:
name: goma-config
```
## 4. Kubernetes Advanced deployment using CRDs

View File

@@ -0,0 +1,12 @@
---
title: Kubernetes Operator
layout: default
parent: Installation
nav_order: 5
---
# Kubernetes Operator
**Install the CRDs into the cluster:**

View File

@@ -27,7 +27,9 @@ gateway:
healthyStatuses: [200,404] # Healthy statuses
```
- Goma Gateway healthcheck: `/health/live`
- Goma Gateway health check:
- `/readyz`
- `/healthz`
- Routes health check: `health/routes`
### Gateway healthcheck response:

View File

@@ -14,7 +14,7 @@ spec:
containers:
- name: goma-gateway
image: jkaninda/goma-gateway
command: ["goma","server"]
command: ["/usr/local/bin/goma","server"]
resources:
limits:
memory: "128Mi"
@@ -23,18 +23,16 @@ spec:
- containerPort: 8080
livenessProbe:
httpGet:
path: /health/live
path: /healthz
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /health/live
path: /readyz
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 10
initialDelaySeconds: 5
periodSeconds: 10
volumeMounts:
- name: config
mountPath: /etc/goma/

View File

@@ -78,13 +78,13 @@ func (gatewayServer GatewayServer) Initialize() *mux.Router {
}
// Routes health check
if !gateway.DisableHealthCheckStatus {
r.HandleFunc("/healthz", heath.HealthCheckHandler).Methods("GET")
r.HandleFunc("/health/routes", heath.HealthCheckHandler).Methods("GET")
}
// Health check
r.HandleFunc("/health/live", heath.HealthReadyHandler).Methods("GET")
r.HandleFunc("/readyz", heath.HealthReadyHandler).Methods("GET")
r.HandleFunc("/healthz", heath.HealthReadyHandler).Methods("GET")
// Enable common exploits
if gateway.BlockCommonExploits {
logger.Info("Block common exploits enabled")