Create a task
Create a task from a ready-made starter or from scratch, choosing when it runs, what it should find out and what it may do. This page builds one that starts when a deployment in payments keeps crashing, reads its status and logs, and proposes a restart for 1 person to approve. Tasks explains what a task can read and change.
Before you start
- You hold
task.editoracross the whole catalog. - For a task that acts on a cluster, a runner serves it. See Let tasks act on a Kubernetes cluster.
- Optional: a runbook in Knowledge for the task to follow, such as "Payments crash loop".
Start from a starter
New task offers starters for what your instance has: For your cluster when a runner reports cluster problems, For your data when you can query tables, and For your catalog when you can see schemas and pipelines. A starter fills in every step, so you land on Check the task with only the name left to decide.
- Open Tasks and select New task.
- Under For your cluster, select Restart crash-looping deployments.
- Review each part, select its Edit button to change it, then select Create task.
To build the same task step by step, select Start from scratch instead.
Choose when it runs
Under When should this task run?, choose:
- Only when someone runs it, for a task you start yourself.
- On a schedule, then Once at a date and time, or Repeating with Repeats and a time.
- When something happens, for a task that starts on an event.
For the crash-loop task:
- Select When something happens.
- Under Where from, select
prod-cluster. - Under What happens, select A workload keeps crashing.
- Under Only when, set Namespaces to
payments. - Under If the same problem is reported again, select Start again only after and set Wait to 30 minutes, so one crashing deployment doesn't start the task over and over.
- Under If it's already running, select Wait, then run once for everything that arrived.
- Select Continue.
In short at the foot of the step says back what you chose.
Say what it should do
Under What should it do?, write the job as you'd brief a colleague: what to look at, what to follow and what to report.
-
Write the job:
A deployment in payments is crash-looping. Check its status and recentlogs, follow the payments crash-loop runbook, and propose a fix if therunbook says one applies. -
Optional: under Runbooks that may help, add "Payments crash loop". Marmot adds a line asking the task to follow it.
-
Select Continue.
Choose what it may do
What may it do? lists what each connected runner offers, with what each tool needs. Leave everything unticked and the task only reads, as the person it runs as.
- Tick Read a workload's status, Read a pod's logs and Read recent events.
- Tick Restart a workload. It shows Changes things and Needs 1 approval.
- Optional: open the row to require more approvals than the runner asks for, or to narrow its parameters.
- Select Continue.
Tools under Not allowed by the runner are ones the runner's policy doesn't name. Ask whoever runs the runner to add them.
Check and create it
- Under Check the task, review each part and select its Edit button to change it.
- Optional: give it a Name. Left empty, the task is named after what it does.
- Select Create task, or Save and try it now to run it once straight away.
Check that it worked
Open the task from Your tasks. Its page shows when it runs and, under Tools, what it may change and what it only looks at. After a run, Latest result shows the answer, and Run history lists each run. Open a run to see every step the agent took.
When the task proposes a change, it appears under Waiting for you on the Tasks page for everyone who can approve it.
Troubleshooting
| What you see | What to do |
|---|---|
| Where from shows the runner's source as Not connected | The runner isn't connected. Check that it's running and can reach Marmot. |
| What may it do? says no source is served from a runner | Set up a runner. See Let tasks act on a Kubernetes cluster. |
| A run fails with Step limit reached | The job needs more steps than allowed. Make the job narrower, or name the tables or runbook it should use. |
| A run ends Not completed | The agent couldn't answer the job as written. Open the run to see why, then select Edit question. |
| Plan limit reached | Your plan's runs per day or tokens per month are used up. Runs start again the next day, or the next month for tokens. |
| The task's tools are paused | The same target kept coming back after a change. Find out why, then select Resume tools on the task's page. |
Next steps
- Approve changes: review and approve what the task proposes.
- Start tasks from your alerts: connect Alertmanager, Grafana or Datadog.
- Tasks: what a task can read and change.