Kubernetes extension does not work with snap version of VS Code
See original GitHub issueI have the latest version of VS Code install through snap install code --classic
on Ubuntu.
When starting the Kubernetes extension (latest, installed through VSIX), I see the following error messages in /var/log/syslog
:
Apr 15 11:59:50 reef kernel: [13150.164921] audit: type=1400 audit(1555322390.646:498): apparmor="DENIED" operation="file_inherit" profile="/snap/core/6673/usr/lib/snapd/snap-confine" pid=18791 comm="snap-confine" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none
In another round of testing, I saw:
[69083.590392] audit: type=1400 audit(1554802886.556:723): apparmor="DENIED" operation="ptrace" profile="/usr/sbin/libvirtd" pid=1305 comm="libvirtd" requested_mask="read" denied_mask="read" peer="snap.vscode.vscode"
I turned there for help as I couldn’t figure out why the extension simply didn’t work for me with a local minikube
cluster up and running.
It appears snap
confinement blocks access to resources the Kubernetes extension need to figure out what’s happening.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:14
Top Results From Across the Web
Kubernetes extension does not work with snap version of VS ...
I have the latest version of VS Code install through snap install code --classic on Ubuntu. When starting the Kubernetes extension (latest, ...
Read more >Working with Kubernetes in VS Code
Working with Kubernetes in VS Code. This document will walk you through the process of deploying an application to Kubernetes with Visual Studio...
Read more >Kubernetes - Visual Studio Marketplace
Extension for Visual Studio Code - Develop, deploy and debug Kubernetes applications.
Read more >Visual Studio Code Frequently Asked Questions
Visual Studio Code FAQ. Our docs contain a Common questions section as needed for specific topics. We've captured items here that don't fit...
Read more >Developing inside a Container - Visual Studio Code
Developing inside a Container. The Visual Studio Code Dev Containers extension lets you use a Docker container as a full-featured development environment.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into this issue too (for the last few months actually).
I tried your patched vsix but I can only see the clusters now, not the resources.
I’m using UBUNTU 18.04 using kubectl installed from snap
uname -a Linux xxxx-MS-7798 5.4.0-53-generic #59~18.04.1-Ubuntu SMP Wed Oct 21 12:14:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
The only fix was to uninstall kubectl from snap and install it from Google
Hello everyone, I was able to replicate it and i think i have a fix (#771) . Would you please try it and see if it works for you?
You can install the extension by using the vsix file. I created it (download link: https://github.com/lstocchi/vscode-kubernetes-tools/raw/master/vscode-kubernetes-tools-1.2.1.vsix ) or you can build it by yourself (you can use this branch https://github.com/lstocchi/vscode-kubernetes-tools/tree/i770 ).
Once installed you should keep seeing the error as before
Kubectl command failed:
. Now if you go in the settings page and set “vs-kubernetes.enable-snap-flag” to true the extension should start working normally (CMD/CTRL + SHIFT + P -> search forOpen Setting
-> click onPreferences: Open Settings (JSON)
-> add"vs-kubernetes.enable-snap-flag": true
and save).If you can confirm it works it would be really helpful for us. Thank you!!!