<p>My coredns in k8s cluster is v1.3.1.And I want to config it visiting kube-apiserver with static token.
For example,my token is "token4K8sSecure".Ant I tried config coredns kubenernetes plugin with the configuration below.But it does not work.</p>

<pre><code>apiVersion: v1
data:
  Corefile: |
    .:53 {
        errors
        health
        kubernetes cluster.local in-addr.arpa ip6.arpa {
           **endpoint https://100.6.0.20:6443
           kubeconfig token token4K8sSecure**
           pods insecure
           upstream
           fallthrough in-addr.arpa ip6.arpa
           ttl 30
        }
        prometheus :9153
        forward . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
    }
kind: ConfigMap
metadata:
  creationTimestamp: "2019-11-19T08:55:08Z"
  name: coredns
  namespace: kube-system
  resourceVersion: "452688"
  selfLink: /api/v1/namespaces/kube-system/configmaps/coredns
  uid: 449a38b9-1678-4c66-b1e8-96b5c273ad3d

</code></pre>

<p>Output:
[root@a2 Matrix-V500R002B01D001]# kubectl logs coredns-7c4665f97b-nh2wj -n kube-system
plugin/kubernetes: stat token: no such file or directory</p>

Miro
<p>welcome to StackOverflow.</p>

<p>You can - instead of using a Kubernetes Token - you can use Client Certificates like so:</p>

<pre><code>tls &lt;PATH_TO_CERT&gt; &lt;PATH_TO_KEY&gt; &lt;PATH_TO_CACERT&gt;
</code></pre>

<p>If you don't want to use TLS Certificates you can specify a File as the <code>kubeconfig</code>, with version <em>1.2.2</em> CoreDNS introduced the possibility that you can use a File from which CoreDNS loads the Context:</p>

<pre><code>kubeconfig /path/to/token token
</code></pre>

<p>Mount the token into the Container and add the Path to the Config and it should work.</p>
