解读 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 交流群

image

猜你喜欢

转载自yq.aliyun.com/articles/749128