<div dir="ltr">Hello Airship team, in the light of development of Airship v2.0 , we are now coming to the point where we need to interact with deployed kubernetes clusters, ephemeral or target. <div><br>So far I have found 2 major options for this communication:</div><div><ul><li>k8s/go-client library with dynamic client and RESTmapper</li><ul><li>we would have to build our own wrapper over it, that would implement some of the kubectl functionality as well as some of kustomize functionality</li><li>with this approach, we can develop any input driver of our own, like golang structs, runtime.Object, []bytes, filesystem etc... (i think it is quite a lot of effort)</li></ul><li>use k8s/kubectl as a library:</li><ul><li>encompasses both <b>kustomize</b>, via <i>FilenameOptions.Kustomize, </i>and default <b>kubectl </b>functionality.</li><li>Has limited input capabilities (I think), read from stdin, or directly from filesystem</li><li>With this approach we would not care, what resources we are dealing with.</li><li>And in the light of development of <b>airship document </b>command, we would have to keep those limitations in mind.</li><li><b>airshipctl document</b> subcommands would have to filter, for example based on annotations required resources, and simply provide <i style="font-weight:bold">root directory</i>, where kustomize starts working, the rest would be done for example by KubeApply.Run() function with correct FilenameOptions.Kustomize flag.<br></li><li>There is a con, kubectl is a cmd tool itself, and sometimes using it as a library maybe be complicated, (not sure about that though)</li></ul></ul><div><br></div>If someone has any ideas, relevant experience or advice, it would be greatly appreciated, thank you in advance.</div></div>