What is Kestra?
Kestra is an open-source platform for managing data workflows and orchestrating complex data processing pipelines. It is designed to help data teams automate and manage complex workflows efficiently, including handling tasks like scheduling, monitoring, and troubleshooting end-to-end data processes.
Key Features of Kestra:
- Workflow Management: Kestra allows you to define, schedule, and manage complex workflows, including executing tasks sequentially or in parallel.
- Integration-Friendly: It supports integration with various data systems and cloud services.
- Monitoring and Reporting: Kestra provides detailed monitoring tools, helping you track the status and performance of your workflows.
- Scalability: With its distributed architecture, Kestra can scale to handle large workloads efficiently.
- User-Friendly Interface: Kestra offers an intuitive web interface where you can design and manage workflows directly.
Kestra still not avalible version in cloud. You just clone it about your my laptop an run it in local. You can use a instace and create a domain for everyone to access.
You can install Kestra using different methods. Select one that matches your preferred environment.
You can deploy Kestra (almost) anywhere, from your laptop or an on-prem server to a distributed cluster running in a public cloud. Note that some kestra plugins such as the Script plugin require Docker-in-Docker (DinD). This is not supported in certain environments such as e.g. on AWS Fargate. For production deployments, we recommend using Kubernetes or a virtual machine.
The easiest way to install Kestra locally is to use Docker (recommend).
Install Kestra
1 | docker run --rm -p 8080:8080 kestra/kestra |
Start write IaC in Kestra
Some params usally:
- id: name of your workflow
- namespace: environment for your workflow
- tasks: list tasks to execute in your flow
I will give me a template this workflow:
Tasks:
1 | id: get_started |
Let’s ref my workflow, it look quite easy to understand
Inputs:
1 | inputs: |
{input.variable_name}
Outputs:
{{ output.task_id.vars.output_name }}
Triggers:
1 | triggers: |
Test with write a script python: api_example.py and try it with kestra
1 | import requests as rq |
Test:
- Truy cập giao diện Kestra
- Click Flow hoặc tạo luôn flow mới
- Tại trình edit flow, copy đoạn code dưới để chạy thử khai báo input
- Nhấn Save và Execute
1 | id: huytest |
-
Xác nhận lại thông tin và nhấn Execute
-
Kết quả
-
Tìm Outputs để xem thông tin api response
- Tìm thử
{{ outputs.api.body }}
- Nhớ là phải đúng 2 dấu space nha