<p>I'm expecting that <code>kubectl get nodes &lt;node&gt; -o yaml</code> to show the <code>spec.providerID</code> (see reference below) once the kubelet has been provided the additional flag <code>--provider-id=provider://nodeID</code>.  I've used <code>/etc/default/kubelet</code> file to add more flags to the command line when kubelet is start/restarted.  (On a k8s 1.16 cluster)  I see the additional flags via a <code>systemctl status kubelet --no-pager</code> call, so the file is respected.</p>

<p>However, I've not seen the value get returned by <code>kubectl get node &lt;node&gt; -o yaml</code> call.  I was thinking it had to be that the node was already registered, but I think kubectl re-registers when it starts up.  I've seen the log line via <code>journalctl -u kubelet</code> suggest that it has gone through registration.</p>

<p>How can I add a provider ID to a node manually?</p>

<p><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#nodespec-v1-core" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#nodespec-v1-core</a></p>

lucidquiet
<p>How a <code>kubelet</code> is configured on the node itself is separate (AFAIK) from its definition in the <code>master</code> control plane, which is responsible for updating state in the central <code>etcd</code> store; so it's possible for these to fall out of sync. i.e., you need to communicate to the control place to update its records.</p>

<p>In addition to Subramanian's suggestion, <code>kubectl patch node</code> would also work, and has the added benefit of being easily reproducible/scriptable compared to manually editing the YAML manifest; it also leaves a "paper trail" in your shell history should you need to refer back. Take your pick :) For example,</p>

<pre class="lang-sh prettyprint-override"><code>$ kubectl patch node my-node -p '{"spec":{"providerID":"foo"}}'
node/my-node patched
$ kubectl describe node my-node | grep ProviderID
ProviderID:                   foo
</code></pre>

<p>Hope this helps!</p>
