Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop: update docs #28

Merged
merged 5 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/en_us/FAQ/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

|Argument | Default value | Description|
| --- | --- | --- |
| --namespace <br> -n | Null | Specify in which namespaces BFE Ingress Controller will monitor Ingress. Multiple namespaces are seperated by `,`. <br>Default value means to monitor all namespaces. |
| --namespace <br> -n | Empty String | Specify in which namespaces BFE Ingress Controller will monitor Ingress. Multiple namespaces are seperated by `,`. <br>Default value is empty string which means to monitor all namespaces. |
| --ingress-class| bfe | Specify the `kubernetes.io/ingress.class` value of Ingress it monitors. <br>If not specified, BFE Ingress Controller monitors the Ingress with ingress class set as "bfe". Usually you don't need to specify it. |
| --default-backend| Null | Specify name of default backend service, in the format of `namespace/name`.<br>If specified, requests that match no Ingress rule will be forwarded to the service specified. |
| --default-backend| Empty String | Specify name of default backend service, in the format of `namespace/name`.<br>If specified, requests that match no Ingress rule will be forwarded to the service specified. |

How to define:
Define in config file of BFE Ingress Controller, like [controller.yaml](../../../examples/controller.yaml). Example:
Expand Down
13 changes: 7 additions & 6 deletions docs/en_us/contribute/contribute-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ Below tutorial will guide you to submit code
$ git commit -m "test=release/1.1"
```

1. Keep local repository up-to-date
8. Keep local repository up-to-date

1. An experienced Git user pulls from the official repo often -- daily or even hourly, so they notice conflicts with others work early, and it's easier to resolve smaller conflicts.
An experienced Git user pulls from the official repo often -- daily or even hourly, so they notice conflicts with others work early, and it's easier to resolve smaller conflicts.

```bash
git remote add upstream https://github.com/bfenetworks/bfe
git pull upstream develop
```
```bash
git remote add upstream https://github.com/bfenetworks/ingress-bfe
git fetch upstream
git pull upstream develop
```

10. Push to remote repository

Expand Down
8 changes: 4 additions & 4 deletions docs/en_us/ingress/conflict.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Route Rule Conflict

## Definition
If Ingress configuration is created with Ingress resources containing the same Ingress rule (host, path and advanced conditions are all the same), a route rule conflict happens.
If Ingress configurations will create Ingress resources containing at least one identical Ingress rule (host, path and advanced conditions are all the same), a route rule conflict happens.

## Conflict handling: first-created-resource-win principle

For those Ingress resources with route rule conflict, BFE Ingress Controller will follow first-created-resource-win principle and only takes the first created Ingress resource as valid.

This principle will be followed when route rule conflict happens within a namespace or among different namespaces.
This principle will be followed when route rule conflict happens within a namespace or across different namespaces.

For those Ingress resources invalid due to route rule conflict, error messages will be written to its annotation, see [Ingress Status](validate-state.md).
For those invalid Ingress resources due to route rule conflict, error messages will be written to its annotation, see [Ingress Status](validate-state.md).

## Example

Expand Down Expand Up @@ -54,7 +54,7 @@ spec:
In above configuration, there is conflict between ingress-A and ingress-B, and ingress-A is created before ingress-B. So only ingress-A will been created and take effect.

## Ingress status feedback
If a Ingress resource is ignored (not take effect) due to route rule conflict, after the ingress status is written back, the `status` in `annotation` will be set as “fail”, and `message` will tell which Ingress resource it has conflict with.
If an Ingress resource is invalid due to route rule conflict, after the ingress status is written back, the `status` in `annotation` will be set as “fail”, and `message` will tell which Ingress resource it has conflict with.

In previous example, `annotation` for ingress status will be like:

Expand Down
22 changes: 11 additions & 11 deletions docs/en_us/ingress/priority.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Priority of route rules
If a request matches multiple ingress rules, BFE Ingress Controller will decide which rule will be hit according to below strategies:

- Compare the hostname and select the rule with more precise hostname;
- If hostname is identical, select the rule with more precise path;
- If both hostname and path are identical, select the rule with more matching advanced conditions;
- If all the above rules fails, select the rule which matches an advanced condition of higher priority
- in advanced match condition, Cookie condition has higher priority than Header condition;
- Compare the hostname and select the rule with most precise hostname;
- If more than one rule is selected in the above step, select the rule with most precise path;
- If more than one rule is selected in the above step, select the rule with most advanced conditions;
- If more than one rule is selected in the above step, select the rule which matches an advanced condition of higher priority
- in advanced condition, Cookie condition has higher priority than Header condition;

## Examples
### Hostname precision first
Expand Down Expand Up @@ -44,7 +44,7 @@ spec:
serviceName: service2
servicePort: 80
```
In above example, for requests generated by `curl "http://example.net/bar"`, rule with name `host_priority1` will be hit.
In above example, for requests generated by `curl "http://example.net/bar"`, the rule in ingress `host_priority1` will be hit.

### Path precision first when hostname are identical
```yaml
Expand Down Expand Up @@ -83,9 +83,9 @@ spec:
serviceName: service2
servicePort: 80
```
In above example, for requests generated by `curl "http://example.net/bar/foo" -H "Key: value"`, rule with name `path_priority1` will be hit
In above example, for requests generated by `curl "http://example.net/bar/foo" -H "Key: value"`, the rule in ingress `path_priority1` will be hit

### More matched advanced condition first, when hostname and path both identical
### More advanced condition first, when hostname and path both identical
```yaml
kind: Ingress
apiVersion: networking.k8s.io/v1beta1
Expand Down Expand Up @@ -123,9 +123,9 @@ spec:
serviceName: service2
servicePort: 80
```
In above example, for requests generated by `curl "http://example.net/bar/foo" -H "Key: value"`, rule with name `cond_priority1` will be hit
In above example, for requests generated by `curl "http://example.net/bar/foo" -H "Key: value"`, the rule in ingress `cond_priority1` will be hit

### Matched advanced condition with higher priority first, when above criteria are the same
### Matched advanced condition with higher priority first, when multiple rules meet above criteria
```yaml
kind: Ingress
apiVersion: networking.k8s.io/v1beta1
Expand Down Expand Up @@ -163,5 +163,5 @@ spec:
serviceName: service2
servicePort: 80
```
In above example, for requests generated by `curl "http://example.net/bar/foo" -H "Header-key: value" --cookie "cookie-key: value"`, rule with name `multi_cond_priority2` will be hit, for `Cookie` condition has higher priority than `Header` condition.
In above example, for requests generated by `curl "http://example.net/bar/foo" -H "Header-key: value" --cookie "cookie-key: value"`, the rule in ingress `multi_cond_priority2` will be hit, because `Cookie` condition has higher priority than `Header` condition.

4 changes: 2 additions & 2 deletions docs/en_us/ingress/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BFE Ingress Controller manages TLS certificates and secretes in the way defined

TLS certificates and secretes are stored in `Secret`. See examples below:

**Configurate Secret**
**Configure Secret**

```yaml
apiVersion: v1
Expand All @@ -16,7 +16,7 @@ data:
tls.key: base64 encoded key
type: kubernetes.io/tls
```
**Configurate Ingress**
**Configure Ingress**
```yaml
apiVersion: networking.k8s.io/v1beta1
Expand Down
4 changes: 2 additions & 2 deletions docs/zh_cn/FAQ/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

选项 | 默认值 | 用途|
| --- | --- | --- |
| --namespace <br> -n | | 设置需监听的ingress所在的namespace,多个namespace 之间用`,`分割。<br>默认监听所有的 namespace。 |
| --namespace <br> -n | 空字符串 | 设置需监听的ingress所在的namespace,多个namespace 之间用`,`分割。<br>默认值为空字符串,表示监听所有的 namespace。 |
| --ingress-class| bfe | 指定需监听的Ingress的`kubernetes.io/ingress.class`值。<br>如不指定,BFE Ingress Controller将监听class设置为bfe的Ingress。 通常无需设置。 |
| --default-backend| | 指定default-backend服务的名字,格式为`namespace/name`。<br>如指定default-backend,没有命中任何Ingress规则的请求,将被转发到default-backend。 |
| --default-backend| 空字符串 | 指定default-backend服务的名字,格式为`namespace/name`。<br>如指定default-backend,没有命中任何Ingress规则的请求,将被转发到default-backend。 |

设置方式:
在BFE Ingress Controller的部署文件[controller.yaml](../../../examples/controller.yaml)中指定。例如:
Expand Down