This commit is contained in:
2025-08-11 08:55:13 +07:00
parent ec321d8e8a
commit 87ae088429
2 changed files with 10 additions and 15 deletions

View File

@@ -105,13 +105,6 @@ TALOS_CLUSTER_NAME=talos-nsk2
- IP Pool для LoadBalancer
- L2 Announcement Policy
**Интерактивные подтверждения:**
- Apply terraform changes? (y/n)
- Save kubeconfig? (y/n)
- Install Cilium? (y/n)
- Apply Cilium IP Pool and L2 Announcement Policy? (y/n)
### destroy.sh - Удаление кластера
Полная очистка инфраструктуры:

View File

@@ -5,21 +5,24 @@ source .env
export PROXMOX_VE_USERNAME=${PROXMOX_VE_USERNAME}
export PROXMOX_VE_PASSWORD=${PROXMOX_VE_PASSWORD}
confirm() {
local message="$1"
read -p "$message (y/n): " response
[[ "$response" == "y" ]]
}
tfplan=$(terraform plan -out=tfplan)
echo "$tfplan"
read -p "Apply? (y/n): " apply
if [ "$apply" == "y" ]; then
if confirm "Apply?"; then
terraform apply tfplan
fi
read -p "Save kubeconfig? (y/n): " save_kubeconfig
if [ "$save_kubeconfig" == "y" ]; then
if confirm "Save kubeconfig?"; then
terraform output -raw kubeconfig > ~/.kube/${TALOS_CLUSTER_NAME}.yaml
fi
read -p "Install Cilium? (y/n): " install_cilium
if [ "$install_cilium" == "y" ]; then
if confirm "Install Cilium?"; then
helm repo add cilium https://helm.cilium.io/
helm repo update
helm upgrade \
@@ -33,8 +36,7 @@ if [ "$install_cilium" == "y" ]; then
--set cluster.id=1
fi
read -p "Apply Cilium IP Pool and L2 Announcement Policy? (y/n): " apply_ip_pool
if [ "$apply_ip_pool" == "y" ]; then
if confirm "Apply Cilium IP Pool and L2 Announcement Policy?"; then
kubectl apply -f cilium/ippool.yaml
kubectl apply -f cilium/l2-announcement-policy.yaml
fi