-
Notifications
You must be signed in to change notification settings - Fork 71
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
fix: 修复容器项目未创建ebpf仪表盘&请求k8sclient超时、404、403日志内容缩短 --bug=117685795 #385
fix: 修复容器项目未创建ebpf仪表盘&请求k8sclient超时、404、403日志内容缩短 --bug=117685795 #385
Conversation
@@ -32,7 +32,8 @@ class Meta: | |||
|
|||
|
|||
class ClusterRelation(models.Model): | |||
bk_biz_id = models.IntegerField("业务id") | |||
bk_biz_id = models.IntegerField("集群关联的BKCC业务id") | |||
bkm_biz_id = models.IntegerField("监控的容器项目业务ID") |
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.
bk_biz_id、bkm_biz_id这两个名字有点混淆,实际bkm_biz_id是存储的bk_biz_id数据,bkm_biz_id存储的是关联业务ID,建议取名修改为
bk_biz_id -> related_bk_biz_id
bkm_biz_id -> bk_biz_id
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.
已调整
@@ -118,6 +118,31 @@ def perform_request(self, validated_request_data): | |||
] | |||
|
|||
|
|||
class GetProjectK8sClustersResource(BcsClusterManagerBaseResource): | |||
"""获取项目下的非共享的K8S集群信息, 返回必要数据""" |
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取名有点问题,并没有说明不包含共享集群。对于使用的人有些迷惑,有两种改法
- 修改名称,指明返回内容不包含共享的集群
- 增加参数,带上是否包含共享集群的参数
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.
已调整 GetProjectK8sClustersResource -》 GetProjectK8sNonSharedClustersResource
if self._check_deployment(content): | ||
logger.info( | ||
f"[DeepflowInstaller] (cluster: {self.cluster_id})found valid deployment: {content.name}" | ||
with concurrent.futures.ThreadPoolExecutor() as executor: |
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.
这里为什么要使用新的线程池方案,而不是直接使用utils下的。新的线程池会导致一些上下文(时区、语言、用户、request)等信息传递不到位
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.
这里的想法是需要超时处理,有些集群一直访问不到,在k8s sdk无法传递超时时间,就用线程池控制了
|
||
from metadata.models import Space | ||
|
||
info = Space.objects.filter(space_id=project_code).first() |
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.
这个查询逻辑,不太合理,这里已经知道是bkbcs的类型了。建议带上space_type直接查询。
另外其实自己字符串拼接一下也可以得到space_uid,看下代码里有没有类似的逻辑
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.
project_code -> space_uid -> bk_biz_id
是指第一步可以直接字符串拼接
|
||
from metadata.models import Space | ||
|
||
info = Space.objects.filter(space_id=project_code).first() |
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.
project_code -> space_uid -> bk_biz_id
是指第一步可以直接字符串拼接
No description provided.