rego /ˈre.ɡoː/ verb Definitions: manage, direct rule, guide
Rego is a
- 🔥 blazingly fast
- 🥇 API first
- 🌈 lightweight
- 🕜 Task orchestrator
It is designed to allow asynchronous workloads to be deployed over Kubernetes with minimal effort, while also providing a management API that can keep track of progress and run history.
please refer the docs
- Run async workloads that need s to be managed (or visible to) a UI
- Integrate non production-grade code (data scientist's R code for example) within your production environment in a contained way
- Use to run stuff periodically with run history
kubectl apply -f https://raw.githubusercontent.com/drorIvry/rego/main/deploy/deployment.yml
helm repo add rego https://drorivry.github.io/rego-charts/
helm install --generate-name rego/rego
curl -L https://raw.githubusercontent.com/drorIvry/rego-cli/main/install.sh | sh
curl -L https://raw.githubusercontent.com/drorIvry/rego/main/local-deploy/rego.sh | sh
Clone the repo and run:
go run main.go
rego comes with a pre-built CLI to use rego
after installing the cli you can use the rego
command to operate rego
test the connection
rego ping
deploy an image:
rego run -i hello-world
a more complex deployment
rego run -d "$(cat << EOF
{
"image": "hello-world",
"name": "test",
"args": "[\"1111\", \"33333\"]",
"namespace": "default",
"execution_interval": 0,
"ttl_seconds_after_finished": 10,
"metadata": {
"ttlSecondsAfterFinished": 10,
"completions": 10,
"parallelism": 10
}
}
EOF)"
With rego you can use the API to create and run k8s jobs with a managed API.
curl -X POST -d '{"image": "hello-world"}' localhost:4004/api/v1/task
This will start a job on your k8s cluster that'll run the docker image hello-world
the response will look something like
{
"definition_id": "a36fbd9b-bf8a-4c59-94c1-9938b6707e8f",
"message": "created"
}
we can use the definition ID to see the task's running status
curl http://localhost:4004/api/v1/task/a36fbd9b-bf8a-4c59-94c1-9938b6707e8f/latest
which will respond with
{
"ID": 0,
"CreatedAt": "2023-04-02T11:53:08.2008054+03:00",
"UpdatedAt": "2023-04-02T11:53:16.2032147+03:00",
"DeletedAt": null,
"id": "7eb53d97-7380-4e0b-82a6-b38fbf9119d2",
"task_definition_id": "a36fbd9b-bf8a-4c59-94c1-9938b6707e8f",
"status_code": 500,
"status": "SUCCESS",
"image": "hello-world",
"name": "test",
"ttl_seconds_after_finished": 10,
"namespace": "test",
"args": "[\"1111\", \"33333\"]",
"metadata": {
"ttlSecondsAfterFinished": 1
}
}
which indicates the success.
browse to http://localhost:4004/swagger/index.html
We welcome contributions from the community! If you'd like to contribute to the project, please follow these guidelines:
- Fork the repository
- Create a new branch: git checkout -b new-feature
- Make your changes and commit them: git commit -m "Add new feature"
- Push your changes to your fork: git push origin new-feature
- Create a pull request to the main repository
This project is licensed under the MIT License. See the LICENSE file for details.
- implement a CLI
- docker deployment
- support deployment kickoff
- add workflow options
- support kubernetes metadata
- support actual external DBs