You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.2 KiB

  1. Param(
  2. [parameter(Mandatory=$true)][string]$resourceGroupName,
  3. [parameter(Mandatory=$true)][string]$location,
  4. [parameter(Mandatory=$true)][string]$registryName,
  5. [parameter(Mandatory=$true)][string]$orchestratorName,
  6. [parameter(Mandatory=$true)][string]$dnsName,
  7. [parameter(Mandatory=$true)][string]$createAcr=$true
  8. )
  9. # Create resource group
  10. Write-Host "Creating resource group..." -ForegroundColor Yellow
  11. az group create --name=$resourceGroupName --location=$location
  12. if ($createAcr) {
  13. # Create Azure Container Registry
  14. Write-Host "Creating Azure Container Registry..." -ForegroundColor Yellow
  15. az acr create -n $registryName -g $resourceGroupName -l $location --admin-enabled true --sku Basic
  16. }
  17. # Create kubernetes orchestrator
  18. Write-Host "Creating kubernetes orchestrator..." -ForegroundColor Yellow
  19. az acs create --orchestrator-type=kubernetes --resource-group $resourceGroupName --name=$orchestratorName --dns-prefix=$dnsName --generate-ssh-keys
  20. # Retrieve kubernetes cluster configuration and save it under ~/.kube/config
  21. az acs kubernetes get-credentials --resource-group=$resourceGroupName --name=$orchestratorName
  22. # Show ACR credentials
  23. az acr credential show -n $registryName