首页 > 其他分享 >Sequence Flow示例

Sequence Flow示例

时间:2022-10-24 12:11:50浏览次数:55  
标签:02 03 01 Sequence default sq 示例 Flow appender

准备实践环境

[root@master ~]# kn service create sq-appender-01 --image ikubernetes/appender --env MESSAGE=" - Handled by SQ-01"
Creating service 'sq-appender-01' in namespace 'default':

  0.084s The Route is still working to reflect the latest desired specification.
  0.084s Configuration "sq-appender-01" is waiting for a Revision to become ready.
 30.036s ...
 30.134s Ingress has not yet been reconciled.
 30.231s Waiting for load balancer to be ready
 30.412s Ready to serve.

Service 'sq-appender-01' created to latest revision 'sq-appender-01-00001' is available at URL:
http://sq-appender-01.default.yang.com
[root@master ~]# kn service create sq-appender-02 --image ikubernetes/appender --env MESSAGE=" - Handled by SQ-02"
Creating service 'sq-appender-02' in namespace 'default':

  0.044s The Route is still working to reflect the latest desired specification.
  0.071s Configuration "sq-appender-02" is waiting for a Revision to become ready.
  7.300s ...
  7.364s Ingress has not yet been reconciled.
  7.420s Waiting for load balancer to be ready
  7.627s Ready to serve.

Service 'sq-appender-02' created to latest revision 'sq-appender-02-00001' is available at URL:
http://sq-appender-02.default.yang.com
[root@master ~]# kn service create sq-appender-03 --image ikubernetes/appender --env MESSAGE=" - Handled by SQ-03"
Creating service 'sq-appender-03' in namespace 'default':

  0.043s The Route is still working to reflect the latest desired specification.
  0.063s ...
  0.076s Configuration "sq-appender-03" is waiting for a Revision to become ready.
  7.254s ...
  7.298s Ingress has not yet been reconciled.
  7.359s Waiting for load balancer to be ready
  7.612s Ready to serve.

Service 'sq-appender-03' created to latest revision 'sq-appender-03-00001' is available at URL:
http://sq-appender-03.default.yang.com
[root@master ~]# kn service list
NAME               URL                                        LATEST                   AGE   CONDITIONS   READY   REASON
event-display-01   http://event-display-01.default.yang.com   event-display-01-00001   34s   3 OK / 3     True    
sq-appender-01     http://sq-appender-01.default.yang.com     sq-appender-01-00001     17m   3 OK / 3     True    
sq-appender-02     http://sq-appender-02.default.yang.com     sq-appender-02-00001     16m   3 OK / 3     True    
sq-appender-03     http://sq-appender-03.default.yang.com     sq-appender-03-00001     16m   3 OK / 3     True 

 

[root@master sequence-demo]# kubectl apply -f 04-sequence-demo.yaml 
sequence.flows.knative.dev/sq-demo created
[root@master sequence-demo]# cat 04-sequence-demo.yaml 
apiVersion: flows.knative.dev/v1
kind: Sequence
metadata:
  name: sq-demo
  namespace: default
spec:
  channelTemplate:
    apiVersion: messaging.knative.dev/v1
    kind: InMemoryChannel
  steps:
    - ref:
        apiVersion: serving.knative.dev/v1
        kind: Service
        name: sq-appender-01
    - ref:
        apiVersion: serving.knative.dev/v1
        kind: Service
        name: sq-appender-02
    - ref:
        apiVersion: serving.knative.dev/v1
        kind: Service
        name: sq-appender-03
  reply:
    ref:
      kind: Service
      apiVersion: serving.knative.dev/v1
      name: event-display-01
[root@master sequence-demo]# kubectl get sequence
NAME      URL                                                                 AGE   READY   REASON
sq-demo   http://sq-demo-kn-sequence-0-kn-channel.default.svc.cluster.local   68s   True

创建一个pod进行curl请求测试

kubectl run client-$RANDOM --image=ikubernetes/admin-box:v1.2 --restart=Never -it --command -- /bin/sh
curl -v "http://sq-demo-kn-sequence-0-kn-channel.default.svc.cluster.local" -X POST -H "Content-Type: application/cloudevents+json" \
        -d '{"id": "say-bye", "specversion": "1.0", "type": "com.yang.saybye", "source": "sendoff", "data": {"message":"Hello Knative Sequence Flow"}}'

查看消息

[root@master ~]# kubectl logs -f event-display-01-00001-deployment-68d48cbdf8-lv9m4 

标签:02,03,01,Sequence,default,sq,示例,Flow,appender
From: https://www.cnblogs.com/zyyang1993/p/16820518.html

相关文章

  • SP685 SEQPAR - Partition the sequence 题解
    SP685SEQPAR-PartitionthesequenceSolution目录SP685SEQPAR-PartitionthesequenceSolution更好的阅读体验戳此进入题面SolutionCodeUPD更好的阅读体验戳此进......
  • 【解决】CICD、GitHub actions workflow新建仓库push时报错could not read Username f
    git报错fatal:couldnotreadUsernamefor'https://github.com':Nosuchdeviceoraddress原因是没有GitHubtoken,而且cicd时无法输入用户密码正常来说我们使用act......
  • 按照tensorflow jupyer
    anaconda 安装包 链接:https://pan.baidu.com/s/1wh6mYu1uMLlPM5Ai5ONCXQ提取码:3rlo 两个库pipinstalltensorflow==2.8.0keras==2.8-ihttps://pypi.douban.co......
  • Tensorflow解析tfrecord
    1、序列化#coding:utf-8from__future__importabsolute_importfrom__future__importdivisionfrom__future__importprint_functionimportnumpyasnpimpor......
  • win11+cuda11.2+cudnn+Tensorflow-GPU 环境配置
    名词解释CUDA即英伟达的显卡并行计算框架,nvidia-smi可以查看tensorflow-gpu的运行需要它的底层支持,它是一个计算框架,抽象层次比驱动高,每个版本的CUDA都是基于一定版......
  • 好玩的文字流程图:flowchart-fun
    流程图/思维导图让工作变得高效。但是,绘制流程图/思维导图的方式能不能更高效一些呢?比如,随手敲字,就自动生成简洁明了的可伸缩矢量图。现在,一款名叫flowchart.fun的网页......
  • [Typescript] 62. Medium - Fibonacci Sequence
    Implementageneric Fibonacci<T> thattakesanumber T andreturnsitscorresponding Fibonaccinumber.Thesequencestarts:1,1,2,3,5,8,13,21,34,......
  • istio部署后端单版本应用示例
    环境说明frontend(proxy):前端应用,会请求后端的demoappservice:proxydemoapp:后端应用service:demoappv10访问流程clientpod--->(EgressListener......
  • 基于TensorFlow和Python的机器学习(笔记2)
    基于TensorFlow和Python的机器学习(笔记2)     油耗预测项目(实战)importioimportos.pathimportmatplotlib.pyplotaspltimportkeras.utilsimportte......
  • java -jar 的脚本示例
    #!/bin/bash#chkconfig:23458090#date:2022年3月21日#启动第一个jar包PID=$(ps-ef|grepruoyi-monitor-admin.jar|grep-vgrep|awk'{print$2}')if[......