Warp icon indicating copy to clipboard operation
Warp copied to clipboard

Unable to `kubectl exec`

Open johnnyhuy opened this issue 2 years ago • 3 comments

Discord username (optional)

No response

Describe the bug

I cannot run kubectl exec commands as it silently fails to open up a shell in a pod. However, when using tools like k9s exec works but then exiting with ctrl + D, the window becomes blank and unusable, which requires a restart of the tab.

To Reproduce

If we don't have a Kubernetes cluster ready. Use Minikube to spin one up locally - installation (Homebrew works as well), guide.

Create a deployment and exec into the pod.

$ kubectl exec deploy/hello-node -- /bin/sh

When using k9s exec into a pod by selecting a pod and press s, then exit with ctrl + D

Expected behaviour

We should see an interactive shell open up with kubectl exec

k9s should come back when exiting the shell.

Screenshots

No response

Operating System

MacOS

OS Version

11.6.1

Shell Version

zsh 5.8 (x86_64-apple-darwin20.0)

Warp Version

v0.2022.08.01.09.12.stable_02

Additional context

No response

Does this block you from using Warp daily?

Yes

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

No response

johnnyhuy avatar Aug 10 '22 22:08 johnnyhuy

Do you have a list of steps I can get up and running with kubernetes and create a kubernetes pod? I've tried to look online, but it seems really nontrivial

zheng avatar Aug 10 '22 22:08 zheng

Hey @zheng good call, I've put some steps on how to run kubectl locally with Minikube. Requires Docker.

johnnyhuy avatar Aug 10 '22 22:08 johnnyhuy

Hey @johnnyhuy,

  • for the kubectl part of the issue, I think you can get an interactive shell by specifying the -i and -t options when running exec. So something like kubectl exec -it deploy/hello-node -- /bin/sh should work!
  • for the k9s issue, we were able to repro inconsistently. Does this happen everytime for you when exiting k9s via CTRL-D?

szgupta avatar Aug 11 '22 15:08 szgupta

Hey @johnnyhuy,

* for the `kubectl` part of the issue, I think you can get an interactive shell by specifying the `-i` and `-t` options when running `exec`. So something like `kubectl exec -it deploy/hello-node -- /bin/sh` should work!

* for the `k9s` issue, we were able to repro inconsistently. Does this happen everytime for you when exiting `k9s` via `CTRL-D`?

Awesome, using -it worked 🚀

For k9s I'm using kubectl create deployment hello-node --image=nginx since I'm on an M1, echo server doesn't work.

$ k9s version
 ____  __.________
|    |/ _/   __   \______
|      < \____    /  ___/
|    |  \   /    /\___ \
|____|__ \ /____//____  >
        \/            \/

Version:    0.25.18
Commit:     6085039f83cd5e8528c898cc1538f5b3287ce117
Date:       n/a

$ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.1", GitCommit:"3ddd0f45aa91e2f30c70734b175631bec5b5825a", GitTreeState:"clean", BuildDate:"2022-05-24T12:17:11Z", GoVersion:"go1.18.2", Compiler:"gc", Platform:"darwin/arm64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:19:12Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/arm64"}
$ minikube start
😄  minikube v1.25.2 on Darwin 11.6.1 (arm64)
✨  Using the docker driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
🏃  Updating the running docker "minikube" container ...
🐳  Preparing Kubernetes v1.23.3 on Docker 20.10.12 ...
    ▪ kubelet.housekeeping-interval=5m
🔎  Verifying Kubernetes components...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

$ kubectl create deployment hello-node --image=nginx

$ k9s

This is what it looks like when I CTRL-D, I can't press anything to go back to k9s or even the home shell. I have to create a new tab and close that one to recover.

image

johnnyhuy avatar Aug 12 '22 08:08 johnnyhuy

@johnnyhuy does it happen on a new tab as well? When I tried this the first time, the problem happened but it doesn't happen when I open a new tab and try k9s

szgupta avatar Aug 12 '22 19:08 szgupta

@johnnyhuy does it happen on a new tab as well? When I tried this the first time, the problem happened but it doesn't happen when I open a new tab and try k9s

Weirdly enough I was able to exit back into k9s the first time but the following times I got the same issue. I typed some stuff and then pressed ctrl + D.

Another thing I've noticed was using k9s editing manifests on Vim and saving + exiting it would result in the same issue. But I couldn't reproduce it on my other device.

Screen Recording 2022-08-13 at 9 08 16 am

This time I've tried it on my M1 Pro on macOS 12.4

image

johnnyhuy avatar Aug 12 '22 23:08 johnnyhuy

Getting the same issues Logs contain the following error: /Application Support/k9s/views.yml: no such file or directory

amitpaz avatar Aug 13 '22 07:08 amitpaz

FYI, tested this with other terminals out in the wild like Tabby, VSCode and iTerm2, and they all behave correctly at all times 😬

johnnyhuy avatar Aug 18 '22 00:08 johnnyhuy

We've been able to repro the shell/edit issue with k9s, we will provide updates as soon as we can.

also, kubectl exec deploy/<deployment_name> -- /bin/sh doesn't work on iTerm, terminal.app, VS Code Terminal either. Only works with the -it flag

dannyneira avatar Aug 18 '22 17:08 dannyneira

We've been able to repro the shell/edit issue with k9s, we will provide updates as soon as we can.

also, kubectl exec deploy/<deployment_name> -- /bin/sh doesn't work on iTerm, terminal.app, VS Code Terminal either. Only works with the -it flag

That's right, that's on me. I missed the -it flag 😛

johnnyhuy avatar Aug 18 '22 23:08 johnnyhuy

Same Here! this is the only thing keeping me from using your amazing product 100% of the time.

mrfrsh avatar Sep 30 '22 06:09 mrfrsh

@dannyneira any news on this ?

derlin avatar Oct 27 '22 11:10 derlin

@dannyneira any news on this?

Still occurring on the latest version image

amitpaz avatar Oct 27 '22 12:10 amitpaz

@amitpaz yes I know, this is why I would like to know if warp plans on addressing the issue soon, or if there is any changes on their side regarding this bug

derlin avatar Oct 27 '22 12:10 derlin

Still happens to me also

iochagov avatar Nov 18 '22 08:11 iochagov

Same here when using k9s (v0.2022.11.14.14.55.stable_01)

md-fid avatar Nov 21 '22 09:11 md-fid

Maybe caused by same issue:

  • https://github.com/warpdotdev/Warp/issues/833
  • https://github.com/warpdotdev/Warp/issues/1315

ventsislav-georgiev avatar Nov 23 '22 19:11 ventsislav-georgiev

There's also https://github.com/warpdotdev/Warp/issues/2133

janeklb avatar Nov 25 '22 13:11 janeklb

Hi all, sorry about this issue, we know this is a huge blocker for many so we appreciate your patience.

Closing as duplicate, please +1 and track this issue there > #833

dannyneira avatar Nov 29 '22 00:11 dannyneira

We recently made performance/compatibility updates to alt-screen apps like emacs, please let us know if you're still seeing the issues with the latest version of Warp.

dannyneira avatar Dec 19 '22 17:12 dannyneira