lensapp / lens

Lens - The way the world runs Kubernetes
https://k8slens.dev/
MIT License
22.59k stars 1.47k forks source link

Shell to a node: Connecting... #2598

Open bjosafa opened 3 years ago

bjosafa commented 3 years ago

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

Nokel81 commented 3 years ago

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

bjosafa commented 3 years ago

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

Nokel81 commented 3 years ago

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

bjosafa commented 3 years ago

logs.zip

There you go, sorry for delay

bjosafa commented 3 years ago

Any news?

Nokel81 commented 2 years ago

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

lukjaw commented 1 year ago

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