mirror of
https://github.com/kubevela/kubevela.git
synced 2026-07-29 10:21:29 +00:00
* Feat: expose HTTP timeout on built-in workflow steps Allow request, webhook, and notification steps to set an optional timeout (Go duration string) that is forwarded to http.#HTTPDo as request.timeout, so slow HTTP calls are no longer stuck at the 3s default. Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com> * Feat: Made requested changes Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com> * Fix: align timeout duration regex with Go ParseDuration Accept "0" and leading-dot fractions like ".5s", matching time.ParseDuration more closely while still rejecting unit-less values such as "30". Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com> --------- Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com>
Install Definitions
kubectl apply -f definition.yaml
Check Component and Workflow definitions:
kubectl get componentDefinition
kubectl get workflowstep
Output:
NAME AGE
singleton-server 49s
NAME AGE
apply-component 49s
apply-with-ip 49s
Begin The Workflow Demo
This Demo is to apply component in the cluster in order by workflow, and inject the IP of the previous pod into the environment variables of the next Pod.
-
Apply Application:
kubectl apply -f app.yaml -
Check workflow status in Application:
kubectl get -f app.yamlOutput:
... status: workflow: appRevision: application-sample-v1 contextBackend: apiVersion: v1 kind: ConfigMap name: workflow-application-sample-v1 uid: 783769c9-0fe1-4686-8528-94ce2887a5f8 stepIndex: 2 steps: - name: deploy-server1 phase: succeeded resourceRef: apiVersion: "" kind: "" name: "" type: apply - name: deploy-server2 phase: succeeded resourceRef: apiVersion: "" kind: "" name: "" type: apply -
Check Resource in cluster.
kubectl get podsOutput:
NAME READY STATUS RESTARTS AGE server1 1/1 Running 0 15s server2 1/1 Running 0 18sThis means the resource has been rendered correctly.
-
Check
server2Environment variablekubectl exec server2 -- env|grep PrefixIPOutput:
PrefixIP=10.244.0.22
WorkflowStep Definition Introduction.
WorkflowStep consists of a series of actions, you can describe the actions to be done step by step in WorkflowStep Definition.
op.#LoadGet component schema from workflow contextop.#ApplyApply schema to cluster.op.#ConditionalWaitCondition waits until continue is true.