Need to setup sublime for kubectl edit

7/10/2019

I am using mac. When I try kubectl edit it opens on default vi editor but I cant save it after making any change in Vi editor. I am not new to vi editor but for kubectl edit it just doest not let me save my changes.

I want to configure kubectl edit to open in sublime text. Please let me know how to make it work.

-- Tuhin Subhra Mandal
kubectl
kubernetes

2 Answers

7/10/2019

Sorry for the question. I found it. all i need to add KUBE_EDITOR=/usr/local/bin/sub in my bash_profile.

-- Tuhin Subhra Mandal
Source: StackOverflow

10/16/2019

Adding KUBE_EDITOR=/usr/local/bin/sublime in my bash_profile worked for me. However, the process forks and immediately cancels any changes made.

This was fixed by telling sublime to wait with -w flag. KUBE_EDITOR="/usr/local/bin/sublime -w"

-- Kurtis Streutker
Source: StackOverflow