天天看點

解讀 Knative Eventing v0.10.0 最新版本特性

前言

Knative Eventing v0.10.0 版本已經于 10 月 29 号正式釋出。本次釋出繼續圍繞完善 Eventing 中相關功能展開。本篇文章通過解讀這些功能特性,讓你快速對 v0.10.0 版本有所了解。

新特性

采用 Destination 資源

為了在 Eventing/Messaging 中需要支援設定URI, 而 Destination 本身具備這些屬性,是以将 Destination 作為統一通路資源。 Destination 結構如下:

type Destination struct{
  // +optional
  Ref *corev1.ObjectReference
  // +optional
  URI *apis.URL
}           

使用者除了可以通過之前如下的方式:

sink:
    apiVersion: v1
    kind: Service
    name: event-display           

除此之外,還可以直接通過uri方式通路:

sink:
    uri: http://event-display.default.svc.cluster.local           

通過 uri 這樣的方式意味着我們可以在Eventing中 設定

subPath

(如

http://event-display.default.svc.cluster.local/test)

進行通路。

目前支援 Destination 的資源包括:Trigger, Subscription, Parallel, Sequence, ApiServerSource, ContainerSource, 以及 CronJobSource。

建立 Trigger 時預設建立 Broker

當第一次建立 Trigger 時,如果沒有 Broker, 會自動在目前的namespace 的 label 中添加

knative-eventing-injection: "enabled"

,建立預設的 Broker。

CloudEvents

CloudEvents 更新到 1.0 版本支援

監控增強

  • 在所有的元件中暴露 Go's runtime.MemStats 作為 opencensus metrics。
  • 在 Grafana 中添加了 Broker/Trigger 和 Source 名額儀表盤

其它特性

  • 将 CronJobSource 和 ApiServerSource 中 event type 從 OpenAPI spec 移動到annotations中。
  • Broker, Channel, Parallel, Sequence CRDs 支援通過标簽

    duck.knative.dev/addressable: "true"

    表明資源可以通路。

其它關鍵資訊

  • 支援 Kubernetes 最小版本 1.14。如果你 k8s 版本小于1.14, 則會部署失敗。
  • channels.eventing.knative.dev

    CRD 已經被删除, 已經使用

    channels.messaging.knative.dev

    替換. 請手動删除

    channels.eventing.knative.dev

    CRD 資源
  • CloudEvents SDK 不再設定預設類型 application/json. 如果需要可以通過設定 content type。

總結

本次 Knative Eventing v0.10.0 版本主要繼續完善功能,在後續的版本疊代中應該也是主要集中在功能完善和優化。同時也歡迎對 Knative 有興趣的一起交流。

歡迎加入 Knative 交流群

解讀 Knative Eventing v0.10.0 最新版本特性

繼續閱讀