kubectl: kubectl freezing mac
What happened:
Basic kubectl commands like kubectl get service
freeze up my mac, making it impossible to click or do anything for minutes at a time.
What you expected to happen:
The command should complete quickly without interrupting other macOS applications.
How to reproduce it (as minimally and precisely as possible):
$ kubectl get service
Environment:
- Kubernetes client and server versions (use
kubectl version
):
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", BuildDate:"2021-02-21T20:21:49Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"19+", GitVersion:"v1.19.8-eks-96780e", GitCommit:"96780e1b30acbf0a52c38b6030d7853e575bcdf3", GitTreeState:"clean", BuildDate:"2021-03-10T21:32:29Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
-
Cloud provider or hardware configuration: EKS
-
OS (e.g:
cat /etc/os-release
):
$ cat /etc/os-release
cat: /etc/os-release: No such file or directory
$ uname -a
Darwin lounge.local 20.4.0 Darwin Kernel Version 20.4.0: Fri Mar 5 01:14:14 PST 2021; root:xnu-7195.101.1~3/RELEASE_X86_64 x86_64
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (8 by maintainers)
@eddiezane I ended up tailing the MacOS system log (
Applications
->Utilities
->Console
) while using kubectl and discovered a pattern of anti-virus process crashes which aligned nicely with the freezes. Maybe there are also other applications other than anti-virus’ that could be involved in the freezes.In my case the log entries looked something along the lines of:
I cannot check for the exact message right now as I’m writing this from my linux box. I’ll see if I can grab it from my mac during work tomorrow.
Edit: Also Big Sur might be an issue here. We did only see these kubectl freezes on Big Sur so far. Catalina and Mojave did not show these issues with the same anti-virus running.
My colleges and I were also experiencing kubectl freezes on MacOS Big Sur and started to dig a little bit. The problem occured both for amd64 and arm64 (M1) Macs, with the M1 freezing much more frequently.
In the end the freezes were not causes by kubectl but the anti-virus that was installed on our corporate laptops (Sophos Endpoint in our case). It was not kubectl freezing but an anti-virus process which was then terminated by the kernel with SIGKILL after some seconds (up until a minute). Disabling the anti-virus made the freezes go away completely. The more frequent freezes on the M1 are probably caused by the fact that there are no arm64 builds of this particular anti-virus yet. So rosetta is involved.
I suspect that it maybe hangs itself when reading through the http-cache that kubectl writes.
Hope this helps.
Oh sorry, did not catch that one, I was getting frustrated so I uninstalled it. Will update when I reinstall Kubernetes again.