Hi all,
I'd like to discuss possible changes to virtctl port-forward/ssh/scp
with you.
The syntax of virtctl works like this right now: $KIND/$NAME.$NAMESPACE
To me this is a bit unusual, especially if you look at kubectl port-
forward, which uses $KIND/$NAME and '-n' for specifying a namespace.
My assumption is that this syntax was added to satisfy the use case in
[1]. However, this syntax is a bit problematic, as seen in [2].
My suggestion would be to change virtctl port-forward/scp/ssh to use
the same syntax as kubectl ($KIND/$NAME and '-n' for the namespace).
This would mean that SSH configs as in [1] would now require to have
the '-n' flag if you want to specify a specific namespace and that a
single catch-all config for all namespaces would no longer be possible.
With the new syntax we could make multiple configs for different
namespaces work by accepting any kind of prefix before the first slash.
(right now only vm/ and vmi/ are accepted).
This also presents a chance to unify the commands to only use the VMI
subresource endpoint, as right now it is possible to switch between the
VM and VMI port-forward subresource endpoints, which both ultimately
connect to a VMI.
All in all, this would allow the virtctl code to become less brittle,
easier to maintain and the UX would be closer to kubectl.
Going forward with 1.5 I would like to deprecate the old syntax while
still keeping support it. In 1.6 I'd like to drop the old syntax
entirely.
Any comments on that? Do you think this is acceptable?
Thanks,
Felix
[1]
https://kubevirt.io/user-guide/user_workloads/accessing_virtual_machines/#using-virtctl-as-proxy
[2]
https://github.com/kubevirt/kubevirt/issues/13679