Clusterpedia 第一个版本 -- Clusterpedia 0.1.0 正式发布,即日起进入版本迭代阶段。相比于初期的 0.0.8 和 0.0.9-alpha,0.1.0 添加了很多功能,并且做了一些不兼容的更新。

如果由 0.0.9-alpha 升级的话,可以参考 Upgrade to Clusterpedia 0.1.0

https://clusterpedia.io/blog/2022/02/15/upgrade-to-clusterpedia-0.1.0/

01

重要功能

我们先介绍一下在 0.1.0 中增加的四大重要的功能:

  • 对 Not Ready 的集群进行资源检索时,增加了 Warning 提醒

  • 增强了原生 Field Selector 的能力

  • 根据父辈或者祖辈的 Owner 来进行查询

  • 响应数据携带 remaining item count

资源检索时的 Warning 提醒

集群由于某些原因处于非 Ready 的状态时,资源通常也无法正常同步,在获取到该集群内的资源时,会通过 Warnning 提醒来告知用户集群异常,并且获取到的资源可能并不是实时准确的。

$ kubectl get pediaclusterNAME        APISERVER                   VERSION   STATUScluster-1   https://10.6.100.10:6443    v1.22.2   ClusterSynchroStop
$ kubectl --cluster cluster-1 get podsWarning: cluster-1 is not ready and the resources obtained may be inaccurate, reason: ClusterSynchroStopCLUSTER     NAME                                                 READY   STATUS      RESTARTS   AGEcluster-1   fake-pod-698dfbbd5b-64fsx                            1/1     Running     0          68dcluster-1   fake-pod-698dfbbd5b-9ftzh                            1/1     Running     0          39dcluster-1   fake-pod-698dfbbd5b-rk74p                            1/1     Running     0          39dcluster-1   quickstart-ingress-nginx-admission-create--1-kxlnn   0/1     Completed   0          126d

强化 Field Selector

原生 kubernetes 对于 Field Selector 的支持非常有限,默认只支持 metadata.namespace 和 metadata.name 字段的过滤,尽管一些特定的资源会支持一些特殊的字段,但是使用起来还是比较局限,操作符只能支持 =, ==, !=。

# kubernetes/pkg$ grep AddFieldLabelConversionFunc . -r./apis/core/v1/conversion.go:   err := scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("Pod"),./apis/core/v1/conversion.go:   err = scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("Node"),./apis/core/v1/conversion.go:   err = scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("ReplicationController"),./apis/core/v1/conversion.go:   return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("Event"),./apis/core/v1/conversion.go:   return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("Namespace"),./apis/core/v1/conversion.go:   return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("Secret"),./apis/certificates/v1/conversion.go:   return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("CertificateSigningRequest"),./apis/certificates/v1beta1/conversion.go:      return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("CertificateSigningRequest"),./apis/batch/v1/conversion.go:  return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("Job"),./apis/batch/v1beta1/conversion.go:             err = scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind(kind),./apis/events/v1/conversion.go: return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("Event"),./apis/events/v1beta1/conversion.go:    return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("Event"),./apis/apps/v1beta2/conversion.go:      if err := scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("StatefulSet"),./apis/apps/v1beta1/conversion.go:      if err := scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("StatefulSet"),

Clusterpedia 在兼容原生 Field Selector 的基础上,不仅仅支持了更加灵活的字段过滤,还支持和 Label Selector 相同的操作符:!, =, !=, ==, in, notin。

例如我们可以像 label selector 一样,通过 annotations 过滤资源。

kubectl get deploy --field-selector="metadata.annotations['test.io'] in (value1, value2)"

更多详情

https://clusterpedia.io/zh-cn/docs/usage/search/multi-cluster/#%E5%AD%97%E6%AE%B5%E8%BF%87%E6%BB%A4

根据父辈或者祖辈 Owner 进行查询

Kubernetes 资源之间通常会存在一种 Owner 关系, 例如

apiVersion: v1kind: Podmetadata:  ownerReferences:  - apiVersion: apps/v1    blockOwnerDeletion: true    controller: true    kind: ReplicaSet    name: fake-pod-698dfbbd5b    uid: d5bf2bdd-47d2-4932-84fb-98bde486d244

Clusterpedia 不仅支持根据 Owner 查询,还支持对 Owner 进行辈分提升来根据祖辈或者更高辈分的 Owner 来检索资源。

例如可以通过 Deployment 获取相应的所有 pods。

当前暂时只支持通过 Owner UID 来查询资源, 使用 Owner Name 来进行查询的功能尚在讨论中,可以在 issue: Support for searching resources by owner 参与讨论。

$ DEPLOY_UID=$(kubectl --cluster cluster-1 get deploy fake-deploy -o jsonpath="{.metadata.uid}")$ kubectl --cluster cluster-1 get pods -l \    "internalstorage.clusterpedia.io/owner-uid=$DEPLOY_UID,\     internalstorage.clusterpedia.io/owner-seniority=1"

更多详情

https://clusterpedia.io/zh-cn/docs/usage/search/multi-cluster/#%E6%A0%B9%E6%8D%AE%E7%88%B6%E8%BE%88%E4%BB%A5%E5%8F%8A%E7%A5%96%E8%BE%88-owner-%E6%9F%A5%E8%AF%A2

响应数据内携带剩余资源数量

在一些 UI 场景下,往往需要获取当前检索条件下的资源总量。

Kubernetes 响应的 ListMeta 中 RemainingItemCount 字段表示剩余的资源数量。

type ListMeta struct {    ...
        // remainingItemCount is the number of subsequent items in the list which are not included in this        // list response. If the list request contained label or field selectors, then the number of        // remaining items is unknown and the field will be left unset and omitted during serialization.        // If the list is complete (either because it is not chunking or because this is the last chunk),        // then there are no more remaining items and this field will be left unset and omitted during        // serialization.        // Servers older than v1.15 do not set this field.        // The intended use of the remainingItemCount is *estimating* the size of a collection. Clients        // should not rely on the remainingItemCount to be set or to be exact.        // +optional    RemainingItemCount *int64 `json:"remainingItemCount,omitempty" protobuf:"bytes,4,opt,name=remainingItemCount"`}

复用 ListMeta.RemainingItemCount,通过简单计算便可以获取当前检索条件下的资源总量: total = offset + len(list.items) + list.metadata.remainingItemCount

该功能需要搭配分页功能一起使用

$ kubectl get --raw="/apis/clusterpedia.io/v1beta1/resources/apis/apps/v1/deployments?withRemainingCount&limit=1" | jq{  "kind": "DeploymentList",  "apiVersion": "apps/v1",  "metadata": {    "remainingItemCount": 24  },  "items": [    ...  ]}

更多详情

https://clusterpedia.io/zh-cn/docs/usage/search/multi-cluster/#%E5%93%8D%E5%BA%94%E6%90%BA%E5%B8%A6%E5%89%A9%E4%BD%99%E8%B5%84%E6%BA%90%E6%95%B0%E9%87%8F%E4%BF%A1%E6%81%AF

02

更新总览

  • 用于资源检索的 pedia.clusterpedia.io/v1alpha1 更改为 clusterpedia.io/v1beta1 (https://github.com/clusterpedia-io/clusterpedia/pull/73)

  • 优化了 PediaCluster 结构, 并且将 clusters.clusterpedia.io/v1alpha1 组更改为 cluster.clusterpedia.io/v1alpha2 (https://github.com/clusterpedia-io/clusterpedia/pull/27; https://github.com/clusterpedia-io/clusterpedia/pull/67; https://github.com/clusterpedia-io/clusterpedia/pull/76; https://github.com/clusterpedia-io/clusterpedia/pull/74; https://github.com/clusterpedia-io/clusterpedia/pull/78)

  • 支持自定义资源的收集和搜索 (https://github.com/clusterpedia-io/clusterpedia/pull/10)

  • 将插入到资源中的集群信息由 labels 移动到 annotations 中 (https://github.com/clusterpedia-io/clusterpedia/pull/37)

  • 添加了存储组件 postgres 的部署 yaml

APIServer

  • 支持响应数据携带 RemainingItemCount 和 Continue 字段 (https://github.com/clusterpedia-io/clusterpedia/pull/33)

  • 增强了对 Field Selector 支持,在兼容原生 Field Selector 的同时,还支持和 Label Selector 相同的复杂操作符 (https://github.com/clusterpedia-io/clusterpedia/pull/36)

  • 指定查询未同步异常的集群内的资源时增加了 Warning 提醒 (https://github.com/clusterpedia-io/clusterpedia/pull/35)

  • 为了保持用于分页的 Limit query 一致,将 search label 由 search.clusterpedia.io/size 修改为 search.clusterpedia.io/limit (https://github.com/clusterpedia-io/clusterpedia/pull/42)

Bug Fixes

  • 修复 requestInfo 在解析命名空间资源时,依然设置 requestInfo.Namespace 字段 (https://github.com/clusterpedia-io/clusterpedia/pull/17)

  • 修复了内置资源在同步时,指定版本导致资源同步状态显示异常的问题 (https://github.com/clusterpedia-io/clusterpedia/pull/58)

ClusterSynchro Manager

  • clustersynchro manager 可以通过 feature gates 来裁剪 managedFields 和 last-applied-configuration 字段 (https://github.com/clusterpedia-io/clusterpedia/pull/19)

Bug Fixes

  • 修复了 PediaCluster Status 更新相关的问题 (https://github.com/clusterpedia-io/clusterpedia/pull/11; https://github.com/clusterpedia-io/clusterpedia/pull/24; https://github.com/clusterpedia-io/clusterpedia/pull/23;https://github.com/clusterpedia-io/clusterpedia/pull/22)

  • 修复了 clustersynchro manager 的 leader election (https://github.com/clusterpedia-io/clusterpedia/pull/15)

Default Storage Layer

  • 默认存储层不再为用户提供默认的排序顺序,由用户来主动设置排序 (https://github.com/clusterpedia-io/clusterpedia/pull/44)

  • 增加了一些索引,并且修复了 gorm 忽略空字段的问题 (https://github.com/clusterpedia-io/clusterpedia/pull/41)

  • 支持了根据父辈或者祖辈 owner 进行查询 (https://github.com/clusterpedia-io/clusterpedia/pull/50)

Bug Fixes

  • 修复了 JSON SQL 的生成 (https://github.com/clusterpedia-io/clusterpedia/pull/60; https://github.com/clusterpedia-io/clusterpedia/pull/62; https://github.com/clusterpedia-io/clusterpedia/pull/78)

  • 修复了过滤 CollectionResource 时,获取的资源不准确的问题 (https://github.com/clusterpedia-io/clusterpedia/pull/61)

上就是 Clusterpedia 0.1.0 的版本内容介绍,非常欢迎大家使用和参与讨论。

首发|Clusterpedia 0.1.0 四大重要功能相关推荐

  1. 博睿数据App 3.0四大新功能来袭,大幅提升App用户体验可见性

    2021年8月5日,国内APM市场领导厂商博睿数据正式发布了Bonree App 3.0,该产品是博睿数据通过"数据链DNA"理念构建以用户为中心的IT运维体系,助力企业实现&qu ...

  2. android 9.0室内定位方案,Android 9.0四大隐藏功能,让你的安卓手机更实用

    全新的Android 9.0系统已经于8月初推送了正式版,谷歌Pixel手机以及Essential Phone也第一时间获得了更新.此外,HTC.索尼以及部分国产手机品牌也在进行适配工作.预计年底之前 ...

  3. android 魅族屏幕适配,Flyme 9发布:首发小窗模式3.0 魅族18系列首先适配

    Flyme 9发布:首发小窗模式3.0 魅族18系列首先适配 2021-03-02 19:25:12 0点赞 0收藏 0评论 [科技犬] 此次Flyme 9秉承着"轻盈有序"的设计 ...

  4. 360极速浏览器崩溃_360极速浏览器12.0新版上线 四大亮点引国内浏览器浪潮

    "PC上最重要的不是操作系统,而是浏览器",这是李开复博士对浏览器地位的肯定.的确,面对每天用户在上网过程中产生的海量大数据,浏览器不仅承担了用户进入互联网服务渠道与入口的角色,还 ...

  5. 华为庞鑫:闪存3.0时代,四大变化激发全闪存数据中心潜能释放

    从2005年到2019年间,中国数字经济总体规模由2.6万亿元增加至35.8万亿元,数字经济在GDP的占比也由14.2%提升至36.2%.随着数字经济蓬勃发展,数据也成为当之无愧的关键生产要素,是基础 ...

  6. HighNewTech:支付宝全球首发5G手机,四大逆天功能(防骗三折叠气味识别自由飞)!

    High&NewTech:支付宝全球首发5G手机,四大逆天功能(防骗&三折叠&气味识别&自由飞)! 导读       2019年4月1日,支付宝,今天重磅发布!旗下首款 ...

  7. ASP.NET 2.0 中改进的缓存功能

    摘要:本文中,Stephen Walther 将重点介绍 ASP.NET 2.0 中新增的缓存功能,以及如何使用这些新功能改进 ASP.NET 应用程序的性能和可扩展性.(本文包含一些指向英文站点的链 ...

  8. ADO.NET 2.0 中的新增 DataSet 功能

    发布日期: 1/13/2005 | 更新日期: 1/13/2005 Jackie Goldstein Renaissance Computer Systems 适用于: Microsoft ADO.N ...

  9. C# 7.0中的解构功能---Deconstruct

    解构元组 C#7.0新增了诸多功能,其中有一项是新元组(ValueTuple),它允许我们可以返回多个值,并且配合解构能更加方便的进行工作,如下面例子 可以看到解构元组可以写出优雅的代码,并且可以使用 ...

最新文章

  1. JetBrains大力推广Kotlin为哪般?
  2. 多台计算机怎样才能同时使用互联网,如何实现一台路由器多台计算机同时上网...
  3. python学习软件-学习python用什么软件
  4. Premiere Pro CS5软件安装教程
  5. matplotlib输出图形到网页_必学python库Matplotlib教程分享
  6. mysql模板引擎有哪些_ecshop用的是什么模板引擎?
  7. java基础之匿名内部类
  8. HTML 5 aside 标签
  9. 数学计算机电路基础,2019上“计算机电路基础”作业(五大题共16小题).docx
  10. linux安装memcached(不错)
  11. tomcat记录X-Forwarded-For字段中的远程IP
  12. mysql查询前一年的第一天_MySQL中查询某一天, 某一月, 某一年的数据代码详解
  13. 关于高通平台9008线刷的一些注意点,供小白食用。
  14. CTU Open Contest 2019 F. Beer Marathon(贪心)
  15. 如何在Word中插入Notepad++样式的代码段
  16. 考研日语线上笔记(七):十年真题完型精翻篇(2012-2021年)
  17. .Net6.0系列-6 .Net 6LinQ(二)常用扩展方法
  18. 道达天际首次亮相军博会,“天网融合”引爆全场
  19. opencv2读取摄像头并保存为视频
  20. OpenCV的本地相机抓图和本地视频取帧

热门文章

  1. java mysql转义_java如何转义
  2. Swagger使用教程及Swagger增强工具knife4j
  3. ROS利用Python脚本实现多点自主导航
  4. 艾拉比与睿赛德科技强强联手,推出基于RT-Thread操作系统的OTA差分升级
  5. 亚马逊无货源的优势是什么
  6. maatwebsite/excel 3.0版本使用方法
  7. win10删除休眠文件hiberfil.sys
  8. 前端实用的grid布局
  9. win8.1启用ahci后蓝屏
  10. java 利特尔法则_Java Web应用中调优线程池的重要性