Knative并行和序列演示失败



我正在尝试活动序列/并行流。

我从官方网站v1.1版本中提到的序列示例开始我创建了文档中提到的步骤、序列和pingSource,但pingSource失败了,因为序列没有启动。

序列低于异常

Events:
Type     Reason        Age              From                 Message
----     ------        ----             ----                 -------
Warning  UpdateFailed  8s (x6 over 8s)  sequence-controller  Failed to update status for "sequence": Sequence.flows.knative.dev "sequence" is invalid: [status.channelStatuses: Invalid value: "null": status.channelStatuses in body must be of type array: "null", status.subscriptionStatuses: Invalid value: "null": status.subscriptionStatuses in body must be of type array: "null"]
Warning  UpdateFailed  3s (x5 over 8s)  sequence-controller  Failed to update status for "sequence": Sequence.flows.knative.dev "sequence" is invalid: [status.subscriptionStatuses: Invalid value: "null": status.subscriptionStatuses in body must be of type array: "null", status.channelStatuses: Invalid value: "null": status.channelStatuses in body must be of type array: "null"]

但是步骤运行良好

NAME                                     TYPE           CLUSTER-IP      EXTERNAL-IP                            PORT(S)                                      AGE
service/first                            ExternalName   <none>          first.varadhi.example.com              80/TCP                                       9m46s
service/first-00001                      ClusterIP      10.96.116.201   <none>                                 80/TCP                                       9m51s
service/first-00001-private              ClusterIP      10.96.155.146   <none>                                 80/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   9m51s
service/second                           ExternalName   <none>          second.varadhi.example.com             80/TCP                                       9m45s
service/second-00001                     ClusterIP      10.96.208.230   <none>                                 80/TCP                                       9m51s
service/second-00001-private             ClusterIP      10.96.171.83    <none>                                 80/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   9m51s
service/third                            ExternalName   <none>          third.varadhi.example.com              80/TCP                                       9m45s
service/third-00001                      ClusterIP      10.96.131.110   <none>                                 80/TCP                                       9m51s
service/third-00001-private              ClusterIP      10.96.55.219    <none>                                 80/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   9m51s
NAME                                                READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/first-00001-deployment              0/0     0            0           9m52s
deployment.apps/second-00001-deployment             0/0     0            0           9m52s
deployment.apps/third-00001-deployment              0/0     0            0           9m52s
NAME                                                           DESIRED   CURRENT   READY   AGE
replicaset.apps/first-00001-deployment-594dc84cb8              0         0         0       9m52s
replicaset.apps/second-00001-deployment-79d9f8b7b8             0         0         0       9m52s
replicaset.apps/third-00001-deployment-7479456fdf              0         0         0       9m51s
NAME                                                  URL   AGE   READY     REASON
channel.messaging.knative.dev/varadhi-inmem-channel         26h   Unknown   NewObservedGenFailure
NAME                                           URL                                           LATESTCREATED            LATESTREADY              READY     REASON
service.serving.knative.dev/first              http://first.varadhi.example.com              first-00001              first-00001              Unknown   IngressNotConfigured
service.serving.knative.dev/second             http://second.varadhi.example.com             second-00001             second-00001             Unknown   IngressNotConfigured
service.serving.knative.dev/third              http://third.varadhi.example.com              third-00001              third-00001              Unknown   IngressNotConfigured
NAME                                                  CONFIG NAME        K8S SERVICE NAME   GENERATION   READY   REASON             ACTUAL REPLICAS   DESIRED REPLICAS
revision.serving.knative.dev/first-00001              first                                 1            True                       0                 0
revision.serving.knative.dev/second-00001             second                                1            True                       0                 0
revision.serving.knative.dev/third-00001              third                                 1            True                       0                 0
NAME                                                 LATESTCREATED            LATESTREADY              READY   REASON
configuration.serving.knative.dev/first              first-00001              first-00001              True
configuration.serving.knative.dev/second             second-00001             second-00001             True
configuration.serving.knative.dev/third              third-00001              third-00001              True
NAME                                         URL                                           READY     REASON
route.serving.knative.dev/first              http://first.varadhi.example.com              Unknown   IngressNotConfigured
route.serving.knative.dev/second             http://second.varadhi.example.com             Unknown   IngressNotConfigured
route.serving.knative.dev/third              http://third.varadhi.example.com              Unknown   IngressNotConfigured

在花了大量时间研究knative序列后,我决定尝试knative并行

我参考了v1.1的parallel官方文档,并使用了多个分支的示例我创建了过滤器、转换器、并行和pingSource,但在这里并行也没有出现以下异常

Events:
Type     Reason        Age                   From                 Message
----     ------        ----                  ----                 -------
Warning  UpdateFailed  6m37s (x18 over 17m)  parallel-controller  Failed to update status for "odd-even-parallel": Parallel.flows.knative.dev "odd-even-parallel" is invalid: status.branchStatuses: Invalid value: "null": status.branchStatuses in body must be of type array: "null"

这里的并行和序列也运行良好。

有没有人遇到过类似的问题,或者我在官方文件中遗漏了什么?

环境信息:

  • 使用Kind Cluster
  • 使用本地docker注册表(已绕过图像摘要检查(
  • 命名空间:varadhi
  • 服务和事件CRDS是knative v1.1

编辑#1

我没有明确地创建任何通道,也没有看到控制器或隐式创建任何通道

kubectl get channel -n varadhi 
No resources found in varadhi namespace. 

此外,我的默认通道是InMemoryChannel

anil.gowda@faas-dev-kafka-8420816:~/knative$ kubectl get configmaps -n knative-eventing  default-ch-webhook -o yaml
apiVersion: v1
data:
default-ch-config: |
clusterDefault:
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
namespaceDefaults:
varadhi:
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
kind: ConfigMap

并行:

使用示例:https://github.com/knative/docs/tree/main/code-samples/eventing/parallel/multiple-branches

状态

NAME                                     TYPE           CLUSTER-IP      EXTERNAL-IP                            PORT(S)                                      AGE
service/even-filter                      ExternalName   <none>          even-filter.varadhi.example.com        80/TCP                                       4d19h
service/even-filter-00001                ClusterIP      10.96.85.252    <none>                                 80/TCP                                       4d19h
service/even-filter-00001-private        ClusterIP      10.96.98.109    <none>                                 80/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   4d19h
service/even-transformer                 ExternalName   <none>          even-transformer.varadhi.example.com   80/TCP                                       4d19h
service/even-transformer-00001           ClusterIP      10.96.152.53    <none>                                 80/TCP                                       4d19h
service/even-transformer-00001-private   ClusterIP      10.96.130.58    <none>                                 80/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   4d19h
service/event-display                    ExternalName   <none>          event-display.varadhi.example.com      80/TCP                                       4d19h
service/event-display-00001              ClusterIP      10.96.237.175   <none>                                 80/TCP                                       4d19h
service/event-display-00001-private      ClusterIP      10.96.81.3      <none>                                 80/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   4d19h
service/odd-filter                       ExternalName   <none>          odd-filter.varadhi.example.com         80/TCP                                       4d19h
service/odd-filter-00001                 ClusterIP      10.96.84.239    <none>                                 80/TCP                                       4d19h
service/odd-filter-00001-private         ClusterIP      10.96.16.17     <none>                                 80/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   4d19h
service/odd-transformer                  ExternalName   <none>          odd-transformer.varadhi.example.com    80/TCP                                       4d19h
service/odd-transformer-00001            ClusterIP      10.96.61.11     <none>                                 80/TCP                                       4d19h
service/odd-transformer-00001-private    ClusterIP      10.96.203.185   <none>                                 80/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   4d19h
service/odd-transformer-00002            ClusterIP      10.96.115.147   <none>                                 80/TCP                                       4d19h
service/odd-transformer-00002-private    ClusterIP      10.96.235.117   <none>                                 80/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   4d19h
NAME                                                READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/even-filter-00001-deployment        0/0     0            0           4d19h
deployment.apps/even-transformer-00001-deployment   0/0     0            0           4d19h
deployment.apps/event-display-00001-deployment      0/0     0            0           4d19h
deployment.apps/odd-filter-00001-deployment         0/0     0            0           4d19h
deployment.apps/odd-transformer-00001-deployment    0/0     0            0           4d19h
deployment.apps/odd-transformer-00002-deployment    0/0     0            0           4d19h
NAME                                                           DESIRED   CURRENT   READY   AGE
replicaset.apps/even-filter-00001-deployment-6b7bdd866f        0         0         0       4d19h
replicaset.apps/even-transformer-00001-deployment-666bf9d776   0         0         0       4d19h
replicaset.apps/event-display-00001-deployment-758c9f7595      0         0         0       4d19h
replicaset.apps/odd-filter-00001-deployment-c86bd4799          0         0         0       4d19h
replicaset.apps/odd-transformer-00001-deployment-6bf46bc88f    0         0         0       4d19h
replicaset.apps/odd-transformer-00002-deployment-5c5f7b8b75    0         0         0       4d19h
NAME                                           URL   AGE     READY   REASON
parallel.flows.knative.dev/odd-even-parallel         4d19h
NAME                                  URL   AGE   READY   REASON
NAME                                                 LATESTCREATED            LATESTREADY              READY   REASON
configuration.serving.knative.dev/even-filter        even-filter-00001        even-filter-00001        True
configuration.serving.knative.dev/even-transformer   even-transformer-00001   even-transformer-00001   True
configuration.serving.knative.dev/event-display      event-display-00001      event-display-00001      True
configuration.serving.knative.dev/odd-filter         odd-filter-00001         odd-filter-00001         True
configuration.serving.knative.dev/odd-transformer    odd-transformer-00002    odd-transformer-00002    True
NAME                                         URL                                           READY     REASON
route.serving.knative.dev/even-filter        http://even-filter.varadhi.example.com        Unknown   IngressNotConfigured
route.serving.knative.dev/even-transformer   http://even-transformer.varadhi.example.com   Unknown   IngressNotConfigured
route.serving.knative.dev/event-display      http://event-display.varadhi.example.com      Unknown   IngressNotConfigured
route.serving.knative.dev/odd-filter         http://odd-filter.varadhi.example.com         Unknown   IngressNotConfigured
route.serving.knative.dev/odd-transformer    http://odd-transformer.varadhi.example.com    Unknown   IngressNotConfigured
NAME                                           URL                                           LATESTCREATED            LATESTREADY              READY     REASON
service.serving.knative.dev/even-filter        http://even-filter.varadhi.example.com        even-filter-00001        even-filter-00001        Unknown   IngressNotConfigured
service.serving.knative.dev/even-transformer   http://even-transformer.varadhi.example.com   even-transformer-00001   even-transformer-00001   Unknown   IngressNotConfigured
service.serving.knative.dev/event-display      http://event-display.varadhi.example.com      event-display-00001      event-display-00001      Unknown   IngressNotConfigured
service.serving.knative.dev/odd-filter         http://odd-filter.varadhi.example.com         odd-filter-00001         odd-filter-00001         Unknown   IngressNotConfigured
service.serving.knative.dev/odd-transformer    http://odd-transformer.varadhi.example.com    odd-transformer-00002    odd-transformer-00002    Unknown   IngressNotConfigured
NAME                                                  CONFIG NAME        K8S SERVICE NAME   GENERATION   READY   REASON             ACTUAL REPLICAS   DESIRED REPLICAS
revision.serving.knative.dev/even-filter-00001        even-filter                           1            True                       0                 0
revision.serving.knative.dev/even-transformer-00001   even-transformer                      1            True                       0                 0
revision.serving.knative.dev/event-display-00001      event-display                         1            True                       0                 0
revision.serving.knative.dev/odd-filter-00001         odd-filter                            1            True                       0                 0
revision.serving.knative.dev/odd-transformer-00001    odd-transformer                       1            False   ImagePullBackOff   0
revision.serving.knative.dev/odd-transformer-00002    odd-transformer                       2            True                       0                 0
NAME                                         SINK   SCHEDULE      AGE     READY   REASON
pingsource.sources.knative.dev/ping-source          */1 * * * *   4d19h   False   NotFound

编辑#2我安装了更多的事件crd(eventing.yaml(

我现在几乎看不到什么变化。

通道正在创建,其状态为真实

NAME                                                                    URL                                                                           AGE   READY   REASON
inmemorychannel.messaging.knative.dev/odd-even-parallel-kn-parallel     http://odd-even-parallel-kn-parallel-kn-channel.varadhi.svc.cluster.local     73m   True
inmemorychannel.messaging.knative.dev/odd-even-parallel-kn-parallel-0   http://odd-even-parallel-kn-parallel-0-kn-channel.varadhi.svc.cluster.local   73m   True
inmemorychannel.messaging.knative.dev/odd-even-parallel-kn-parallel-1   http://odd-even-parallel-kn-parallel-1-kn-channel.varadhi.svc.cluster.local   73m   True
inmemorychannel.messaging.knative.dev/sequence-kn-sequence-0            http://sequence-kn-sequence-0-kn-channel.varadhi.svc.cluster.local            70m   True
inmemorychannel.messaging.knative.dev/sequence-kn-sequence-1            http://sequence-kn-sequence-1-kn-channel.varadhi.svc.cluster.local            50m   True
inmemorychannel.messaging.knative.dev/sequence-kn-sequence-2            http://sequence-kn-sequence-2-kn-channel.varadhi.svc.cluster.local            50m   True

但是序列和并行还不是真正的状态,他们说订阅NotReady

$ kubectl -n varadhi get sequence
NAME       URL                                                                  AGE   READY     REASON
sequence   http://sequence-kn-sequence-0-kn-channel.varadhi.svc.cluster.local   71m   Unknown   SubscriptionsNotReady
$ kubectl -n varadhi get parallel
NAME                URL                                                                         AGE     READY   REASON
odd-even-parallel   http://odd-even-parallel-kn-parallel-kn-channel.varadhi.svc.cluster.local   5d21h   False   SubscriptionsNotReady

在进一步调试时,我可以看到下面的消息按顺序

Ready:
Last Transition Time:  2022-01-12T08:19:17Z
Message:               Failed to get subscription status: subscription "sequence-kn-sequence-0" not present in channel "sequence-kn-sequence-0" subscriber's list
Reason:                SubscriptionNotMarkedReadyByChannel
Status:                Unknown
Type:                  Ready
Subscription:
Name:       sequence-kn-sequence-0
Namespace:  varadhi

在查看信道时,它给出以下消息

Last Transition Time:  2022-01-12T08:19:17Z
Message:               The status of Dispatcher Deployment is False: MinimumReplicasUnavailable : Deployment does not have minimum availability.
Reason:                DispatcherDeploymentFalse
Severity:              Info
Status:                False
Type:                  DispatcherReady

看起来通道无法获取服务部署状态

我也安装了Kourier,但我看不到外部ip。请注意,我正在为此运行我自己的集群。

$ kubectl --namespace kourier-system get service kourier
NAME      TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
kourier   LoadBalancer   10.96.112.238   <pending>     80:32002/TCP,443:32733/TCP   73m
$
$ kubectl get pods -n knative-serving
NAME                                      READY   STATUS    RESTARTS   AGE
activator-d4cd7dfd5-mcxsl                 1/1     Running   0          7d18h
autoscaler-69689d8b7-rx75h                1/1     Running   0          7d18h
controller-766f74d9f8-fwdk9               1/1     Running   0          7d18h
domain-mapping-7dbbb5c7d-xk5m5            1/1     Running   0          7d18h
domainmapping-webhook-747f79dbdc-qm5nn    1/1     Running   0          7d18h
net-kourier-controller-5657664b99-zr9cj   1/1     Running   0          73m
webhook-8f6866966-8z8tt                   1/1     Running   0          7d18h

安装kourier 后,服务几乎没有变化

$ kubectl get service.serving.knative.dev -n varadhi
NAME               URL                                           LATESTCREATED            LATESTREADY              READY     REASON
even-filter        http://even-filter.varadhi.example.com        even-filter-00001        even-filter-00001        Unknown
even-transformer   http://even-transformer.varadhi.example.com   even-transformer-00001   even-transformer-00001   Unknown
event-display      http://event-display.varadhi.example.com      event-display-00001      event-display-00001      Unknown
first              http://first.varadhi.example.com              first-00001              first-00001              Unknown
odd-filter         http://odd-filter.varadhi.example.com         odd-filter-00001         odd-filter-00001         Unknown
odd-transformer    http://odd-transformer.varadhi.example.com    odd-transformer-00002    odd-transformer-00002    Unknown
second             http://second.varadhi.example.com             second-00001             second-00001             Unknown
third              http://third.varadhi.example.com              third-00001              third-00001              Unknown

IngressNotConfigured状态消失。

对于Sequence示例,我认为您的默认通道配置可能有问题。

序列在每个步骤之间创建通信通道,预计会为该示例创建三个通道:

$ kubectl get channel
inmemorychannel.messaging.knative.dev/sequence-kn-sequence-0           http://sequence-kn-sequence-0-kn-channel.default.svc.cluster.local           56s   True    
inmemorychannel.messaging.knative.dev/sequence-kn-sequence-1           http://sequence-kn-sequence-1-kn-channel.default.svc.cluster.local           56s   True    
inmemorychannel.messaging.knative.dev/sequence-kn-sequence-2           http://sequence-kn-sequence-2-kn-channel.default.svc.cluster.local           56s   True    

你能检查一下为你创建了哪些频道以及它们的状态吗?

你能确保你的默认频道设置正确吗?请参阅:https://knative.dev/docs/eventing/channels/channel-types-defaults/

您是否也可以在此处发布您正在使用的并行?状态取决于控制器,这听起来像是一个问题。

在您的序列和并行输出中,可以发现服务问题:

service.serving.knative.dev/even-filter        http://even-filter.varadhi.example.com        even-filter-00001        even-filter-00001        Unknown   IngressNotConfigured

虽然Knative Eventing不依赖于Serving,但序列/并行的示例要求正确安装它,因为它们使用无服务器服务:

  • 序列示例:事件显示,第一、第二和第三
  • 并行示例:事件显示,偶数滤波器,偶数变换器,奇数滤波器偶数变换器

Eventing可以使用常规的kubernetes服务,而不是knative服务,但我认为让示例为您工作的最好方法是确保knative Serving按预期工作。

您是否为Knative Serving配置了网络提供商?如果你没有,你可以通过这个步骤:

https://knative.dev/docs/install/serving/install-serving-with-yaml/#install-a网络层

如果你不确定该选择哪一个,我会选择由Knative项目维护的Kourier。

相关内容

  • 没有找到相关文章

最新更新