Add installation steps for Velero CLI in cloud-init.yaml

This commit is contained in:
2025-08-30 17:12:29 +02:00
parent 17fc9fd63b
commit 10b4116130

View File

@@ -71,6 +71,12 @@ runcmd:
# Install kubectl # Install kubectl
- curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
- install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl - install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# Install Velero CLI
- VELERO_VERSION=$(curl -s https://api.github.com/repos/vmware-tanzu/velero/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
- curl -LO "https://github.com/vmware-tanzu/velero/releases/download/${VELERO_VERSION}/velero-${VELERO_VERSION}-linux-amd64.tar.gz"
- tar -xzf "velero-${VELERO_VERSION}-linux-amd64.tar.gz"
- install -o root -g root -m 0755 "velero-${VELERO_VERSION}-linux-amd64/velero" /usr/local/bin/velero
- rm -rf "velero-${VELERO_VERSION}-linux-amd64" "velero-${VELERO_VERSION}-linux-amd64.tar.gz"
# Install k0s # Install k0s
- curl -sSLf https://get.k0s.sh | sh - curl -sSLf https://get.k0s.sh | sh
- k0s install controller --single - k0s install controller --single
@@ -93,7 +99,7 @@ runcmd:
- | - |
su ${username} -c ' su ${username} -c '
cd /home/${username} cd /home/${username}
curl -fsSL https://raw.githubusercontent.com/LordMathis/dotfiles/main/install.sh > /tmp/install_dotfiles.sh curl -fsSL https://raw.githubusercontent.com/lordmathis/dotfiles/main/install.sh > /tmp/install_dotfiles.sh
chmod +x /tmp/install_dotfiles.sh chmod +x /tmp/install_dotfiles.sh
/tmp/install_dotfiles.sh server /tmp/install_dotfiles.sh server
' '