<p>I need to provide a specific node name to my master node in kuberenetes. I am using kubeadm to setup my cluster and I know there is an option <code>--node-name master</code> which you can provide to kubeadm init and it works fine.</p>

<p>Now, the issue is I am using the config file to initialise the cluster and I have tried various ways to provide that node-name to the cluster but it is not picking up the name. My config file of kubeadm init is:</p>

<pre><code>apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
api:
  advertiseAddress: 10.0.1.149
  controlPlaneEndpoint: 10.0.1.149
etcd:
  endpoints:
  - http://10.0.1.149:2379
  caFile: /etc/kubernetes/pki/etcd/ca.pem
  certFile: /etc/kubernetes/pki/etcd/client.pem
  keyFile: /etc/kubernetes/pki/etcd/client-key.pem
networking:
  podSubnet: 192.168.13.0/24
kubernetesVersion: 1.10.3
apiServerCertSANs:
- 10.0.1.149
apiServerExtraArgs:
  endpoint-reconciler-type: lease
nodeRegistration:
  name: master
</code></pre>

<p>Now I run <code>kubeadm init --config=config.yaml</code> and it timeouts with following error:</p>

<pre><code>[uploadconfig] Storing the configuration used in ConfigMap "kubeadm- 
config" in the "kube-system" Namespace
[markmaster] Will mark node ip-x-x-x-x.ec2.internal as master by 
adding a label and a taint
timed out waiting for the condition
</code></pre>

<p>PS: This issue also comes when you don't provide <code>--hostname-override</code> to kubelet along with <code>--node-name</code> to kubeadm init. I am providing both. Also, I am not facing any issues when I don't use <code>config.yaml</code> file and use command line to provide <code>--node-name</code> option to kubeadm init.</p>

<p>I want to know how can we provide <code>--node-name</code> option in config.yaml file. Any pointers are appreciated.</p>

<p>I am able to resolve this issue using the following config file, Just updating if anyone encounters the same issue:</p>

<pre><code>apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
api:
  advertiseAddress: 10.0.1.149
  controlPlaneEndpoint: 10.0.1.149
etcd:
  endpoints:
  - http://10.0.1.149:2379
  caFile: /etc/kubernetes/pki/etcd/ca.pem
  certFile: /etc/kubernetes/pki/etcd/client.pem
  keyFile: /etc/kubernetes/pki/etcd/client-key.pem
networking:
  podSubnet: 192.168.13.0/24
kubernetesVersion: 1.10.3
apiServerCertSANs:
- 10.0.1.149
apiServerExtraArgs:
  endpoint-reconciler-type: lease
nodeName: master
</code></pre>

<p>This is the way you can specify <code>--node-name</code> in config.yaml</p>
