<p>I have some workflows where I would like to automate kubectl with some custom golang code.</p>

<p>Like Istio and others are using kubectl underneath istiocli.</p>

<p>Do I need all the Kubernetes code and import some stuff or is it calling existig kubectl in a shell with os/exec?</p>

Chris G.
<p>If you are writing golang code, I would recommend you using <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">kubernetes client-go package</a> to automate the workflow. The only thing you need to be careful is that the client version keeps changing and if it's not consistent with your kubernetes cluster api-server version, you will need to change your client package version.</p>
