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.

24 lines
1.1 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. )
  8. # Create resource group
  9. Write-Host "Creating resource group..." -ForegroundColor Yellow
  10. az group create --name=$resourceGroupName --location=$location
  11. # Create Azure Container Registry
  12. Write-Host "Creating Azure Container Registry..." -ForegroundColor Yellow
  13. az acr create -n $registryName -g $resourceGroupName -l $location --admin-enabled true --sku Basic
  14. # Create kubernetes orchestrator
  15. Write-Host "Creating kubernetes orchestrator..." -ForegroundColor Yellow
  16. az acs create --orchestrator-type=kubernetes --resource-group $resourceGroupName --name=$orchestratorName --dns-prefix=$dnsName --generate-ssh-keys
  17. # Retrieve kubernetes cluster configuration and save it under ~/.kube/config
  18. az acs kubernetes get-credentials --resource-group=$resourceGroupName --name=$orchestratorName
  19. # Show ACR credentials
  20. az acr credential show -n $registryName