Lisan Haq:
Hello Guys,
Does anyone know the kubectl edit command works on the windows?
I am using Visual Studio Code to create the yaml files and set the windows environment to use the VSC, but it is still not working. I am getting the following error:
C:\Kubernetes>kubectl edit replicaset myapp-replicaset
error: unable to launch the editor “code --wait”
I set the windows env with the following command:
set EDITOR=code --wait
chris resnik:
EDITOR= should point to the executable you want to use as editor, I think
chris resnik:
e.g. EDITOR=“C:/Program Files/x86/vim/vim.exe”
chris resnik:
if code is your editor, you might just have to supply the full path
Lisan Haq:
I put the full path and it still doesn’t work:
Kubernetes>kubectl edit replicaset myapp-replicaset
‘"C:\Users\AppData\Local\Programs\Microsoft VS Code\Code.exe"’ is not recognized as an internal or external command,
operable program or batch file.
error: there was a problem with the editor “cmd /C "C:\Users\AppData\Local\Programs\Microsoft VS Code\Code.exe" --wait”
chris resnik:
they actually give this example:
> KUBE_EDITOR=code -w
Lisan Haq:
Thank you very much for your help! It still didn’t work. I got the following error:
C:\Users\Documents\Kubernetes>set KUBE_EDITOR=code -w
C:\Users\Documents\Kubernetes>kubectl edit replicaset myapp-replicaset
error: unable to launch the editor “code -w”
Instead of wasting time on this. I decided to use powershell and it allows me to edit it.
chris resnik:
sorry to hear about this but good to hear that it works in powershell