先決條件
Azure 訂閱
Section titled “Azure 訂閱”需要一個具有以下資源建立權限的有效 Azure 訂閱:
- 資源群組
- 虛擬網路與子網路
- 網路安全性群組
- 公用 IP 位址
- 虛擬機器(Standard_D16s_v3 — 16 vCPU、64 GiB RAM,適用於 41 個容器的工作負載)
Azure CLI
Section titled “Azure CLI”安裝並驗證 Azure CLI:
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az login
az account show --query '{name:name, id:id}' -o tableTerraform
Section titled “Terraform”需要 Terraform >= 1.5:
terraform version若尚未安裝,請使用 HashiCorp APT 儲存庫:
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpgecho "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.listsudo apt update && sudo apt install terraformAzure AD 權限
Section titled “Azure AD 權限”您的 Azure AD 帳戶必須具有 User.Read 權限。部署者識別碼(用於資源命名)會自動從您的 Azure AD 設定檔衍生。若使用服務主體或受控識別驗證,請明確設定 deployer Terraform 變數。
SSH 金鑰對
Section titled “SSH 金鑰對”用於存取虛擬機器的 SSH 金鑰對:
ssh-keygen -t ed25519 -f ~/.ssh/origin-server-key -N ""所建立的 Azure 資源
Section titled “所建立的 Azure 資源”| 資源 | SKU |
|---|---|
| Ubuntu 24.04 虛擬機器 | Standard_D16s_v3(16 vCPU、64 GiB) |
| 公用 IP | 標準、靜態 |
| OS 磁碟 | 60 GiB 進階 SSD |
| VNet + NSG | 預設 |
請參閱 Azure 定價計算機 以了解目前費用。實驗室未使用時請執行 terraform destroy 以停止計費。請參閱拆除環境了解相關程序。