Skip to content

Conversation

@laxuankhanh1902
Copy link
Collaborator

@laxuankhanh1902 laxuankhanh1902 commented Dec 22, 2025

Summary

This PR introduces two new optional features for improved CLI UX when working with Conduktor Console (requires console-plus#4510 to be released first). No breaking changes - all existing commands and flags continue to work exactly as before.

Demo: https://asciinema.org/a/dsoXluaQjn7CCqn7raknaRzIv

Why Move Logic to the Server?

  1. Simpler CLI - Less logic in the client, easier to maintain
  2. More control - Server handles parsing, versioning, parallelization, and logging
  3. Better performance - Fewer round-trips between client and server
  4. Reusable endpoints - These APIs can be leveraged for other purposes (including future LLM integrations)

Note: These are purely additive changes. The default behavior of apply and template commands remains unchanged. Users can opt-in to the new features by adding the new flags.

New Features

Server-Side Apply (--server-side)

Instead of applying resources one-by-one from the client, --server-side sends all resources in a single HTTP request and polls for status updates.

conduktor apply -f resources/ --server-side
conduktor apply -f resources/ --server-side --strategy continue-on-error
conduktor apply -f resources/ --server-side --dry-run

Benefits:

  • More efficient for large numbers of resources
  • Server handles ordering and dependency resolution
  • Automatic retries on transient failures
  • Live progress display with polling

New flags:

  • --server-side: Enable server-side processing
  • --strategy: fail-fast (default) or continue-on-error
  • --no-progress: Disable live progress (useful for CI)
  • --yes: Skip confirmation for large operations (50+ resources)

Exit codes:

  • 0: All resources applied successfully
  • 1: All resources failed (or error occurred)
  • 2: Partial success (some succeeded, some failed)

Live Templates (--live)

Fetch templates directly from the Console server instead of using embedded defaults.

conduktor template --live                        # List available kinds from server
conduktor template Topic --live                  # Get Topic template from server
conduktor template Topic --live --cluster gw1   # Get template for specific gateway cluster

Benefits:

  • Templates are always up-to-date with the server's schema
  • Access to gateway-specific kinds when using --cluster (e.g., VirtualCluster, Interceptor, GatewayServiceAccount)

Backward Compatibility

Command Without new flags With new flags
apply -f file.yaml ✅ Works as before (client-side) --server-side opts into server processing
template Topic ✅ Works as before (embedded) --live opts into server templates
  • All existing scripts and workflows continue to work without modification
  • New flags are opt-in only
  • No changes to default behavior

API Endpoints Used

  • POST /public/v1/resources/batch-apply - Submit resources for server-side apply
  • GET /public/v1/resources/batch-apply/{token} - Poll for apply status
  • GET /public/v1/resources/template - List available template kinds
  • GET /public/v1/resources/template/{kind} - Get template for specific kind

@laxuankhanh1902 laxuankhanh1902 force-pushed the franklx/server-side-apply-and-template branch from 01cd722 to dc60888 Compare December 22, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants