-
Notifications
You must be signed in to change notification settings - Fork 82
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 a pod mutating webhook to auto inject the pod network resources #4179
Conversation
bd40d6a
to
5eb5a2a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4179 +/- ##
==========================================
- Coverage 80.34% 79.21% -1.13%
==========================================
Files 51 52 +1
Lines 5637 5899 +262
==========================================
+ Hits 4529 4673 +144
- Misses 941 1053 +112
- Partials 167 173 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
f0c5d90
to
5effe3c
Compare
5effe3c
to
b421dd1
Compare
b421dd1
to
c1bcc2d
Compare
c1bcc2d
to
a4ca744
Compare
a4ca744
to
d5119ca
Compare
@@ -214,7 +214,9 @@ | |||
|
|||
3. 创建 CNI 配置和对应的 ippool 资源 |
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.
1 不建议 修改 保底方案,而是开一个小节 单独说明 新的方式
2 没看到 helm 安装 要开 开关
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.
没看到 webhook 的 namespace 级别的 安装 或者 配置选项 ?
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.
希望把过滤 namespace 列表作为可配选项么?
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 value 和 configmap 暴露,可调
pkg/constant/k8s.go
Outdated
@@ -51,7 +51,8 @@ const ( | |||
) | |||
|
|||
const ( | |||
AnnotationPre = "ipam.spidernet.io" | |||
AnnotationPre = "ipam.spidernet.io" |
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.
key prefix 是否定义太多了,或者尽量复用
spidernet.io/...... 就够了, 前缀是一个组织名 ,一个后缀足以区分出不同的功能
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.
只是觉得 ipam.spidernet.io 不太恰当,就 spidernet.io 比较合适
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.
其实 spidernet.io/**** 就完事了,基于目前已经发出去的版本,可以只保留两个
ipam.spidernet.io/***
cni.spidernet.io/***
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.
以前老的保留,以后新的都统一为:spidernet.io
pkg/constant/k8s.go
Outdated
|
||
// webhook | ||
PodMutatingWebhookName = "pods.spiderpool.spidernet.io" | ||
AnnoMutatingPodWebhook = AnnotationSpinderPre + "/multus-config-label" |
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.
multus-config-label -》 resource-inject-key
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.
done
--- | ||
apiVersion: spiderpool.spidernet.io/v2beta1 | ||
kind: SpiderMultusConfig | ||
metadata: | ||
name: gpu1-macvlan | ||
namespace: spiderpool | ||
labels: | ||
shared-rdma-gpu: "" |
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.
这个 label 不应该是这么打的。从其它项目的实践来说, 它应该是
pod 打
netresources.spidernet.io/resource-inject-key: myKeyName
SpiderMultusConfig 打
netresources.spidernet.io/resource-inject-key: myKeyName
为什么呢?应该双方应该都应该用 netresources.spidernet.io/resource-inject-key 作为key 名,这样这不至于 和 其它项目相互污染,也才看那名字知道 这个 annotation 是什么用途
spidernet.io/shared_cx5_gpu7: 1 | ||
spidernet.io/shared_cx5_gpu8: 1 | ||
#nvidia.com/gpu: 1 | ||
netresources.spidernet.io/multus-config-label: shared-rdma-gpu |
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.
可以考虑2 个
netresources.spidernet.io/resource-inject-key: myKeyName
netresources.spidernet.io/resource-inject-amount: 1 (default,默认可不写)
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.
resource-inject-amount: 1
是网卡数量还是 resources 的值?感觉是后者,但似乎没必要?什么场景会有 大于 1 的需求?
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.
是否是之前谈到的 gpu 和 nic 亲和性的实现时可能需要
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.
cc @weizhoublue
d5119ca
to
44052c3
Compare
44052c3
to
b1dd917
Compare
b1dd917
to
2781a85
Compare
52fa66c
to
575918c
Compare
575918c
to
31ecc38
Compare
如果 multusconfig 配置中没有 rdma resource, 是否也能 正常工作 ? |
31ecc38
to
07e167f
Compare
07e167f
to
da165ea
Compare
da165ea
to
1b7ab43
Compare
1b7ab43
to
59f02fd
Compare
59f02fd
to
d1e6936
Compare
d1e6936
to
425bde6
Compare
425bde6
to
394c80c
Compare
394c80c
to
c183d54
Compare
Signed-off-by: cyclinder <[email protected]>
c183d54
to
c997b6c
Compare
spidernet.io/gpu6sriov: 1 | ||
spidernet.io/gpu7sriov: 1 | ||
spidernet.io/gpu8sriov: 1 | ||
#nvidia.com/gpu: 1 |
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.
这行 不应该出现
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.
以后PR 改
Thanks for contributing!
Notice:
"release/none"
"release/bug"
"release/feature"
What issue(s) does this PR fix:
Fixes #4177
Special notes for your reviewer: