diff --git a/README.md b/README.md index ae48624..bbb48ed 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,6 @@ It's designed to be straightforward and efficient, offering features, like: - Limit HTTP methods allowed for a particular route. ### Todo: - - [ ] Load Balancing Healthcheck, disable unavailable servers - [ ] Blocklist IP address middleware - [ ] Distributed Rate Limiting for In-Memory client IP based across multiple instances using Redis diff --git a/docs/install/kubernetes.md b/docs/install/kubernetes.md index bf53139..80865cb 100644 --- a/docs/install/kubernetes.md +++ b/docs/install/kubernetes.md @@ -32,8 +32,8 @@ metadata: name: goma-config data: goma.yml: | - # Goma Gateway configurations - version: 0.1.7 + # Goma Gateway configurations + version: 1.0 gateway: # Proxy write timeout writeTimeout: 15 @@ -47,6 +47,7 @@ data: sslKeyFile: ''#key.pem # Proxy rate limit, it's In-Memory IP based rateLimit: 0 + logLevel: info # debug, trace, off accessLog: "/dev/Stdout" errorLog: "/dev/stderr" ## Enable, disable routes health check @@ -78,10 +79,10 @@ data: ##### Define routes routes: # Example of a route | 1 - - name: Public # Name is optional + - path: / + name: Public # Name is optional # host Domain/host based request routing - host: "" # Host is optional - path: /public + hosts: [] # Hosts are optional ## Rewrite a request path # e.g rewrite: /store to / rewrite: / @@ -92,8 +93,6 @@ data: # [X-Forwarded-Host, X-Forwarded-For, Host, Scheme ] # It will not match the backend route, by default, it's disabled disableHeaderXForward: false - # Internal health check - healthCheck: '' #/internal/health/ready # Route Cors, global cors will be overridden by route cors: # Route Origins Cors, route will override global cors origins @@ -113,17 +112,27 @@ data: middlewares: - api-forbidden-paths # Example of a route | 2 - - name: Basic auth - path: /protected + - path: /protected + name: Basic auth rewrite: / - destination: https://example.com - methods: [] + destination: '' + backends: + - https://example.com + - https://example2.com + methods: + - GET + # Route healthcheck healthCheck: + path: /health/live + interval: 30s + timeout: 10s + healthyStatuses: + - 200 + - 404 cors: {} middlewares: - api-forbidden-paths - basic-auth - #Defines proxy middlewares # middleware name must be unique middlewares: @@ -176,6 +185,46 @@ data: - /api-docs/* - /internal/* - /actuator/* + - name: oauth-google + type: oauth + paths: + - /protected + - /example-of-oauth + rule: + clientId: xxx + clientSecret: xxx + provider: google + endpoint: + userInfoUrl: "" + redirectUrl: http://localhost:8080/callback + redirectPath: "" + cookiePath: "" + scopes: + - https://www.googleapis.com/auth/userinfo.email + - https://www.googleapis.com/auth/userinfo.profile + state: randomStateString + jwtSecret: your-strong-jwt-secret | It's optional + - name: oauth-authentik + type: oauth + paths: + - /protected + - /example-of-oauth + rule: + clientId: xxx + clientSecret: xxx + provider: custom + endpoint: + authUrl: https://authentik.example.com/application/o/authorize/ + tokenUrl: https://authentik.example.com/application/o/token/ + userInfoUrl: https://authentik.example.com/application/o/userinfo/ + redirectUrl: http://localhost:8080/callback + redirectPath: "" + cookiePath: "" + scopes: + - email + - openid + state: randomStateString + jwtSecret: your-strong-jwt-secret | It's optional ``` ## 3. Create Kubernetes deployment diff --git a/docs/quickstart/healthcheck.md b/docs/quickstart/healthcheck.md index 9bbe394..f92f469 100644 --- a/docs/quickstart/healthcheck.md +++ b/docs/quickstart/healthcheck.md @@ -20,8 +20,8 @@ gateway: methods: [] healthCheck: path: "/health/live" - interval: 30 # in Seconds - timeout: 10 # in Seconds + interval: 30s + timeout: 10s healthyStatuses: [200,404] # Healthy statuses ``` diff --git a/docs/quickstart/loadbalanging.md b/docs/quickstart/loadbalanging.md index 2a36c0a..3c55a45 100644 --- a/docs/quickstart/loadbalanging.md +++ b/docs/quickstart/loadbalanging.md @@ -8,7 +8,9 @@ nav_order: 4 # Load Balancing -Goma Gateway supports rund robim load blancing +Goma Gateway supports round-robin algorithm load balancing. + +It comes with an integrated load balancing backends healthcheck. ```yaml version: 1.0 @@ -23,8 +25,8 @@ gateway: methods: [] healthCheck: path: "/" - interval: 0 - timeout: 0 + interval: 30s + timeout: 10s healthyStatuses: [200,404] ## destination: will be override by backends destination: "" diff --git a/docs/quickstart/logging.md b/docs/quickstart/logging.md index 25775ee..231a3b8 100644 --- a/docs/quickstart/logging.md +++ b/docs/quickstart/logging.md @@ -28,3 +28,7 @@ GOMA_LOG_LEVEL=trace ### When using a configuration file Edit the Goma settings and set `logLevel: trace`. + +### Disable logging + +To disable logs, you need to set `logLevel: off`, it will turn off logs \ No newline at end of file diff --git a/examples/configMap.yaml b/examples/configMap.yaml index eb00446..c612761 100644 --- a/examples/configMap.yaml +++ b/examples/configMap.yaml @@ -4,7 +4,7 @@ metadata: name: goma-config data: goma.yml: | - # Goma Gateway configurations + # Goma Gateway configurations version: 1.0 gateway: # Proxy write timeout @@ -96,8 +96,8 @@ data: # Route healthcheck healthCheck: path: /health/live - interval: 30 - timeout: 10 + interval: 30s + timeout: 10s healthyStatuses: - 200 - 404 diff --git a/examples/goma.yml b/examples/goma.yml index c4e0ba5..04069a2 100644 --- a/examples/goma.yml +++ b/examples/goma.yml @@ -13,7 +13,7 @@ gateway: sslKeyFile: ''#key.pem # Proxy rate limit, it's In-Memory IP based rateLimit: 0 - logLevel: info # debug, trace + logLevel: info # debug, trace, off accessLog: "/dev/Stdout" errorLog: "/dev/stderr" ## Enable, disable routes health check