init
This commit is contained in:
@@ -105,13 +105,6 @@ TALOS_CLUSTER_NAME=talos-nsk2
|
|||||||
- IP Pool для LoadBalancer
|
- IP Pool для LoadBalancer
|
||||||
- L2 Announcement Policy
|
- 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 - Удаление кластера
|
### destroy.sh - Удаление кластера
|
||||||
|
|
||||||
Полная очистка инфраструктуры:
|
Полная очистка инфраструктуры:
|
||||||
|
18
start.sh
18
start.sh
@@ -5,21 +5,24 @@ source .env
|
|||||||
export PROXMOX_VE_USERNAME=${PROXMOX_VE_USERNAME}
|
export PROXMOX_VE_USERNAME=${PROXMOX_VE_USERNAME}
|
||||||
export PROXMOX_VE_PASSWORD=${PROXMOX_VE_PASSWORD}
|
export PROXMOX_VE_PASSWORD=${PROXMOX_VE_PASSWORD}
|
||||||
|
|
||||||
|
confirm() {
|
||||||
|
local message="$1"
|
||||||
|
read -p "$message (y/n): " response
|
||||||
|
[[ "$response" == "y" ]]
|
||||||
|
}
|
||||||
|
|
||||||
tfplan=$(terraform plan -out=tfplan)
|
tfplan=$(terraform plan -out=tfplan)
|
||||||
|
|
||||||
echo "$tfplan"
|
echo "$tfplan"
|
||||||
read -p "Apply? (y/n): " apply
|
if confirm "Apply?"; then
|
||||||
if [ "$apply" == "y" ]; then
|
|
||||||
terraform apply tfplan
|
terraform apply tfplan
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -p "Save kubeconfig? (y/n): " save_kubeconfig
|
if confirm "Save kubeconfig?"; then
|
||||||
if [ "$save_kubeconfig" == "y" ]; then
|
|
||||||
terraform output -raw kubeconfig > ~/.kube/${TALOS_CLUSTER_NAME}.yaml
|
terraform output -raw kubeconfig > ~/.kube/${TALOS_CLUSTER_NAME}.yaml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -p "Install Cilium? (y/n): " install_cilium
|
if confirm "Install Cilium?"; then
|
||||||
if [ "$install_cilium" == "y" ]; then
|
|
||||||
helm repo add cilium https://helm.cilium.io/
|
helm repo add cilium https://helm.cilium.io/
|
||||||
helm repo update
|
helm repo update
|
||||||
helm upgrade \
|
helm upgrade \
|
||||||
@@ -33,8 +36,7 @@ if [ "$install_cilium" == "y" ]; then
|
|||||||
--set cluster.id=1
|
--set cluster.id=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -p "Apply Cilium IP Pool and L2 Announcement Policy? (y/n): " apply_ip_pool
|
if confirm "Apply Cilium IP Pool and L2 Announcement Policy?"; then
|
||||||
if [ "$apply_ip_pool" == "y" ]; then
|
|
||||||
kubectl apply -f cilium/ippool.yaml
|
kubectl apply -f cilium/ippool.yaml
|
||||||
kubectl apply -f cilium/l2-announcement-policy.yaml
|
kubectl apply -f cilium/l2-announcement-policy.yaml
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user