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

网络模式为IPVS时创建NOTEBOOK触发SVC创建失败 #7

Open
BorisPolonsky opened this issue Dec 24, 2024 · 1 comment
Open

网络模式为IPVS时创建NOTEBOOK触发SVC创建失败 #7

BorisPolonsky opened this issue Dec 24, 2024 · 1 comment

Comments

@BorisPolonsky
Copy link

BorisPolonsky commented Dec 24, 2024

当网络模式为IPVS时创建NOTEBOOK时,按照下述配置创建类型为NodePort的Service

service_type='ClusterIP' if conf.get('K8S_NETWORK_MODE','iptables')!='ipvs' else 'NodePort',

其中NodePort参数填写逻辑如下
if type(port)==list and len(port)>1:
service_ports.append(client.V1ServicePort(name='http%s'%index, node_port=int(port[0]) if service_type=='NodePort' else None, port=int(port[0]), protocol='TCP', target_port=int(port[1])))
else:
service_ports.append(client.V1ServicePort(name='http%s' % index, node_port=int(port) if service_type=='NodePort' else None, port=int(port), protocol='TCP', target_port=int(port)))

该逻辑不保证NodePort符合30000端口限制,导致用户创建Notebook(e.g. VSCODE(gpu))时平台SVC创建失败并在前端显示报错

@data-infra
Copy link
Owner

meet_ports = core.get_not_black_port(10000 + 10 * notebook.id)

notebook的端口范围是10000以上

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants