<p>When we run <code>kubectl apply -k github.com/minio/direct-csi</code> command, how kubectl downloads and apply the deployment manifest?</p>
<p>How can we download this file to local using <code>curl</code> or <code>wget</code> command?</p>
<p>Thanks
SR</p>

<p>You can see all the http request that <code>kubectl</code> does by using a <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-output-verbosity-and-debugging" rel="nofollow noreferrer">verbose log level</a>.</p>
<p>E.g.</p>
<pre><code>kubectl get po --v=7
</code></pre>
<p>Output</p>
<pre><code>$ kubectl get po --v=7
I0822 20:08:27.940422   36846 loader.go:375] Config loaded from file:  /Users/Jonas/.kube/config
I0822 20:08:27.958708   36846 round_trippers.go:420] GET https://clusteraddress.com/api/v1/namespaces/default/pods?limit=500
I0822 20:08:27.958736   36846 round_trippers.go:427] Request Headers:
I0822 20:08:27.958742   36846 round_trippers.go:431]     Accept: application/json;as=Table;v=v1beta1;g=meta.k8s.io, application/json
I0822 20:08:27.958747   36846 round_trippers.go:431]     User-Agent: kubectl/v1.17.5 (darwin/amd64) kubernetes/e0fccaf
I0822 20:08:28.624188   36846 round_trippers.go:446] Response Status: 200 OK in 665 milliseconds
NAME                  READY   STATUS    RESTARTS   AGE
nx-67b4f5946c-2z58x   1/1     Running   0          21h

</code></pre>
<blockquote>
<p>How can we download this file to local using curl or wget command?</p>
</blockquote>
<p>You can do the same with e.g. <code>curl</code>, everyting in <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/" rel="nofollow noreferrer">Kubernetes is a REST API</a> and you need proper authentication from your <code>.kube/config</code> or some else valid authentication.</p>
<blockquote>
<p>what is download from github.com/minio/direct-cs ?</p>
</blockquote>
<p>Instead of applying with kustomize (<code>apply -k</code>) you can just build the kustomize without applying with this command:</p>
<pre><code>kubectl kustomize github.com/minio/direct-csi
</code></pre>
<p>And you should see all manifests (derived from <a href="https://github.com/minio/direct-csi/blob/master/kustomization.yaml" rel="nofollow noreferrer">kustomization.yaml</a>) in the remote location in a large manifest.</p>
