<p>when restarting kubernetes master node. I'm getting below error</p>
<pre><code>Sep 13 21:32:22 master-1 kube-apiserver[4073]: Error: &quot;kube-apiserver&quot; does not take any arguments, got [&quot;\\&quot;]
Sep 13 21:32:22 master-1 systemd[1]: kube-apiserver.service: Main process exited, code=exited, status=1/FAILURE
Sep 13 21:32:22 master-1 systemd[1]: kube-apiserver.service: Failed with result 'exit-code'.
</code></pre>
<p>This is my kube-apiserver.service configuration</p>
<pre><code>cat &lt;&lt;EOF | sudo tee /etc/systemd/system/kube-apiserver.service
[Unit]
Description=Kubernetes API Server
Documentation=https://github.com/kubernetes/kubernetes

[Service]
ExecStart=/usr/local/bin/kube-apiserver \\
  --advertise-address=${INTERNAL_IP} \\
  --allow-privileged=true \\
  --apiserver-count=3 \\
  --audit-log-maxage=30 \\
  --audit-log-maxbackup=3 \\
  --audit-log-maxsize=100 \\
  --audit-log-path=/var/log/audit.log \\
  --authorization-mode=Node,RBAC \\
  --bind-address=0.0.0.0 \\
  --client-ca-file=/var/lib/kubernetes/ca.crt \\
  --enable-admission-plugins=NodeRestriction,ServiceAccount,PodPreset \\
  --enable-swagger-ui=true \\
  --enable-bootstrap-token-auth=true \\
  --etcd-cafile=/var/lib/kubernetes/ca.crt \\
  --etcd-certfile=/var/lib/kubernetes/etcd-server.crt \\
  --etcd-keyfile=/var/lib/kubernetes/etcd-server.key \\
  --etcd-servers=https://192.168.111.246:2379,https://192.168.111.247:2379 \\
  --event-ttl=1h \\
  --encryption-provider-config=/var/lib/kubernetes/encryption-config.yaml \\
  --kubelet-certificate-authority=/var/lib/kubernetes/ca.crt \\
  --kubelet-client-certificate=/var/lib/kubernetes/kube-apiserver.crt \\
  --kubelet-client-key=/var/lib/kubernetes/kube-apiserver.key \\
  --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname \\
  --requestheader-client-ca-file=/var/lib/kubernetes/kube-proxy.crt \\
  --requestheader-allowed-names=front-proxy-client \\
  --requestheader-extra-headers-prefix=X-Remote-Extra- \\
  --requestheader-group-headers=X-Remote-Group \\
  --requestheader-username-headers=X-Remote-User \\ 
  --proxy-client-cert-file=/var/lib/kubernetes/kube-proxy.crt \\ 
  --proxy-client-key-file=/var/lib/kubernetes/kube-proxy.key \\
  --enable-aggregator-routing=true \\
  --kubelet-https=true \\
  --runtime-config=api/all=true \\
  --service-account-key-file=/var/lib/kubernetes/service-account.crt \\
  --service-cluster-ip-range=10.96.0.0/24 \\
  --service-node-port-range=30000-32767 \\
  --tls-cert-file=/var/lib/kubernetes/kube-apiserver.crt \\
  --tls-private-key-file=/var/lib/kubernetes/kube-apiserver.key \\
  --runtime-config=settings.k8s.io/v1alpha1=true \\
  --v=2
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF
</code></pre>
<p>Whats wrong with above configuration ?
VMware workstation used.
I'm using kubernetes 1.19.
Ubuntu 18.04
RAM 16GB
CNI : Weave</p>
<p>Funny thing happened.
I removed some parameters -&gt; Then restated kube-apiserver -&gt; Then pasted same above config file -&gt; Then restated kube-apiserver again -&gt; The kube-apiserver works niceley.
So what was the problem happened when I started my vm ?</p>

AMendis
<p>Actually I had extra space added on two places</p>
<p>--requestheader-username-headers=X-Remote-User \ &lt;-- extra space here
--proxy-client-cert-file=/var/lib/kubernetes/kube-proxy.crt \ &lt;-- extra space here</p>
<p>Thanks to the reply here <a href="https://github.com/kubernetes/kubernetes/issues/94758" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/94758</a>
found the issue</p>
