From 249b81a460516eed1905b0ca5dea6af1d2bec9cd Mon Sep 17 00:00:00 2001 From: Cesar Celis Hernandez Date: Tue, 24 Dec 2024 15:40:45 -0600 Subject: [PATCH] Add Documentation for Replication Using a Load Balancer --- docs/nginx-ingress.md | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/docs/nginx-ingress.md b/docs/nginx-ingress.md index 672ce3bfb38..e0b88cea461 100644 --- a/docs/nginx-ingress.md +++ b/docs/nginx-ingress.md @@ -131,3 +131,58 @@ spec: port: number: 9443 ``` + +### Replication configuration: + +Sometimes, you need to configure timeout in order to avoid Load Balancer to kill the connection while replication is taking place, for that, we can configure a read/write timeout of X minutes in the provided load balancer, you can add the appropriate NGINX annotations to your ingress configuration under `metadata.annotations`. The relevant annotations are: + +* `nginx.ingress.kubernetes.io/proxy-read-timeout`: Controls how long the NGINX load balancer waits for a response from the backend. + +* `nginx.ingress.kubernetes.io/proxy-send-timeout`: Controls how long the NGINX load balancer waits to send a request to the backend. + +Here is the updated ingress configuration: + +```yaml +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ingress-minio + namespace: tenant1-ns + annotations: + kubernetes.io/ingress.class: "nginx" + ## Remove if using CA signed certificate + nginx.ingress.kubernetes.io/proxy-ssl-verify: "off" + nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/proxy-body-size: "0" + nginx.ingress.kubernetes.io/server-snippet: | + client_max_body_size 0; + nginx.ingress.kubernetes.io/configuration-snippet: | + chunked_transfer_encoding off; + nginx.ingress.kubernetes.io/proxy-read-timeout: "60s" + nginx.ingress.kubernetes.io/proxy-send-timeout: "60s" +spec: + tls: + - hosts: + - minio.example.com + secretName: nginx-tls + rules: + - host: minio.example.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: minio + port: + number: 443 +``` + +> Explanation: + +* `proxy-read-timeout`: Ensures that NGINX waits for 60 seconds for a response from the MinIO backend before timing out. + +* `proxy-send-timeout`: Ensures that NGINX waits for 60 seconds for data to be sent to the MinIO backend before timing out. + +Apply the updated configuration using `kubectl apply -f .yaml`. This will set the desired timeouts for read and write operations.