我想弄清楚如何使用Argo设置工作队列。Argo 工作流程的计算成本很高。我们需要为许多同时发生的请求做好计划。工作流项目通过 HTTP 请求添加到工作队列。
该流程可以这样演示:
client
=> hasura # user authentication
=> redis # work queue
=> argo events # queue listener
=> argo workflows
=> redis + hasura # inform that workflow has finished
=> client
Run Code Online (Sandbox Code Playgroud)
我从未构建过超出其资源的 K8s 集群。在哪里限制工作流程的执行?或者 Argo Events 和 Workflows 是否根据集群中的资源来限制这些?
上面的例子可能可以简化为以下内容,但问题是如果处理队列已满会发生什么?
client
=> argo events # HTTP request listener
=> argo workflows
Run Code Online (Sandbox Code Playgroud) 我有一个 WorkflowTemplate“nyc-test-template”,我通过 Argo Events 和 PubSub 触发它。因此,如果我将消息发布{}到 PubSub 主题“argo-events-nyc”,则通过 a 指定的模板workflowTempateRef将启动。这确实工作得很好。现在我想参数化要启动的模板。
我的无效草稿如下所示:
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: pubsub-event-source-nyc
spec:
template:
serviceAccountName: argo-events
pubSub:
examplex:
jsonBody: true
topic: argo-events-nyc
subscriptionID: argo-events-nyc-sub
---
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: pubsub-sensor-nyc
spec:
template:
serviceAccountName: argo-events-sa
dependencies:
- name: pubsub-event-source-dep
eventSourceName: pubsub-event-source-nyc
eventName: examplex
triggers:
- template:
name: argo-workflow-trigger
argoWorkflow:
group: argoproj.io
version: v1alpha1
resource: workflows
operation: submit
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: nyc-test-template-
namespace: argo …Run Code Online (Sandbox Code Playgroud) 我正在尝试ClusterWorkflowTemplate从 argo/ argo-events 中的发布请求触发预先存在的事件。
我一直在遵循此处的示例,但我不想在传感器中定义工作流程 - 我想将其分开。
\n我无法导入传感器并触发工作流程,有什么问题吗?
\n# kubectl apply -n argo-test -f templates/whalesay/workflow-template.yml\napiVersion: argoproj.io/v1alpha1\nkind: ClusterWorkflowTemplate\nmetadata:\n name: workflow-template-submittable\nspec:\n entrypoint: whalesay-template\n arguments:\n parameters:\n - name: message\n value: hello world\n templates:\n - name: whalesay-template\n inputs:\n parameters:\n - name: message\n container:\n image: docker/whalesay\n command: [cowsay]\n args: ["{{inputs.parameters.message}}"]\nRun Code Online (Sandbox Code Playgroud)\n# kubectl apply -n argo-events templates/whalesay/event-source.yml\napiVersion: argoproj.io/v1alpha1\nkind: EventSource\nmetadata:\n name: webhook\nspec:\n service:\n ports:\n - port: 12000\n targetPort: 12000\n webhook:\n # event-source can run multiple HTTP servers. Simply define …Run Code Online (Sandbox Code Playgroud)