diff --git a/docs/04.Cloud-Native/4.1.Kubernetes-Ingress-Controller.md b/docs/04.Cloud-Native/4.1.Kubernetes-Ingress-Controller.md index 5f4bc3ecb9..8f53e158a8 100644 --- a/docs/04.Cloud-Native/4.1.Kubernetes-Ingress-Controller.md +++ b/docs/04.Cloud-Native/4.1.Kubernetes-Ingress-Controller.md @@ -7,6 +7,7 @@ - [Handle Ingresses within Specified K8s Namespaces](#handle-ingresses-within-specified-k8s-namespaces) - [Use a Customized Ingress Class](#use-a-customized-ingress-class) - [Deploy Outside of a K8s Cluster](#deploy-outside-of-a-k8s-cluster) + - [Additional Annotations](#additional-annotations) The IngressController is an implementation of [Kubernetes ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/), it watches Kubernetes Ingress, Service, Endpoints, and Secrets then translates them to Easegress HTTP server and pipelines. @@ -201,3 +202,53 @@ httpServer: keepAliveTimeout: 60s maxConnections: 10240 ``` + +### Additional Annotations + +When defining your `Ingress` configurations, you can use the following `easegress` specific annotations for added customization: + +- **Load Balancing**: `easegress.ingress.kubernetes.io/proxy-load-balance` +- **Header Hash Key for Load Balancing**: `easegress.ingress.kubernetes.io/proxy-header-hash-key` +- **Forwarding Key**: `easegress.ingress.kubernetes.io/proxy-forward-key` +- **Server Response Maximum Size**: `easegress.ingress.kubernetes.io/proxy-server-max-size` +- **Proxy Timeout**: `easegress.ingress.kubernetes.io/proxy-timeout` + +Please refer to the [Proxy Server Pool Spec](../07.Reference/7.02.Filters.md#proxyserverpoolspec) and [Load Balance Spec](../07.Reference/7.02.Filters.md#proxyloadbalancespec) to get the details of the corresponding annotations. + +These annotations provide additional configurations to optimize the behavior and performance of your ingress controllers in different scenario. + +```yaml +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ingress-example + annotations: + easegress.ingress.kubernetes.io/proxy-load-balance: "ipHash" + easegress.ingress.kubernetes.io/proxy-header-hash-key: "X-User-Id" + easegress.ingress.kubernetes.io/proxy-forward-key: "" + easegress.ingress.kubernetes.io/proxy-server-max-size: "12400" + easegress.ingress.kubernetes.io/proxy-timeout: "10s" +spec: + ingressClassName: easegress + rules: + - host: "www.example.com" + http: + paths: + - pathType: Prefix + path: / + backend: + service: + name: hello-service + port: + number: 60001 + - host: "*.megaease.com" + http: + paths: + - pathType: Prefix + path: / + backend: + service: + name: hello-service + port: + number: 60002 +```