Skip to content

[FEAT cloudctl] - Add foreach command with context selector and parallel execution #73

Open

Description

@onuryilmaz

User Story

As a cloudctl user, I want to run a kubectl command across many clusters at once, so I can perform fleet-wide operations and compliance checks efficiently.

Description

cloudctl foreach --selector <sel> kubectl <args> — filters kubeconfig contexts using label-style selectors, shows a confirmation prompt, then runs the command in parallel across all selected contexts with per-context prefixed output and fail count aggregation.

Selector syntax: name=VALUE, name!=VALUE, name in (a,b,c), name notin (a,b,c), name~=REGEX, name!~=REGEX. Empty selector matches all contexts.

Acceptance Criteria

  • Context list read from kubeconfig
  • All selector syntaxes supported
  • Confirmation prompt shown unless --quiet / -q
  • Commands run in parallel across selected contexts
  • stdout/stderr output prefixed with [context-name]
  • Exit with error if any execution fails; total failure count reported

Reference Issues

Epic: #70

Activity

  1. added
    featureNew functional capabilities or significant additions to the CLI.
    automationCapabilities that enhance the tool's use in CI/CD or scripts
    on Aug 31, 2026
  2. github-actions commented on Aug 31, 2026

    @github-actions

    Thanks for opening this issue! 🎉

    A maintainer will triage it within 5 business days. You can learn more about our issue workflow in the Issue Lifecycle documentation.

    In the meantime, please make sure you have provided:

    • A clear problem statement
    • Steps to reproduce (for bugs)
    • Expected vs actual behavior

    This helps us route your issue faster.

  3. added
    needs-refinementNeeds scoping before implementation
    and removed
    needs-triageNew issue, not yet reviewed
    on Aug 31, 2026
  4. added
    backlogReady for sprint planning; triggers project addition
    and removed
    needs-refinementNeeds scoping before implementation
    on Sep 28, 2026
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

    automationCapabilities that enhance the tool's use in CI/CD or scriptsbacklogReady for sprint planning; triggers project additionfeatureNew functional capabilities or significant additions to the CLI.good first issueGood for newcomers

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions