From 31448c7de61c864b5801716daf5d76a1cc8bec69 Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Fri, 29 Nov 2024 17:24:12 +0100 Subject: [PATCH] docs: update Kubernetes deployment example --- README.md | 4 +- docs/index.md | 2 +- docs/install/kuberntes-advanced.md | 2 +- docs/middleware/overview.md | 7 +++ docs/quickstart/gateway.md | 6 +- examples/kubernetes-advanced.yaml | 95 ++++++++++++++++++++++++++++++ examples/kubernetes.yaml | 1 + 7 files changed, 110 insertions(+), 7 deletions(-) create mode 100644 examples/kubernetes-advanced.yaml diff --git a/README.md b/README.md index 4274321..54ca348 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/index.md b/docs/index.md index 49665f6..a08b849 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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. Goma logo diff --git a/docs/install/kuberntes-advanced.md b/docs/install/kuberntes-advanced.md index e15d9f5..89f5dcb 100644 --- a/docs/install/kuberntes-advanced.md +++ b/docs/install/kuberntes-advanced.md @@ -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 diff --git a/docs/middleware/overview.md b/docs/middleware/overview.md index c81203d..d82ba48 100644 --- a/docs/middleware/overview.md +++ b/docs/middleware/overview.md @@ -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. diff --git a/docs/quickstart/gateway.md b/docs/quickstart/gateway.md index 5bfb22b..612c804 100644 --- a/docs/quickstart/gateway.md +++ b/docs/quickstart/gateway.md @@ -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 diff --git a/examples/kubernetes-advanced.yaml b/examples/kubernetes-advanced.yaml new file mode 100644 index 0000000..239770a --- /dev/null +++ b/examples/kubernetes-advanced.yaml @@ -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 diff --git a/examples/kubernetes.yaml b/examples/kubernetes.yaml index ad16784..39017f5 100644 --- a/examples/kubernetes.yaml +++ b/examples/kubernetes.yaml @@ -1,3 +1,4 @@ +## Example of a simple deployment apiVersion: apps/v1 kind: Deployment metadata: