Skip to content

AX-generated ActorTemplates have no workerSelector, so Tasks are scheduled onto unrelated WorkerPools #368

Open

Description

@zhoukuncheng

Summary

BuildActorTemplate in internal/substrate/client.go creates the per-Task ActorTemplate without a workerSelector. Substrate then places the actor on any worker in the atespace that has capacity, regardless of which WorkerPool it belongs to. In a cluster with more than one pool (for example a CPU pool for agents and a GPU pool, or the counter demo pool next to the AX pool) AX Tasks end up on workers that were not provisioned for them, and there is no field on Task, Gateway or the controller to prevent it.

AX d8ed0fe, Agent Substrate on a single-node kind cluster.

Reproduction

  1. Install Substrate with --deploy-demo-counter (creates WorkerPool counter in atespace ate-demo-counter) and create a second WorkerPool ax-workers in atespace ax-system for AX.
  2. Apply a handful of Tasks in atespace ax-system with a custom image.
  3. kubectl ate get actors -a ax-system:
ATESPACE   NAME       TEMPLATE                      STATE                WORKER POD
ax-system  task-1     ax-system/task-1-tmpl-...     ACTOR_STATE_RUNNING  ax-system/ax-workers-...
ax-system  task-3     ax-system/task-3-tmpl-...     ACTOR_STATE_RUNNING  ate-demo-counter/counter-...

The template created by AX has no workerSelector, while the demo's hand-written template pins workerSelector.matchLabels.workload: counter.

Expected

AX Tasks should only be scheduled onto workers intended for them. At minimum the controller should let the operator pin a selector; ideally Task (or Gateway) exposes it so different Tasks can target different pools (CPU vs GPU).

Suggested fix

Smallest change: add a --worker-selector key=value[,key=value] flag to ax-controller and set WorkerSelector.MatchLabels in BuildActorTemplate. Alternatively copy the selector from the base template named by --template when it exists. Longer term, a spec.workerSelector (or a pool field) on Task would map naturally onto this.

Activity

  1. rakyll commented on Sep 27, 2026

    @rakyll
    Member

    Related to #433.

  2. added
    devx
    on Oct 15, 2026
  3. siyuanfoundation commented on Oct 23, 2026

    @siyuanfoundation
    Collaborator

    /assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    devx

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions