天天看點

解讀 Knative v0.13.0版本特性

前言

針對 Knative Eventing v0.13.0 版本對這些新功能特性進行解讀,讓你快速對 v0.13.0 版本有所了解。

新特性

v1beta1 版本

從 v0.13.0 開始引入了 v1beta1 版本,包括如下資源: Broker, Trigger, Channel, Subscription, Sequence, Parallel, EventType, InMemoryChannel

支援通過configmap配置event dispatch 政策

之前通過event dispatch 轉發事件時,預設逾時時間是1分鐘,并且是預設設定不能配置,顯然在某些長時間請求的情況下1分鐘不夠。在v0.13.版本中,支援通過configmap配置相關的政策,包括逾時時間,MaxIdleConns等

新增 PingSource 資源

其實是将原來的 CronJobSource 改名了,以與k8s 中的CronJob進行區分。

in-mem channel 事件分發作用範圍

in-mem channel 支援通過 eventing.knative.dev/scope: namespace 注釋來判斷 In-memory dispatcher 是否部署在相同的命名空間中

HA支援

Knative 從0.13.0版本開始對核心的controller提供 HA 支援(包括Serving),Knative Eventing 中可以通過 config-leader-election configmap進行配置。

kind: ConfigMap
metadata:
  name: config-leader-election
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.13.0"
data:
  # An inactive but valid configuration follows; see example.
  resourceLock: "leases"
  leaseDuration: "15s"
  renewDeadline: "10s"
  retryPeriod: "2s"
  _example: |
    ################################
    #                              #
    #    EXAMPLE CONFIGURATION     #
    #                              #
    ################################

    # This block is not actually functional configuration,
    # but serves to illustrate the available configuration
    # options and document them in a way that is accessible
    # to users that `kubectl edit` this config map.
    #
    # These sample configuration options may be copied out of
    # this example block and unindented to be in the data block
    # to actually change the configuration.

    # resourceLock controls which API resource is used as the basis for the
    # leader election lock. Valid values are:
    #
    # - leases -> use the coordination API
    # - configmaps -> use configmaps
    # - endpoints -> use endpoints
    resourceLock: "leases"

    # leaseDuration is how long non-leaders will wait to try to acquire the
    # lock; 15 seconds is the value used by core kubernetes controllers.
    leaseDuration: "15s"
    # renewDeadline is how long a leader will try to renew the lease before
    # giving up; 10 seconds is the value used by core kubernetes controllers.
    renewDeadline: "10s"
    # retryPeriod is how long the leader election client waits between tries of
    # actions; 2 seconds is the value used by core kuberntes controllers.
    retryPeriod: "2s"
    # enabledComponents is a comma-delimited list of component names for which
    # leader election is enabled. Valid values are:
    #
    # - controller
    # - broker-controller
    # - inmemorychannel-dispatcher
    # - inmemorychannel-controller
    enabledComponents: "controller"           

其它關鍵資訊

  • 設定 Broker Filter/Ingress pods 預設 Prometheus Port: 9092
  • 在Broker中支援通過configmap 配置 Channel

總結

個人認為本次 Knative Eventing v0.13.0 版本最大的驚喜是支援了元件的 HA 部署,極大的提高了生産可用性。相信接下來社群會繼續完善可用性方面的功能。歡迎對 Knative 有興趣的一起交流。

歡迎加入 Knative 交流群

解讀 Knative v0.13.0版本特性

繼續閱讀