зеркало из https://github.com/microsoft/MSLab.git
Replace deprecated azure cli extension
1. Replace deprecated azure cli extension k8sconfiguration with k8s-configuration 2. Add selector when multiple subscriptions exist
This commit is contained in:
Родитель
b3fc3c9c26
Коммит
b798153ed4
|
@ -504,16 +504,23 @@ reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMa
|
|||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\msauth.net\aadcdn" /v https /t REG_DWORD /d 2
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\msauth.net\logincdn" /v https /t REG_DWORD /d 2
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\msftauth.net\aadcdn" /v https /t REG_DWORD /d 2
|
||||
|
||||
az login
|
||||
$allSubscriptions = (az account list | ConvertFrom-Json).ForEach({$_ | Select-Object -Property Name, id, tenantId })
|
||||
if (($allSubscriptions).Count -gt 1){
|
||||
$subscription = ($allSubscriptions | Out-GridView -OutputMode Single)
|
||||
az account set --subscription $subscription.id
|
||||
}
|
||||
|
||||
#create configuration
|
||||
$ClusterName="AzSHCI-Cluster"
|
||||
$KubernetesClusterName="demo"
|
||||
$resourcegroup="$ClusterName-rg"
|
||||
az k8sconfiguration create --name cluster-config --cluster-name $KubernetesClusterName --resource-group $resourcegroup --operator-instance-name cluster-config --operator-namespace cluster-config --repository-url https://github.com/Azure/arc-k8s-demo --scope cluster --cluster-type connectedClusters
|
||||
az k8s-configuration create --name cluster-config --cluster-name $KubernetesClusterName --resource-group $resourcegroup --operator-instance-name cluster-config --operator-namespace cluster-config --repository-url https://github.com/Azure/arc-k8s-demo --scope cluster --cluster-type connectedClusters
|
||||
#az connectedk8s delete --name cluster-config --resource-group $resourcegroup
|
||||
|
||||
#validate
|
||||
az k8sconfiguration show --name cluster-config --cluster-name $KubernetesClusterName --resource-group $resourcegroup --cluster-type connectedClusters
|
||||
az k8s-configuration show --name cluster-config --cluster-name $KubernetesClusterName --resource-group $resourcegroup --cluster-type connectedClusters
|
||||
[System.Environment]::SetEnvironmentVariable('PATH',$Env:PATH+';c:\program files\AksHci')
|
||||
kubectl get ns --show-labels
|
||||
kubectl -n cluster-config get deploy -o wide
|
||||
|
|
Загрузка…
Ссылка в новой задаче