-
Notifications
You must be signed in to change notification settings - Fork 76
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
title: support host-device cni #3327
Conversation
Signed-off-by: GreatLazyMan <dongweiguo_yewu@cmss.chinamobile.com>
Signed-off-by: GreatLazyMan <dongweiguo_yewu@cmss.chinamobile.com>
Signed-off-by: GreatLazyMan <dongweiguo_yewu@cmss.chinamobile.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3327 +/- ##
==========================================
- Coverage 81.68% 81.12% -0.56%
==========================================
Files 50 50
Lines 5372 5372
==========================================
- Hits 4388 4358 -30
- Misses 823 856 +33
+ Partials 161 158 -3
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! @GreatLazyMan.
Could you mind adding some e2e tests for this? you can refer to
It("testing creating spiderMultusConfig with cniType: ipvlan and checking the net-attach-conf config if works", Label("M00002"), func() { |
Also, After you test the host-device plugin in your local, you can update the docs :)
// +kubebuilder:validation:Optional | ||
HWAddr string `json:"hwAddr,omitempty"` | ||
// +kubebuilder:validation:Optional | ||
DPDKMode bool `json:"enableDPDK,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need DPDKMode
, this field can't be configured. The host-device plugin can detect it is in DPDK mode automatically by checking the Device's driver. see https://github.com/containernetworking/plugins/blob/c860b78de419336c418fee93fc5cf0f6c9b115ba/plugins/main/host-device/host-device.go#L113.
netConf.IPAM = &spiderpoolcmd.IPAMConfig{ | ||
Type: constant.Spiderpool, | ||
} | ||
if multusConfSpec.OvsConfig.SpiderpoolConfigPools != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: OvsConfig -> HostDeviceConfig
Type string `json:"type"` | ||
Device string `json:"deviceName,omitempty"` | ||
HWAddr string `json:"hwAddr,omitempty"` | ||
DPDKMode bool `json:"enableDPDK,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also need remove this
```bash | ||
helm repo add spiderpool https://spidernet-io.github.io/spiderpool | ||
helm repo update spiderpool | ||
helm install spiderpool spiderpool/spiderpool --namespace kube-system --set multus.multusCNI.defaultCniCRName="host-device-conf" --set plugins.installHostDeviceCNI=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove --set plugins.installHostDeviceCNI=true
because --install-cni
would install the whole cni-plugins including host-device
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helm install spiderpool spiderpool/spiderpool --namespace kube-system --set multus.multusCNI.defaultCniCRName="host-device-conf" --set plugins.installHostDeviceCNI=true | ||
``` | ||
|
||
> 如果未安装 host-device-cni, 可以通过 Helm 参数 '-set plugins.installHostDeviceCNI=true' 安装它。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
{ | ||
"ipv4": ["ippool-test"] | ||
} | ||
v1.multus-cni.io/default-network: kube-system/host-device-conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need a SpiderMultusConfig object for host-device
, just follow
spiderpool/docs/usage/install/underlay/get-started-macvlan.md
Lines 95 to 108 in da3d6d9
MACVLAN_MASTER_INTERFACE="eth0" | |
cat <<EOF | kubectl apply -f - | |
apiVersion: spiderpool.spidernet.io/v2beta1 | |
kind: SpiderMultusConfig | |
metadata: | |
name: macvlan-conf | |
namespace: kube-system | |
spec: | |
cniType: macvlan | |
macvlan: | |
master: | |
- ${MACVLAN_MASTER_INTERFACE} | |
EOF | |
``` |
|
||
* 如果你使用 Underlay 模式,`coordinator` 会在主机上创建 veth 接口,为了防止 NetworkManager 干扰 veth 接口, 导致 Pod 访问异常。我们需要配置 NetworkManager,使其不纳管这些 Veth 接口。 | ||
|
||
* 如果你通过 `Iface`r 创建 Vlan 和 Bond 接口,NetworkManager 可能会干扰这些接口,导致 Pod 访问异常。我们需要配置 NetworkManager,使其不纳管这些 Veth 接口。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these description is not suitable for host device case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
通过 Iface
r
---》
通过 Ifacer
@GreatLazyMan could you update the PR according to the comments ? thanks |
BTW, it needs E2E cases to make sure the feature |
This pull request has been automatically marked as stale because it |
This pull request has not seen any activity since it was marked stale. |
Thanks for contributing!
What type of PR is this?
What this PR does / why we need it:
support host-device cni
Which issue(s) this PR fixes:
Fixes #3303
Special notes for your reviewer: