Skip to content

Commit

Permalink
Add annotations docs for ingress controller (#1117)
Browse files Browse the repository at this point in the history
* Add annotations docs for ingress controller

* Add ingress example

* Use yaml format
  • Loading branch information
xxx7xxxx committed Nov 1, 2023
1 parent 378b7e8 commit 202f38e
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions docs/04.Cloud-Native/4.1.Kubernetes-Ingress-Controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
```

0 comments on commit 202f38e

Please sign in to comment.