kubesphere / kubekey

Install Kubernetes/K3s only, both Kubernetes/K3s and KubeSphere, and related cloud-native add-ons, it supports all-in-one, multi-node, and HA 🔥 ⎈ 🐳
https://kubesphere.io
Apache License 2.0
2.4k stars 555 forks source link

skip `Join control-plane node` when node already worker #1546

Open way-zer opened 2 years ago

way-zer commented 2 years ago

What is version of KubeKey has the issue?

2.3.0-rc.3

What is your os environment?

Ubuntu 18

KubeKey config file

apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Cluster
metadata:
  name: new
spec:
  hosts: [] #hidden
  roleGroups:
    etcd:
    - nine
    - eleven
    - root100
    control-plane: 
    - nine
    - eleven
    - root100
    worker:
    - eight
    - nine
    - ten
    - eleven
    - root100
    - root101
  controlPlaneEndpoint:
    ## Internal loadbalancer for apiservers 
    internalLoadbalancer: kube-vip
#    domain: lb.kubesphere.local
    address: "10.106.128.146"
    port: 6443
  kubernetes:
    version: v1.23.8
    clusterName: cluster.local
    autoRenewCerts: true
    containerManager: docker
  etcd:
    type: kubekey
  network:
    plugin: fhannel
    kubePodsCIDR: 192.168.64.0/18
    kubeServiceCIDR: 192.168.0.0/18
    ## multus support. https://github.com/k8snetworkplumbingwg/multus-cni
    multusCNI:
      enabled: false
  registry:
    privateRegistry: ""
    namespaceOverride: ""
    registryMirrors: [
      "https://mirror.baidubce.com",
      "https://hub-mirror.c.163.com",
      "https://i6mwaa6f.mirror.aliyuncs.com"
    ]
    insecureRegistries: ["192.168.16.231"]
  addons: []

A clear and concise description of what happend.

I want to add worker as control-plane, but it skipped as it in cluster.

Relevant log output

13:13:21 UTC [JoinNodesModule] Join control-plane node
13:13:21 UTC skipped: [root100]
13:13:21 UTC skipped: [nine]
13:13:21 UTC skipped: [eleven]
13:13:21 UTC [JoinNodesModule] Join worker node
13:13:21 UTC skipped: [root101]
13:13:21 UTC skipped: [eleven]
13:13:21 UTC skipped: [ten]
13:13:21 UTC skipped: [eight]
13:13:21 UTC skipped: [nine]
13:13:21 UTC skipped: [root100]

Additional information

root@ten:~# kubectl get nodes
NAME      STATUS                        ROLES                         AGE     VERSION
eight     Ready                         worker                        7h22m   v1.23.8
eleven    Ready                         worker                        7h22m   v1.23.8
nine      Ready                         control-plane,master,worker   21d     v1.23.8
root100   Ready                         worker                        21d     v1.23.8
root101   Ready                         worker                        21d     v1.23.8
ten       NotReady,SchedulingDisabled   worker                        21d     v1.23.8
way-zer commented 2 years ago

Also, vip for control-plane not work with add nodes

24sama commented 2 years ago

Sorry to reply late. If you just want to change a work node to control-plane node. You can delete it and then re-add it to the cluster.