<p>i can to connect to API kube with kubectl and file config (library is @kubernetes/client-node).
i want to run my application in conteiner without kubectl. How i may connect to API kube with server account without file config?</p>

<p>if you are running your code inside the container you can directly use the default config using</p>
<pre><code>const kc = new k8s.KubeConfig();
kc.loadFromDefault();
</code></pre>
<p>with this method, there is no requirement to pass the config and inside container, it will auto adjust the config you can use the API directly.</p>
<p>for service account access your can check this document : <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/</a></p>
<p>how to generate the service account &amp; secret token that will call the API server : <a href="https://cloudhedge.io/setting-up-kubernetes-api-access-using-service-account/" rel="nofollow noreferrer">https://cloudhedge.io/setting-up-kubernetes-api-access-using-service-account/</a></p>
