Subject: bug#59797: 30.0.50; [wishlist] Using namespaces in Tramp's kubernetes integration

From: Filipp Gunbin <[email-masked]>
Date: Tue, 06 Dec 2022 16:56:30 +0300

Hi Michael,

On 05/12/2022 16:54 +0100, Michael Albinus wrote:

>> My motivation behind adding limited k8s support to Tramp was to be able
>> to login into pod.  A service is a more high-level abstraction, you
>> cannot log into service, as there're some particular pods behind it.
>> From my limited knowledge and experience of k8s, listing pods in the
>> current namespace is ok.  We could add more scenarios when the need
>> arises.
>
> I don't speak about services in general. I speak about pods.
>
> Imagine, you have "pod1" in your current context, and "pod2" in another
> namespace, call it "another-namespace".
>
> "kubectl get pods" shows you "pod1". "kubectl get pods --namespace
> another-namespace" shows you "pod2".
>
> "kubectl exec pod1 -it -- /bin/sh" access pod1 in your current
> context. This is what we use when we access via remote file name syntax
> "/kubernetes:pod1:".
>
> pod2 is not accessible in your current context. But you could apply
> "kubectl exec pod2 -it --namespace another-namespace -- /bin/sh". This
> is what I mean with remote-file name syntax "/kubernetes:pod1.another-namespace:".
>
> Is this possible?

Maybe, and there's "get pods -A" which lists all pods.  This will be
limited to current "context" in k8s meaning (covering all namespaces in
it).  I could look into this in detail in few weeks, if you'd like me
to.  It's quite a busy time at work now :-)

Filipp