From 015906b009483663b249f83aaf807b18c5dadc83 Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Sun, 1 Dec 2024 19:31:33 +0100 Subject: [PATCH] docs: update Kubernetes deployment --- README.md | 2 +- docs/index.md | 2 +- docs/quickstart/extra-route.md | 30 ++++++++++++++++++++ examples/configMap.yaml | 10 +++---- examples/extra-configs.yaml | 51 ++++++++++++++++++++++++++++++++++ examples/kubernetes.yaml | 4 +-- 6 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 examples/extra-configs.yaml diff --git a/README.md b/README.md index 54ca348..53991ee 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ It's designed to be straightforward and efficient, offering a rich set of featur - **HTTP Method Restrictions** Limit HTTP methods for specific routes to enhance control. -Define your routes and middleware directly in code for seamless configuration. +Declarative API Gateway Management, define your routes and middleware directly in code for seamless configuration. ---- diff --git a/docs/index.md b/docs/index.md index a08b849..8776ea7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -73,7 +73,7 @@ It's designed to be straightforward and efficient, offering a rich set of featur - **HTTP Method Restrictions** Limit HTTP methods for specific routes to enhance control. -Define your routes and middleware directly in code for seamless configuration. +Declarative API Gateway Management, define your routes and middleware directly in code for seamless configuration. ---- Architecture: diff --git a/docs/quickstart/extra-route.md b/docs/quickstart/extra-route.md index efef503..f6826b1 100644 --- a/docs/quickstart/extra-route.md +++ b/docs/quickstart/extra-route.md @@ -92,4 +92,34 @@ Create a file in `/etc/goma/extra` using `yaml` or `.yaml` extension. middlewares: - auth-middleware +``` + +## Extra Middlewares + +Create a file in `/etc/goma/extra` using `yaml` or `.yaml` extension. + +```yaml +##### Extra Middlewares +middlewares: + # Enable Basic auth authorization based + - name: extra-basic-auth + # Authentication types | jwt, basic, OAuth + type: basic + paths: + - /user + - /admin + - /account + rule: + username: admin + password: admin + # The server will return 403 + - name: extra-api-forbidden-paths + type: access + ## prevents access paths + paths: + - /swagger-ui/* + - /v2/swagger-ui/* + - /api-docs/* + - /internal/* + - /actuator/* ``` \ No newline at end of file diff --git a/examples/configMap.yaml b/examples/configMap.yaml index 293a758..8f3aee5 100644 --- a/examples/configMap.yaml +++ b/examples/configMap.yaml @@ -13,15 +13,13 @@ data: readTimeout: 15 # Proxy idle timeout idleTimeout: 30 - ## SSL Certificate file - sslCertFile: '' #cert.pem - ## SSL Private Key file - sslKeyFile: ''#key.pem + ## TLS Certificate file + tlsCertFile: '' #cert.pem + ## TLS Private Key file + tlsKeyFile: ''#key.pem # Proxy rate limit, it's In-Memory IP based rateLimit: 0 logLevel: info # debug, trace, off - accessLog: "/dev/Stdout" - errorLog: "/dev/stderr" ## Redis connexion for distributed rate limiting, when using multiple instances | It's optional #redis: #addr: redis:6379 diff --git a/examples/extra-configs.yaml b/examples/extra-configs.yaml new file mode 100644 index 0000000..dcfc525 --- /dev/null +++ b/examples/extra-configs.yaml @@ -0,0 +1,51 @@ +##### Extra Middlewares +middlewares: + # Enable Basic auth authorization based + - name: extra-basic-auth + # Authentication types | jwt, basic, OAuth + type: basic + paths: + - /user + - /admin + - /account + rule: + username: admin + password: admin + # The server will return 403 + - name: extra-api-forbidden-paths + type: access + ## prevents access paths + paths: + - /swagger-ui/* + - /v2/swagger-ui/* + - /api-docs/* + - /internal/* + - /actuator/* +##### Extra routes +routes: + # Example of a route | 1 + - path: /extra + name: Extra # Name is optional + # host Domain/host based request routing + hosts: [] # Hosts are optional + ## Rewrite a request path + # e.g rewrite: /store to / + rewrite: / + destination: https://example.com + # Limit HTTP methods allowed for this route + methods: [POST, PUT, GET] + #disableHostFording proxy host forwarding + disableHostFording: false + # Route Cors, global cors will be overridden by route + cors: + # Route Origins Cors, route will override global cors origins + origins: + - https://dev.example.com + - http://localhost:3000 + - https://example.com + # Route Cors headers, route will override global cors headers + headers: + Access-Control-Allow-Methods: 'GET' + Access-Control-Allow-Headers: 'Origin, Authorization, Accept, Content-Type, Access-Control-Allow-Headers, X-Client-Id, X-Session-Id' + Access-Control-Allow-Credentials: 'true' + Access-Control-Max-Age: 1728000 \ No newline at end of file diff --git a/examples/kubernetes.yaml b/examples/kubernetes.yaml index 39017f5..0c07294 100644 --- a/examples/kubernetes.yaml +++ b/examples/kubernetes.yaml @@ -32,8 +32,8 @@ spec: httpGet: path: /readyz port: 8080 - initialDelaySeconds: 5 - periodSeconds: 10 + initialDelaySeconds: 15 + periodSeconds: 15 volumeMounts: - name: config mountPath: /etc/goma/