Overview
Control Plane Task Runner is a self-hosted task queue and scheduler service similar to Google Cloud Tasks. It provides HTTP-based task enqueuing with automatic retry, delayed and scheduled execution, per-client rate limiting, and multi-queue support with priority levels.What Gets Created
- API Workload — HTTP endpoint for enqueuing tasks, managing clients, and health checks. Scales between 1 and 3 replicas by default.
- Worker Workload — Background processor that picks tasks off the queue and executes them. Scales between 1 and 5 replicas by default.
- Redis with Sentinel — A Redis instance with Redis Sentinel for high-availability task persistence and coordination. Sentinel monitors the Redis primary and handles automatic failover.
- Secret — An opaque secret containing Redis and Sentinel passwords and the admin API key (when
createSecretistrue). - Identity & Policy — An identity bound to the workloads with
revealaccess to the task runner secrets.
Architecture
The API workload receives task submissions over HTTP and pushes them into Redis. The Worker workload polls Redis and executes tasks by making outbound HTTP requests to the configured target URLs. Both workloads connect to Redis via Sentinel for failover resilience.This template does not create a GVC. You must deploy it into an existing GVC.
Installation
This template has no external prerequisites. To install, follow the instructions for your preferred method:UI
Browse, install, and manage templates visually
CLI
Manage templates from your terminal
Terraform
Declare templates in your Terraform configurations
Pulumi
Declare templates in your Pulumi programs
Configuration
The defaultvalues.yaml for this template:
API Workload
api.enabled— Enable or disable the API workload.api.replicas— Min/max replica count for autoscaling (default: 1–3).api.port— Container port (default8080).api.public.enabled— Expose the API to the public internet.api.public.pathPrefix— Optional path prefix for the public endpoint. Leave empty to serve from the root.api.resources— CPU and memory allocated to each API replica.api.env.logLevel— Log verbosity:debug,info,warn, orerror.api.env.adminApiKey— API key for admin-protected endpoints. Leave empty to disable admin authentication.api.env.connectRetries/api.env.retryIntervalSec— Redis connection retry behavior on startup.
Worker Workload
worker.enabled— Enable or disable the Worker workload.worker.replicas— Min/max replica count for autoscaling (default: 1–5).worker.resources— CPU and memory allocated to each Worker replica.worker.env.concurrency— Number of tasks a single Worker replica can execute concurrently.worker.env.taskTimeoutSec— Maximum duration in seconds before a task execution is considered failed (default1800).worker.env.maxRetry— Maximum number of retry attempts for a failed task.worker.env.allowPrivateUrls— Whentrue, allows tasks to target internal/private URLs.worker.env.cbFailureThreshold/worker.env.cbTimeoutSec— Circuit breaker settings to stop hammering failing endpoints.
Secrets and Redis
WhencreateSecret is true, the template automatically creates a secret named by secretName containing the Redis password, Sentinel password, and admin API key. The redis.*.fromSecret fields are pre-wired to reference this secret.
When using an existing secret (createSecret: false), update the redis.*.fromSecret fields to point to your secret name and the correct keys.
Change the default
redis.redisPassword and redis.sentinelPassword values before deploying to production.Enqueuing Tasks
Once deployed, submit tasks to the API workload’s public endpoint:Admin Endpoints
Whenapi.env.adminApiKey is set, admin endpoints require the X-Admin-Key header:
Rate Limiting
Rate limits are applied per client and configured via the admin API. Available tiers:| Tier | Requests/min | Max Concurrent |
|---|---|---|
free | 10 | 1 |
basic | 100 | 5 |
premium | 1,000 | 20 |
enterprise | 5,000 | 50 |
OpenTelemetry
To enable distributed tracing, setotelEndpoint in both api.env and worker.env. In your GVC configuration, ensure the Tracing Provider is set to Control Plane, then use the default HTTP collector endpoint: