Executors
Executors are the core plugins that perform actual job tasks in Dkron. They implement different execution strategies and allow Dkron to interact with various systems and services.
Overview
Executors define how jobs are executed on target nodes. When a job is scheduled to run, Dkron uses the specified executor to perform the actual work. Each executor has its own configuration options and capabilities.
If you only plan to use the built-in executors, http
and shell
you can use the Dkron Light edition that only includes a single binary as the plugins are built-in.
Built-in Executors
Dkron includes the following built-in executors:
Executor | Description | Use Case |
---|---|---|
Shell | Executes shell commands on target nodes | Running scripts, system commands |
HTTP | Makes HTTP requests to specified endpoints | API integrations, web hooks |
Extended Executors (Open Source)
These executors are available as separate plugins in the open source version:
Executor | Description | Use Case |
---|---|---|
Kafka | Produces messages to Kafka topics | Event-driven architectures, data pipelines |
NATS | Publishes messages to NATS servers | Microservices communication, event publishing |
RabbitMQ | Sends messages to RabbitMQ exchanges | Message queuing, work distribution |
gRPC | Makes calls to gRPC services | Microservices integration, efficient RPC |
Google Pub/Sub | Publishes messages to Google Pub/Sub topics | Cloud-native event publishing |
Pro Executors
Dkron Pro includes additional commercially supported executors:
Executor | Description | Use Case |
---|---|---|
Docker | Runs containers and commands within containers | Isolated execution environments |
AWS ECS | Runs tasks on Amazon ECS clusters | Serverless job execution in AWS |
Executor Architecture
Executors follow a plugin architecture in Dkron:
- The Dkron server schedules a job and assigns it to a node
- The node loads the specified executor plugin
- The executor performs its action on the target system
- Results are returned to Dkron for processing
Common Executor Configuration Patterns
Most executors share some common configuration concepts:
- Timeouts: Limit how long a job can run before being terminated
- Environment Variables: Pass context to the execution environment
- Credentials: Securely provide authentication information
- Retry Logic: Define behavior when execution fails
Executor Selection Guide
When choosing an executor for your job, consider:
- Target System: What system or service needs to be interacted with?
- Isolation Needs: Does the job need to run in an isolated environment?
- Resource Requirements: How much CPU/memory is needed?
- Security Considerations: What permissions or credentials are required?
Custom Executors
Dkron supports custom executors through its plugin system. You can develop your own executors to meet specific requirements not covered by existing plugins.
To develop a custom executor:
- Implement the
Executor
interface from the Dkron plugin package - Follow the Go plugin system requirements
- Build and deploy your executor to the Dkron plugins directory
See the plugin development guide for more details.
Best Practices
- Use the Simplest Executor: Choose the simplest executor that meets your requirements
- Set Appropriate Timeouts: Always configure timeouts to prevent runaway jobs
- Validate Output: Use processors to validate and act on executor output
- Monitor Resource Usage: Pay attention to the resource consumption of jobs
- Security First: Follow the principle of least privilege when configuring executor permissions