<p>I have this specific use case, in which we remotely create Kubernetes clusters on a significant number of machines. When we run <code>kubeadm init</code> at the end the join commands gets printed as:</p>
<p><code>kubeadm join [IPv6-Address]:6443 --token TOKEN_VALUE --discovery-token-ca-cert-hash CERT_HASH</code></p>
<p>In order to programmatically join worker nodes we have a script that needs both the <code>TOKEN_VALUE</code> and the <code>CERT_HASH</code>.</p>
<p>As now I'm acquiring the <code>TOKEN_VALUE</code> with the following command: <code>sudo kubeadm token list | awk 'NR == 2 {print $1}'</code>. However, I haven't found an easy way(or any way at all) to obtain the <code>CERT_HASH</code>.</p>
<p>Any help or pointer would be appreciated.</p>

nazar
<p>For those with the same problem, there doesn't seem to be a super clean or easy way to get it. But after looking at some places, the one that worked for me is <code>openssl x509 -in /etc/kubernetes/pki/ca.crt -noout -pubkey | openssl rsa -pubin -outform DER 2&gt;/dev/null | sha256sum | cut -d' ' -f1</code></p>
