Skip to content

Commit

Permalink
docs: improve hw-offload
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Sep 25, 2020
1 parent 3e28972 commit 0e0a688
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
4 changes: 2 additions & 2 deletions dist/images/install-pre-1.16.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -euo pipefail
IPv6=${IPv6:-false}
ENABLE_SSL=${ENABLE_SSL:-false}
ENABLE_MIRROR=${ENABLE_MIRROR:-false}
HW_OFFLOAD=${HW_OFFLOAD:-false}
IFACE="" # The nic to support container network, if empty will use the nic that the default route use

REGISTRY="kubeovn"
NAMESPACE="kube-system" # The ns to deploy kube-ovn
Expand All @@ -22,11 +24,9 @@ fi

EXCLUDE_IPS="" # EXCLUDE_IPS for default subnet
LABEL="node-role.kubernetes.io/master" # The node label to deploy OVN DB
IFACE="" # The nic to support container network, if empty will use the nic that the default route use
NETWORK_TYPE="geneve" # geneve or vlan
VERSION="v1.5.0"
IMAGE_PULL_POLICY="IfNotPresent"
HW_OFFLOAD="false"

# VLAN Config only take effect when NETWORK_TYPE is vlan
PROVIDER_NAME="provider"
Expand Down
4 changes: 2 additions & 2 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -euo pipefail
IPv6=${IPv6:-false}
ENABLE_SSL=${ENABLE_SSL:-false}
ENABLE_MIRROR=${ENABLE_MIRROR:-false}
HW_OFFLOAD=${HW_OFFLOAD:-false}
IFACE="" # The nic to support container network, if empty will use the nic that the default route use

REGISTRY="kubeovn"
NAMESPACE="kube-system" # The ns to deploy kube-ovn
Expand All @@ -22,11 +24,9 @@ fi

EXCLUDE_IPS="" # EXCLUDE_IPS for default subnet
LABEL="node-role.kubernetes.io/master" # The node label to deploy OVN DB
IFACE="" # The nic to support container network, if empty will use the nic that the default route use
NETWORK_TYPE="geneve" # geneve or vlan
VERSION="v1.5.0"
IMAGE_PULL_POLICY="IfNotPresent"
HW_OFFLOAD="false"

# VLAN Config only take effect when NETWORK_TYPE is vlan
PROVIDER_NAME="provider"
Expand Down
41 changes: 24 additions & 17 deletions docs/hw-offload.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ By taking use of SR-IOV technology we can achieve low network latency and high t

## Installation Guide

### Install Kube-OVN with hw-offload mode enabled
1. Download latest install script
```bash
`wget https://raw.githubusercontent.com/alauda/kube-ovn/master/dist/images/install.sh`
```
2. Edit the install script, enable hw-offload, disable traffic mirror and set the IFACE to the PF.
Make sure that there is a ip address bind to the PF.
```bash
ENABLE_MIRROR=${ENABLE_MIRROR:-false}
HW_OFFLOAD=${HW_OFFLOAD:-true}
IFACE="ensp01"
```

3. Install Kube-OVN
```bash
bash install.sh
```

### Setting Up SR-IOV
1. Find the device id of ConnectX-5 device, below is `42:00.0`
```bash
Expand Down Expand Up @@ -114,6 +132,9 @@ data:
```

2. Follow [SR-IOV Device Plugin](https://github.com/intel/sriov-network-device-plugin) to deploy device plugin.
```bash
kubectl apply -f https://raw.githubusercontent.com/intel/sriov-network-device-plugin/master/deployments/k8s-v1.16/sriovdp-daemonset.yaml
```

3. Check if SR-IOV devices have been discovered by device plugin
```bash
Expand All @@ -125,6 +146,9 @@ mellanox.com/cx5_sriov_switchdev 0 0
```
### Install Multus-CNI
1. Follow [Multus-CNI](https://github.com/intel/multus-cni/) to deploy Multus-CNI
```bash
kubectl apply -f https://raw.githubusercontent.com/intel/multus-cni/master/images/multus-daemonset.yml
```

2. Create a NetworkAttachmentDefinition
```yaml
Expand Down Expand Up @@ -152,24 +176,7 @@ spec:
]
}'
```
### Enable HardwareOffload in Kube-OVN
Update ovs-ovn daemonset and set the HW_OFFLOAD env to true and delete exist pods to redeploy.

```yaml
spec:
containers:
- command:
- /kube-ovn/start-ovs.sh
env:
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: HW_OFFLOAD
value: "true"
image: kubeovn/kube-ovn:v1.4.0
```
### Create Pod with SR-IOV
```yaml
apiVersion: v1
Expand Down

0 comments on commit 0e0a688

Please sign in to comment.