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.37k stars 552 forks source link

node can not be deleted #601

Open willzhang opened 3 years ago

willzhang commented 3 years ago

kubekey version

[root@k8s-master1 ~]# kk version
version.BuildInfo{Version:"1.2.0-alpha.2", GitCommit:"fb0ad3a", GitTreeState:"", GoVersion:"go1.14.15"}
[root@k8s-master1 ~]# 

what happend

node can not be delete

[root@k8s-master1 ~]# kk delete node k8s-node2 -f config-sample.yaml
FATA[10:34:36 CST] [k8s-node2] is in [worker] group, but not in hosts list 

config

cat > config-sample.yaml <<EOF
apiVersion: kubekey.kubesphere.io/v1alpha1
kind: Cluster
metadata:
  name: sample
spec:
  hosts:
  - {name: k8s-master1, address: 192.168.93.60, internalAddress: 192.168.93.60,user: root, password: 123456}
  - {name: k8s-master2, address: 192.168.93.61, internalAddress: 192.168.93.61,user: root, password: 123456}
  - {name: k8s-master3, address: 192.168.93.62, internalAddress: 192.168.93.62,user: root, password: 123456}
  - {name: k8s-node1, address: 192.168.93.63, internalAddress: 192.168.93.63,user: root, password: 123456}
  - {name: k8s-node2, address: 192.168.93.64, internalAddress: 192.168.93.64,user: root, password: 123456}
  - {name: k8s-node3, address: 192.168.93.65, internalAddress: 192.168.93.65,user: root, password: 123456}
  roleGroups:
    etcd:
    - k8s-master[1:3]
    master:
    - k8s-master[1:3]
    worker:
    - k8s-node[1:3]
  controlPlaneEndpoint:
    ##Internal loadbalancer for apiservers
    internalLoadbalancer: haproxy
    domain: lb.kubesphere.local
    address: ""      # The IP address of your load balancer.
    port: 6443
  kubernetes:
    version: v1.20.6
    imageRepo: kubesphere
    clusterName: cluster.local
  network:
    plugin: calico
    kubePodsCIDR: 10.233.64.0/18
    kubeServiceCIDR: 10.233.0.0/18
  registry:
    registryMirrors: [https://uyah70su.mirror.aliyuncs.com]
    insecureRegistries: []
  addons: []
EOF

`

pixiake commented 3 years ago

This issue seems to be a bug.
At present, you can use kubectl delete node xxx to delete nodes.

waynezhang1984 commented 2 years ago

how about this bug