az aks create --resource-group sqlarc --name aks --node-count 3 --node-vm-size Standard_D8_v3 --enable-addons monitoring --generate-ssh-keys
Get azure aks kubectl admin access
1 2 3
# we can get below info from azure portal when click connect to cluster az account set --subscription 5f9c889d-272a-4028-ba75-575f6a1dfe3f az aks get-credentials --resource-group sqlarc --name aks
kubectl.exe get ns NAME STATUS AGE default Active 19m kube-node-lease Active 19m kube-public Active 19m kube-system Active 19m
Register providers for Azure Arc enabled Kubernetes
1 2 3
az provider register --namespace Microsoft.Kubernetes az provider register --namespace Microsoft.KubernetesConfiguration az provider register --namespace Microsoft.ExtendedLocation
create arc enabled k8s
1 2 3 4 5 6 7 8 9 10 11 12
PS C:\Users\hubo> az connectedk8s connect --name arck8s --resource-group sqlarc (This operation might take a while...) PS C:\Users\hubo> az connectedk8s list --resource-group sqlarc -o table Name Location ResourceGroup -------------------------------- arc-aks eastasia sqlarc PS C:\Users\hubo> kubectl.exe get ns NAME STATUS AGE azure-arc Active 22m default Active 35m kube-node-lease Active 35m kube-public Active 35m kube-system Active 35m
Create service principal and configure roles for metrics
1 2 3 4 5 6 7
PS C:\Users\hubo> az provider register -n Microsoft.AzureArcData --wait PS C:\Users\hubo> az provider show -n Microsoft.AzureArcData -o table Namespace RegistrationPolicy RegistrationState ------------------------------------------------------------- Microsoft.AzureArcData RegistrationRequired Registered PS C:\Users\hubo> az ad sp create-for-rbac--name azure-arc-jasonoss--role Contributor --scopes /subscriptions/xxxxxxxxx-272a-4028-ba75-575f6a1dfe3f/resourceGroups/sqlarc PS C:\Users\hubo> az role assignment create --assignee xxxxxxxxx-2344-4695-b7e3-a103c3ff88cd--role'Monitoring Metrics Publisher'--scope /subscriptions/xxxxxxxxxx-272a-4028-ba75-575f6a1dfe3f/resourceGroups/sqlarc
Create an Arc enabled Kubernetes data services extension