Patch kubeconfig folder and revoke IP
This commit is contained in:
parent
c583771f90
commit
559ea4de4d
@ -52,7 +52,7 @@
|
||||
loop: "{{ script_output.results }}"
|
||||
|
||||
- name: Add Kubeconfig to User
|
||||
shell: "rm -rf /home/ubuntu/.kube/config && mkdir -p /home/ubuntu/.kube/config && cp /etc/kubernetes/adminf.conf /home/ubuntu/.kube/config"
|
||||
shell: "rm -rf /home/ubuntu/.kube/config && mkdir -p /home/ubuntu/.kube/ && cp /etc/kubernetes/adminf.conf /home/ubuntu/.kube/config"
|
||||
|
||||
- name: Clean up temporary directory
|
||||
file:
|
||||
|
@ -94,14 +94,15 @@ check_and_install_curl() {
|
||||
check_existing_cluster() {
|
||||
if command_exists kubectl && kubectl cluster-info &>/dev/null; then
|
||||
echo "Found existing installation"
|
||||
echo "Proceed to clean em UP"
|
||||
if [[ $PRUNE != "true" ]]; then
|
||||
echo "Kubernetes cluster removal skipped. Exiting script."
|
||||
exit 0
|
||||
fi
|
||||
echo "Proceed to clean em UP"
|
||||
echo "Removing existing Kubernetes cluster..."
|
||||
kubeadm reset -f
|
||||
rm -rf /root/.kube/
|
||||
rm -rf /root/.kube/ || true
|
||||
|
||||
# What's the point of uninstalling them if later on we gonna install them again
|
||||
# sudo apt-get -y purge kubeadm kubectl kubelet kubernetes-cni kube* containerd
|
||||
# sudo apt-get -y autoremove
|
||||
|
Loading…
x
Reference in New Issue
Block a user