<p>I am installing kubernetes controller manager just from it's binary file:</p>

<pre><code>cp -r /data/k8s/package/kubernetes/server/kubernetes/server/bin /usr/local/bin
</code></pre>

<p>When I start kubernetes controller manager service using this command:</p>

<pre><code>/usr/local/bin/kube-controller-manager --address=127.0.0.1 --service-cluster-ip-range=10.254.0.0/16 --cluster-name=kubernetes --cluster-signing-cert-file=/etc/kubernetes/ssl/ca.pem --cluster-signing-key-file=/etc/kubernetes/ssl/ca-key.pem  --service-account-private-key-file=/etc/kubernetes/ssl/ca-key.pem --root-ca-file=/etc/kubernetes/ssl/ca.pem --leader-elect=true --master=http://172.19.104.231:8080
</code></pre>

<p>show this log:</p>

<pre><code>    E0905 23:04:10.866049   21126 leaderelection.go:359] Failed to update lock: Operation cannot be fulfilled on endpoints "kube-controller-manager": StorageError: invalid object, Code: 4, Key: /registry/services/endpoints/kube-system/kube-controller-manager, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: 0c84a2ba-80f5-11e9-b3ce-00163e086f0c, UID in object meta: eec95e0e-65a1-4941-be87-d70f5f2429d7
E0905 23:04:12.197416   21510 leaderelection.go:359] Failed to update lock: Operation cannot be fulfilled on endpoints "kube-scheduler": StorageError: invalid object, Code: 4, Key: /registry/services/endpoints/kube-system/kube-scheduler, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: 121bc661-80f5-11e9-b3ce-00163e086f0c, UID in object meta: 49e84916-589a-4da5-b78a-761a1fe78285
</code></pre>

<p>what should I do to fix this error? This is kubectl version:</p>

<pre><code>[root@iZuf63refzweg1d9dh94t8Z ~]# kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.2", GitCommit:"f6278300bebbb750328ac16ee6dd3aa7d3549568", GitTreeState:"clean", BuildDate:"2019-08-05T09:23:26Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.2", GitCommit:"f6278300bebbb750328ac16ee6dd3aa7d3549568", GitTreeState:"clean", BuildDate:"2019-08-05T09:15:22Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
</code></pre>

Dolphin
<p>First of all thanks for providing additional info I requested. However it is still not clear how and what you configured else.</p>

<p>But I can see you decided to go through "the hard way".
It is not possible to reproduce all the thing you configured but..</p>

<p>Some time ago I successfully passed cluster creation procedure following by widely known <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way" rel="nofollow noreferrer">kelseyhightower/kubernetes-the-hard-way</a> .</p>

<p>You can find there step-by-step instruction for configuring each part in k8s cluster.</p>

<p>Take a look on <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/08-bootstrapping-kubernetes-controllers.md#configure-the-kubernetes-controller-manager" rel="nofollow noreferrer">Configure the Kubernetes Controller Manager</a> part under <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/08-bootstrapping-kubernetes-controllers.md" rel="nofollow noreferrer">Bootstrapping the Kubernetes Control Plane</a> document.</p>

<p><strong>Configure the Kubernetes Controller Manager</strong>:</p>

<p>Move the <code>kube-controller-manager</code> kubeconfig into place:</p>

<pre><code>sudo mv kube-controller-manager.kubeconfig /var/lib/kubernetes/
</code></pre>

<p>Create the <code>kube-controller-manager.service</code> systemd unit file:</p>

<pre><code>cat &lt;&lt;EOF | sudo tee /etc/systemd/system/kube-controller-manager.service
[Unit]
Description=Kubernetes Controller Manager
Documentation=https://github.com/kubernetes/kubernetes

[Service]
ExecStart=/usr/local/bin/kube-controller-manager \\
  --address=0.0.0.0 \\
  --cluster-cidr=10.200.0.0/16 \\
  --cluster-name=kubernetes \\
  --cluster-signing-cert-file=/var/lib/kubernetes/ca.pem \\
  --cluster-signing-key-file=/var/lib/kubernetes/ca-key.pem \\
  --kubeconfig=/var/lib/kubernetes/kube-controller-manager.kubeconfig \\
  --leader-elect=true \\
  --root-ca-file=/var/lib/kubernetes/ca.pem \\
  --service-account-private-key-file=/var/lib/kubernetes/service-account-key.pem \\
  --service-cluster-ip-range=10.32.0.0/24 \\
  --use-service-account-credentials=true \\
  --v=2
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF
</code></pre>

<p>But again, this part wont work without other important pieces of this puzzle.
Hope it will help you to achieve the expected result </p>
