InfraDots logo
Documentation

Worker Pools

Worker Pools are dedicated compute resources that execute your infrastructure operations in your workspaces. InfraDots by default grants dedicated workers to each organization depending on the subscription type, but they are not visible within your Organization dashboard and reside on InfraDots infrastructure. By using Worker Pools you can deploy workers within your own infrastructure to gain full control over the execution environment, network access, and security posture of your Terraform/OpenTofu runs.

What is a Worker Pool?

  • Provides control over your code execution within your environment in your hands
  • Supports custom images and tools for specialized workflows
  • Ensures consistent execution environments across your organization
  • Enables parallel processing of multiple infrastructure operations

Benefits of Worker Pools

  • Isolation: Each workspace can run in its own dedicated environment
  • Scalability: Scale compute resources based on your infrastructure needs
  • Customization: Use custom Docker images with specific tools and versions
  • Security: Run operations in isolated environments with controlled network access
  • Performance: Dedicated resources ensure consistent execution times

Managing Worker Pools

Creating a Worker Pool

  1. Navigate to your organization
  2. Click "Worker Pools" in the sidebar
  3. Click "Create Worker Pool"
  4. Enter a name and description for the pool
  5. Click "Create Worker Pool"
  6. Copy the Registration token as it is only shown once

After creating a worker pool, deploy the worker agent using Docker:

docker run -d \
  --name infradots-worker \
  -e INFRADOTS_WORKER_TOKEN="your-registration-token" \
  -e INFRADOTS_API_URL="https://app.infradots.com" \
  ghcr.io/Infra-Dots/worker:latest

Or with Docker Compose:

services:
  infradots-worker:
    image: ghcr.io/Infra-Dots/worker:latest
    restart: unless-stopped
    environment:
      INFRADOTS_WORKER_TOKEN: '${WORKER_TOKEN}'
      INFRADOTS_API_URL: 'https://app.infradots.com'

⚠️ Warning

[!warning] The registration token is only displayed once after creation. Store it securely — you will need it to authenticate your worker agents.

Assigning Worker Pools to Workspaces

  1. Navigate to your workspace settings
  2. Go to the "General" tab
  3. In the "Worker Pool" section, select your desired pool
  4. Click "Save Settings"

Alternatively, you can assign worker pools during workspace creation.

Monitoring and Troubleshooting

Worker Pool Metrics

Available soon

Troubleshooting Common Issues

Workers Not Starting

  • Check image version and logs
  • Verify network and security group configuration - the worker must have access to app.infradots.com
  • Review worker pool resource limits

Slow Performance

  • Monitor resource utilization metrics
  • Consider upgrading instance types
  • Check for network latency issues
  • Review auto-scaling configuration

Operation Failures

  • Check worker logs for error details
  • Verify environment variables and secrets
  • Ensure required tools are available in the image
  • Review workspace-specific configuration

Best Practices

Resource Planning

  • Start with smaller instance types and scale as needed
  • Monitor usage patterns to optimize costs
  • Use auto-scaling to handle variable workloads
  • Set appropriate resource limits and quotas

Security

  • Regularly rotate secrets and credentials
  • Implement least-privilege access policies
  • Monitor worker pool usage and access patterns

Organization

  • Create separate pools for different environments (dev/staging/prod)
  • Use descriptive names and tags for easy identification
  • Document custom configurations and requirements
  • Establish governance policies for pool usage