feat: add deleteDNS parameter in delete_cluster (#2537)

Signed-off-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
liujian 2025-04-17 18:12:32 +08:00 committed by GitHub
parent 25f3de2cde
commit 2dead130da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 3 deletions

View File

@ -15,7 +15,7 @@
kubeadm reset -f
fi
- name: Delete kubelet
- name: Stop kubelet service
command: |
rm -rf /etc/systemd/system/kubelet.service
rm -rf /etc/systemd/system/kubelet.service.d

View File

@ -13,6 +13,13 @@
- uninstall/kubernetes
- role: uninstall/cri
when: .deleteCRI
post_tasks:
- name: delete etc/hosts
ignore_errors: true
command: |
sed -i ':a;$!{N;ba};s@# kubekey hosts BEGIN.*# kubekey hosts END@@' /etc/hosts
sed -i ':a;$!{N;ba};s@# kubekey custom BEGIN.*# kubekey custom END@@' /etc/hosts
when: .deleteDNS
- hosts:
- etcd

View File

@ -3,4 +3,6 @@ kubernetes:
# if deleteCRI
deleteCRI: false
# if deleteETCD
deleteETCD: false
deleteETCD: false
# if true. will delete local dns in /etc/hosts which create by kubekey
deleteDNS: false

View File

@ -4,7 +4,7 @@
command: |
kubeadm reset -f
- name: Delete kubelet
- name: Stop kubelet service
command: |
rm -rf /etc/systemd/system/kubelet.service
rm -rf /etc/systemd/system/kubelet.service.d