Merge pull request #130 from jkaninda/feature/rate-limiting

chore: update health check
This commit is contained in:
2024-11-25 17:41:38 +01:00
committed by GitHub
6 changed files with 32 additions and 18 deletions

View File

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

View File

@@ -56,7 +56,7 @@ spec:
containers: containers:
- name: goma-gateway - name: goma-gateway
image: jkaninda/goma-gateway image: jkaninda/goma-gateway
command: ["goma","server"] command: ["/usr/local/bin/goma","server"]
resources: resources:
limits: limits:
memory: "128Mi" memory: "128Mi"
@@ -65,18 +65,16 @@ spec:
- containerPort: 8080 - containerPort: 8080
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /health/live path: /healthz
port: 8080 port: 8080
initialDelaySeconds: 15 initialDelaySeconds: 15
periodSeconds: 30 periodSeconds: 30
timeoutSeconds: 10
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /health/live path: /readyz
port: 8080 port: 8080
initialDelaySeconds: 15 initialDelaySeconds: 5
periodSeconds: 30 periodSeconds: 10
timeoutSeconds: 10
volumeMounts: volumeMounts:
- name: config - name: config
mountPath: /etc/goma/ mountPath: /etc/goma/
@@ -85,3 +83,5 @@ spec:
configMap: configMap:
name: goma-config 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 healthyStatuses: [200,404] # Healthy statuses
``` ```
- Goma Gateway healthcheck: `/health/live` - Goma Gateway health check:
- `/readyz`
- `/healthz`
- Routes health check: `health/routes` - Routes health check: `health/routes`
### Gateway healthcheck response: ### Gateway healthcheck response:

View File

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

View File

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