如何在Kubernetes集群中强制进行领导者转换

时间:2018-04-20 19:25:46

标签: kubernetes kubeadm

我有一个2节点HA kubernetes HA群集,使用kubeadm进行设置。 我试图确定是否有办法在不重启当前主节点的情况下强制两个主节点之间的领导者转换?任何指针都会非常有用

这是我的kube-schedulers和控制器管理器的当前状态

[root@controller-0 ~]# kubectl describe endpoints kube-scheduler  -n kube-system
Name:         kube-scheduler
Namespace:    kube-system
Labels:       <none>
Annotations:  control-plane.alpha.kubernetes.io/leader={"holderIdentity":"controller-0_3b7e7b10-426f-11e8-8bd4-080027c7f746","leaseDurationSeconds":15,"acquireTime":"2018-04-17T18:43:39Z","renewTime":"2018-04-17T19...
Subsets:
Events:
  Type    Reason          Age   From               Message
  ----    ------          ----  ----               -------
  Normal  LeaderElection  23m   default-scheduler  controller-0_3b7e7b10-426f-11e8-8bd4-080027c7f746 became leader

[root@controller-0 ~]# kubectl get endpoints kube-controller-manager --namespace=kube-system  -o yaml
apiVersion: v1
kind: Endpoints
metadata:
  annotations:
    control-plane.alpha.kubernetes.io/leader: '{"holderIdentity":"controller-0_3e493110-426f-11e8-a597-080027c7f746","leaseDurationSeconds":15,"acquireTime":"2018-04-17T18:43:38Z","renewTime":"2018-04-17T19:03:18Z","leaderTransitions":0}'
  creationTimestamp: 2018-04-17T18:43:38Z
  name: kube-controller-manager
  namespace: kube-system
  resourceVersion: "2348"
  selfLink: /api/v1/namespaces/kube-system/endpoints/kube-controller-manager
  uid: 3e4b4b33-426f-11e8-ac0a-080027c7f746

0 个答案:

没有答案