docs: update Kubernetes deployment example

This commit is contained in:
Jonas Kaninda
2024-11-29 17:24:12 +01:00
parent 52322d9ec8
commit 31448c7de6
7 changed files with 110 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
# Goma Gateway - simple Lightweight High-Performance API Gateway Management.
# Goma Gateway - simple Lightweight High-Performance Declarative API Gateway Management.
```
_____
@@ -9,7 +9,7 @@
\_____|\___/|_| |_| |_|\__,_|
```
Goma Gateway is a lightweight High-Performance API Gateway Management.
Goma Gateway is a lightweight High-Performance Declarative API Gateway Management.
[![Tests](https://github.com/jkaninda/goma-gateway/actions/workflows/test.yml/badge.svg)](https://github.com/jkaninda/goma-gateway/actions/workflows/test.yml)
[![GitHub Release](https://img.shields.io/github/v/release/jkaninda/goma-gateway)](https://github.com/jkaninda/goma-gateway/releases)

View File

@@ -6,7 +6,7 @@ nav_order: 1
# Goma Gateway
{:.no_toc}
Goma Gateway is a lightweight API Gateway Management.
Goma Gateway is a lightweight High-Performance Declarative API Gateway Management.
<img src="https://raw.githubusercontent.com/jkaninda/goma-gateway/main/logo.png" width="150" alt="Goma logo">

View File

@@ -58,7 +58,7 @@ metadata:
spec:
# The version of Goma Gateway
# See: https://github.com/jkaninda/goma-gateway/releases
gatewayVersion: latest # 0.2.2
gatewayVersion: latest
## Server config
server:
# Kubernetes tls secret name

View File

@@ -27,3 +27,10 @@ With Goma, you can create custom middleware tailored to your needs and apply the
- Validates user permissions or access rights for specific route paths.
Middleware provides a flexible and powerful way to enhance the functionality, security, and performance of your API.
## Configuration Options
- **`name`** (`string`): Name of the middleware without white space.
- **`type`** (`string`): Type of the middleware.
- **`paths`** (`array of string`): Paths to prevent or protect.
- **`rule`** (`dictionary`): Middleware rule, changes depending on their type.

View File

@@ -13,8 +13,8 @@ These settings enable precise control over traffic flow and routing within your
## Configuration Options
- **`sslCertFile`** (`string`): Path to the SSL certificate file.
- **`sslKeyFile`** (`string`): Path to the SSL certificate private key file.
- **`tlsCertFile`** (`string`): Path to the TLS certificate file.
- **`tlsKeyFile`** (`string`): Path to the TLS certificate private key file.
- **`redis`**: Redis configuration settings.
- **`writeTimeout`** (`integer`): Timeout for writing responses (in seconds).
- **`readTimeout`** (`integer`): Timeout for reading requests (in seconds).
@@ -103,7 +103,7 @@ metadata:
spec:
# The version of Goma Gateway
# See: https://github.com/jkaninda/goma-gateway/releases
gatewayVersion: latest # 0.2.2
gatewayVersion: latest
server:
# Kubernetes tls secret name
tlsSecretName: '' #Optional, tls-secret

View File

@@ -0,0 +1,95 @@
## Example of advanced Kubernetes deployment
## Requirements:
# - CRDs and the Goma Gateway Operator
# Kubernetes Operator: https://github.com/jkaninda/goma-operator
### Middleware
apiVersion: gomaproj.github.io/v1beta1
kind: Middleware
metadata:
name: basic-middleware-sample
spec:
type: basic
paths:
- /admin/*
rule:
username: admin
password: admin
---
## Gateway
apiVersion: gomaproj.github.io/v1beta1
kind: Gateway
metadata:
labels: {}
name: gateway-sample
spec:
# The version of Goma Gateway
# See: https://github.com/jkaninda/goma-gateway/releases
gatewayVersion: latest #
## Server config
server:
# Kubernetes tls secret name
tlsSecretName: '' #Optional, tls-secret
#Redis configs for distributed rate limiting across multiple instances
redis:
addr: '' #Optional, redis:6379
password: '' #Optional, password
writeTimeout: 10
readTimeout: 15
idleTimeout: 30
logLevel: info
disableHealthCheckStatus: false
disableKeepAlive: false
enableMetrics: true
replicaCount: 1
resources:
limits:
cpu: 200m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
# Enable auto scaling
autoScaling:
enabled: true
minReplicas: 2
maxReplicas: 5
targetCPUUtilizationPercentage: 80
targetMemoryUtilizationPercentage: 80
affinity: {}
---
## Route
apiVersion: gomaproj.github.io/v1beta1
kind: Route
metadata:
labels: {}
name: route-sample
spec:
gateway: gateway-sample
path: /
hosts: []
rewrite: /
methods:
- GET
- POST
- PUT
destination: https://example.com
backends: []
insecureSkipVerify: false
healthCheck:
path: /
interval: 10s
timeout: 10s
healthyStatuses:
- 200
- 404
cors:
origins: []
headers: {}
rateLimit: 15
disableHostFording: true
interceptErrors: []
blockCommonExploits: false
## Middleware names
middlewares:
- basic-middleware-sample

View File

@@ -1,3 +1,4 @@
## Example of a simple deployment
apiVersion: apps/v1
kind: Deployment
metadata: