Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@ server.Run()

`RegisterRoutes` mounts CRUD and backup endpoints under `/api/v1/{name}`.

## Detached Jobs

Some operations (backups, restores, migrations) are easier to run as one-shot Kubernetes Jobs, detached from the provider pod.

- `client.JobRunner` (also on `provider.Base` as `Jobs`) — `Run` / `State` / `Delete` / `Replace` a one-shot Job, with an optional owned credentials Secret injected via `secretKeyRef`.
- `provider.ServiceJob` / `ServiceJobSpec` — build a `JobSpec` with a consistent name (`<operation>-<key>`) and identity labels; `BackupStatusFromJob` / `OperationStatusFromJob` map a Job's state to a status.

```go
spec := provider.ServiceJobSpec(provider.ServiceJob{
Operation: provider.JobOpBackup, MsID: id, Key: backupID,
Image: img, Command: []string{"/backup"},
Env: env, Secrets: secrets, // whatever your image reads
})
err := p.Jobs.Run(ctx, ns, spec)
```

See the package docs and `provider/servicejob_usage_test.go` for details.

## Configuration

`config.Load()` reads these environment variables:
Expand Down
Loading
Loading