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

add annotations #168

Merged
merged 3 commits into from
Jun 12, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
npm install -g markdownlint-cli
npm install -g [email protected]
pwd
markdownlint "**/*.md" --disable MD013 MD033 MD045 MD024 MD041 -r markdownlint-rule-search-replace
markdownlint "**/*.md" --disable MD013 MD033 MD045 MD024 MD041 MD029 MD051 -r markdownlint-rule-search-replace
markdownlint -V
5 changes: 4 additions & 1 deletion docs/advance/offload-yunsilicon.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ bash install.sh
```

### Setting Up SR-IOV

1. Find the device id of metaScale device, below is `b3:00.0`

```shell
Expand Down Expand Up @@ -116,6 +117,7 @@ systemctl disable NetworkManager
### Install SR-IOV Device Plugin

1. Create a ConfigMap that defines SR-IOV resource pool configuration

```yaml
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -149,6 +151,7 @@ data:
```

### Install Multus-CNI

1. Follow [Multus-CNI](https://github.com/k8snetworkplumbingwg/multus-cni) to deploy Multus-CNI

```bash
Expand Down Expand Up @@ -218,4 +221,4 @@ recirc_id(0),in_port(8),packet_type(ns=0,id=0),eth(src=00:00:00:ce:cf:b9/01:00:0
ct_state(-new+est-rel+rpl+trk),ct_mark(0/0x1),recirc_id(0x2d278),in_port(15),packet_type(ns=0,id=0),eth(dst=00:00:00:ce:cf:b9/01:00:00:00:00:00),eth_type(0x0800),ipv4(frag=no), packets:6, bytes:588, used:7.277s, actions:8
```

You can find some flows if all works well.
You can find some flows if all works well.
8 changes: 5 additions & 3 deletions docs/advance/offload-yunsilicon.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ devlink dev eswitch set pci/0000:b3:00.0 mode switchdev
### 安装 SR-IOV Device Plugin

1. 创建 SR-IOV 资源 ConfigMap:

```yaml
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -140,6 +140,7 @@ data:
```

### 安装 Multus-CNI

1. 参考 [Multus-CNI](https://github.com/k8snetworkplumbingwg/multus-cni) 来部署 Multus-CNI

```bash
Expand Down Expand Up @@ -195,11 +196,12 @@ spec:
limits:
yunsilicon.com/xsc_sriov: '1'
```

### Offload 验证

可通过在 Pod 运行节点的 `ovs-ovn` 容器中运行下面的命令观察卸载是否成功:

```bash
```bash
ovs-appctl dpctl/dump-flows type=offloaded
flow-dump from pmd on cpu core: 9
ct_state(-new+est-rel+rpl+trk),ct_mark(0/0x3),recirc_id(0x2d277),in_port(15),packet_type(ns=0,id=0),eth(src=00:00:00:9d:fb:1a,dst=00:00:00:ce:cf:b9),eth_type(0x0800),ipv4(dst=10.16.0.14,frag=no), packets:6, bytes:588, used:7.276s, actions:ct(zone=4,nat),recirc(0x2d278)
Expand All @@ -210,4 +212,4 @@ recirc_id(0),in_port(8),packet_type(ns=0,id=0),eth(src=00:00:00:ce:cf:b9/01:00:0
ct_state(-new+est-rel+rpl+trk),ct_mark(0/0x1),recirc_id(0x2d278),in_port(15),packet_type(ns=0,id=0),eth(dst=00:00:00:ce:cf:b9/01:00:00:00:00:00),eth_type(0x0800),ipv4(frag=no), packets:6, bytes:588, used:7.277s, actions:8
```

如果有流表内容证明卸载成功。
如果有流表内容证明卸载成功。
5 changes: 3 additions & 2 deletions docs/guide/qos.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,6 @@ Pod can use annotation below to config `linux-netem` type QoS: `ovn.kubernetes
> yum install -y kernel-modules-extra && modprobe sch_netem

- `ovn.kubernetes.io/latency`: Set the Pod traffic delay to an integer value in ms.
- `ovn.kubernetes.io/limit`: Set the maximum number of packets that the `qdisc` queue can hold, and takes an integer value, such as 1000.
- `ovn.kubernetes.io/loss`: Set packet loss probability, the value is float type, for example, the value is 20, then it is set 20% packet loss probability.
- `ovn.kubernetes.io/jitter`: Set the Pod traffic jitter to an integer value in ms.
- `ovn.kubernetes.io/limit`: Set the maximum number of packets that the `qdisc` queue can hold, and takes an integer value, such as 1000.
- `ovn.kubernetes.io/loss`: Set packet loss probability, the value is float type, for example, the value is 20, then it is set 20% packet loss probability.
1 change: 1 addition & 0 deletions docs/guide/qos.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@ Pod 可以使用如下 annotation 配置 `linux-netem` 类型 QoS: `ovn.kubern
`ovn.kubernetes.io/loss`。

- `ovn.kubernetes.io/latency`:设置 Pod 流量延迟,取值为整数,单位为 ms。
- `ovn.kubernetes.io/jitter`:设置 Pod 流量延迟抖动,取值为整数,单位为 ms。
- `ovn.kubernetes.io/limit`: 为 `qdisc` 队列可容纳的最大数据包数,取值为整形数值,例如 1000。
- `ovn.kubernetes.io/loss`: 为设置的报文丢包概率,取值为 float 类型,例如取值为 20,则为设置 20% 的丢包概率。
79 changes: 79 additions & 0 deletions docs/reference/annotations.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Annotation Usage

Kube-OVN uses a large number of Pod and Node Annotations for configuring functionality and transferring information. Users can refer to this document to understand the usage of each Annotation, to better troubleshooting and information retrieval.

> Note: Some Annotations may change as the code is adjusted.

## Pod Annotation

| Key | Value | Description |
| -------------------------------------- | ------------------------------- | ------------------------------------------------------------------------------- |
| ovn.kubernetes.io/allocated | `true` or `false` | If the Pod primary interface has already been allocated an address |
| ovn.kubernetes.io/routed | `true` or `false` | If the Pod primary interface has already been allocated a route |
| ovn.kubernetes.io/mac_address | String | MAC address allocated to Pod primary interface,when creating a Pod, you can set a fixed MAC address by this Annotation |
| ovn.kubernetes.io/ip_address | String | IP address allocated to Pod primary interface,when creating a Pod, you can set a fixed IP address by this Annotation |
| ovn.kubernetes.io/cidr | String | Subnet CIDR that the Pod primary interface belongs to |
| ovn.kubernetes.io/gateway | String | Subnet Gateway address that the Pod primary interface belongs to |
| ovn.kubernetes.io/ip_pool | IP list, separated by comma | Pod primary interface will choose address from this list, used for workload fix address |
| ovn.kubernetes.io/bgp | `true` or `false` | Enable Pod address BGP advertisement 址 |
| ovn.kubernetes.io/snat | String | SNAT address for accessing external address |
| ovn.kubernetes.io/eip | String | EIP address that Pod accesses external clusters and is accessed from external. |
| ovn.kubernetes.io/vip | String | VIP allocated to Pod primary interface |
| ovn.kubernetes.io/virtualmachine | String | The VirtualMachineInstance that the Pod primary interface belongs to |
| ovn.kubernetes.io/logical_router | String | The VPC that the Pod primary interface belongs to |
| ovn.kubernetes.io/layer2_forward | `true` or `false` | Enable add `unknown` address to Pod primary interface in OVN NorthboundDB LSP |
| ovn.kubernetes.io/port_security | `true` or `false` | Enable Pod primary interface port security |
| ovn.kubernetes.io/logical_switch | String | The Subnet that the Pod primary interface belongs to |
| ovn.kubernetes.io/vlan_id | Int | The VlanID that the Pod primary interface belongs to |
| ovn.kubernetes.io/ingress_rate | Int | Pod primary interface ingress rate limit, measured in Mbits/s |
| ovn.kubernetes.io/egress_rate | Int | Pod primary interface egress rate limit, measured in Mbits/s |
| ovn.kubernetes.io/security_groups | String list, separated by comma | The SecurityGroup that the Pod primary interface belongs to |
| ovn.kubernetes.io/allow_live_migration | `true` or `false` | Allow live migration for Pod primary interface, used by KubeVirt |
| ovn.kubernetes.io/default_route | `true` or `false` | Set the default route to the Pod primary interface. |
| ovn.kubernetes.io/provider_network | String | The ProviderNetwork that the Pod primary interface belongs to |
| ovn.kubernetes.io/mirror | `true` or `false` | Enable Pod primary interface traffic mirror |
| ovn.kubernetes.io/latency | Int | The delay injected to the Pod primary interface card, measured in milliseconds |
| ovn.kubernetes.io/limit | Int | Maximum number of packets that the qdisc queue of the primary interface of the Pod |
| ovn.kubernetes.io/loss | Float | The probability of packet loss on the Pod primary interface |
| ovn.kubernetes.io/jitter | Int | The jitter of packet latency on the Pod primary interface, measured in milliseconds |

## Node Annotation

| Key | Value | Description |
| ---------------------------------- | ----------------- | -------------------------------------------------------------------------- |
| ovn.kubernetes.io/allocated | `true` or `false` | If the `ovn0` interface has already been allocated an address |
| ovn.kubernetes.io/ip_address | String | IP address allocated to `ovn0` interface |
| ovn.kubernetes.io/mac_address | String | MAC address allocated to `ovn0` interface |
| ovn.kubernetes.io/cidr | String | Subnet CIDR that the node `ovn0` interface belongs to |
| ovn.kubernetes.io/gateway | String | Subnet gateway that the node `ovn0` interface belongs to |
| ovn.kubernetes.io/chassis | String | The Chassis ID in OVN-SouthBoundDB that the node belongs to |
| ovn.kubernetes.io/port_name | String | The LSP name in OVN-NorthboundDB that the node `ovn0` interface belongs to |
| ovn.kubernetes.io/logical_switch | String | Subnet that the node `ovn0` interface belongs to |
| ovn.kubernetes.io/tunnel_interface | String | Network interface used for tunnel encapsulation |

## Namespace Annotation

| Key | Value | Description |
| ----------------------------- | --------------------------------------- | ------------------------------------------------- |
| ovn.kubernetes.io/cidr | CIDR list, separated by comma | The CIDRs of subnets bound by this Namespace |
| ovn.kubernetes.io/exclude_ips | excludeIPs list, separated by semicolon | The excludeIPs of subnets bound by this Namespace |

## Subnet Annotation

| Key | Value | Description |
| --------------------- | ----------------- | --------------------------------------- |
| ovn.kubernetes.io/bgp | `true` or `false` | Enable Subnet address BGP advertisement |

## Service Annotation

| Key | Value | Description |
| ------------------------------- | ----------------- | --------------------------------------------------------- |
| ovn.kubernetes.io/bgp | `true` or `false` | Enable Service address BGP advertisement |
| ovn.kubernetes.io/switch_lb_vip | String | Additional VIP addresses assigned to Service in Kube-OVN. |
| ovn.kubernetes.io/vpc | String | The VPC that the Service belongs to |

## Networkpolicy Annotation

| Key | Value | Description |
| ---------------------------- | ----------------- | ------------------------ |
| ovn.kubernetes.io/enable_log | `true` or `false` | Enable NetworkPolicy log |
Loading
Loading