Skip to content

feat: comprehensive Kubernetes (kubectl) ecosystem support #857

@pszymkowiak

Description

@pszymkowiak

Context

RTK has basic kubectl support (pods, services, logs) in src/container.rs but many common commands and global flags are missing.

Current state

Command Status Filter
kubectl get pods Rust Compact table
kubectl get services Rust Compact table
kubectl logs <pod> Rust Dedup
kubectl <other> Passthrough No filtering

Missing global flags (priority)

All kubectl subcommands support these flags but RTK ignores them:

  • --context — multi-cluster (essential for devops)
  • --kubeconfig — custom config file
  • -n / --namespace — only on pods/services, not on other subcommands
  • -l / --selector — label selector
  • --as / --as-group — impersonation

Scope — TOML filters preferred

Command Description Approach Expected savings
kubectl get deployments Deployment list TOML — strip headers, compact table 60-70%
kubectl get nodes Node list TOML — strip headers, compact 60-70%
kubectl get configmaps ConfigMap list TOML — compact table 60-70%
kubectl get ingress Ingress list TOML — compact table 60-70%
kubectl get all All resources TOML — strip empty, compact 70-80%
kubectl describe pod Pod details TOML — strip events noise, keep status 70-80%
kubectl describe node Node details TOML — strip conditions/events noise 70-80%
kubectl apply -f Apply output TOML — short-circuit on "configured/created" 80-90%
kubectl top pods Resource usage TOML — compact table 50-60%
kubectl top nodes Node usage TOML — compact table 50-60%
kubectl rollout status Rollout status TOML — short-circuit on success 80%
kubectl exec Exec passthrough No filter needed 0%

Global flags (Rust change needed)

The KubectlCommands enum in main.rs needs a shared struct for global flags (--context, --kubeconfig, -n, -l, --as) forwarded to all subcommands. This is a Rust change in main.rs + container.rs.

Implementation priority

  1. Global flags (Rust) — --context, --kubeconfig, -n, -l on all subcommands
  2. TOML filterskubectl-describe.toml, kubectl-apply.toml, kubectl-rollout.toml
  3. Additional get resources — TOML for deployments, nodes, configmaps, ingress

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort-largePlusieurs jours, nouveau moduleeffort-medium1-2 jours, quelques fichiersenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions