<p>I use the following command to create cluster token :</p>
<pre><code>kubeadm token create --ttl=0
</code></pre>
<p>This will show the following output:</p>
<blockquote>
<p>W0504 18:31:48.031557   20703 configset.go:348] WARNING: kubeadm
cannot validate component configs for API groups
[kubelet.config.k8s.io kubeproxy.config.k8s.io]</p>
</blockquote>
<p>Now after using <code>kubeadm token list</code> commnad, I want to copy the token to a file.</p>
<p>How to do so ?</p>

McLan
<p>The output of the <code>token list</code> can be formatted with jsonpath:</p>
<pre><code>kubeadm token list -o=jsonpath='{.token}{&quot;\n&quot;}' &gt; tokens.txt
</code></pre>
<p>By using this format only the token is printed by the list command.</p>
