lens icon indicating copy to clipboard operation
lens copied to clipboard

Shell to a node: Connecting...

Open bjosafa opened this issue 3 years ago • 7 comments

I am using a Windows Server 2016 - Version 1607 and when I trying to connect in a node it hangs on message: "Connecting..."

I already tried use lens' version 4.2.1 and 5.0.0-alpha.1

It it working properly with pods

bjosafa avatar Apr 22 '21 21:04 bjosafa

Is this a windows node that you are connecting to? Because node-shell currently doesn't work for windows nodes.

Nokel81 avatar Apr 26 '21 12:04 Nokel81

No, it is a redhat node. I installed Lens in a Win2016 box.

bjosafa avatar Apr 27 '21 14:04 bjosafa

Can you provide some logs? https://docs.k8slens.dev/v4.2.3/faq/?h=+logs#where-can-i-find-application-logs

Nokel81 avatar Apr 27 '21 14:04 Nokel81

logs.zip

There you go, sorry for delay

bjosafa avatar Apr 30 '21 12:04 bjosafa

Any news?

bjosafa avatar May 24 '21 15:05 bjosafa

Sorry for the long delay, unfortunately those logs don't seem to indicate anything. Is this potentially related to #5305 ?

Nokel81 avatar Jun 27 '22 20:06 Nokel81

Hi i was having the same problem, clicking on node shell was just giving me connecting forverer, so i made this as a workaround:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: node-shell
  namespace: kube-system
  labels:
    k8s-app: node-shell
spec:
  selector:
    matchLabels:
      name: node-shell
  template:
    metadata:
      labels:
        name: node-shell
    spec:
      terminationGracePeriodSeconds: 0
      hostPID: true
      hostIPC: true
      hostNetwork: true
      tolerations:
      # this toleration is to have the daemonset runnable on master nodes
      # remove it if your masters can't run pods
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
        operator: "Exists"
      containers:
      - name: shell
        image: alpine:3.9
        securityContext:
          privileged: true
        command: ["nsenter"]
        args: ["-t", "1", "-m", "-u", "-i", "-n", "sleep", "14000"]

its basically starting a privilged pod on every worker node, and when You are entering this pod's shell, its opening shell as root on the given node:

image

lukjaw avatar Dec 14 '22 09:12 lukjaw