Skip to content

Latest commit

 

History

History
109 lines (78 loc) · 4.29 KB

03-create-aks-cluster.md

File metadata and controls

109 lines (78 loc) · 4.29 KB

Azure Kubernetes Service (AKS) Deployment

Create AKS cluster

  1. Login to Azure Portal at http://portal.azure.com. Your Azure login ID will look something like [email protected]

  2. Open the Azure Cloud Shell

    Azure Cloud Shell

  3. The first time Cloud Shell is started will require you to create a storage account. In our lab, you must click Advanced and enter an account name and share.

  4. Once your cloud shell is started, clone the workshop repo into the cloud shell environment

    git clone https://github.com/Azure/blackbelt-aks-hackfest.git
    
  5. In the cloud shell, you are automatically logged into your Azure subscription. az login is not required.

  6. Verify your subscription is correctly selected as the default

    az account list
    
  7. Find your RG name

    az group list 
    
    [
    {
        "id": "/subscriptions/b23accae-e655-44e6-a08d-85fb5f1bb854/resourceGroups/ODL-aks-v2-gbb-8386",
        "location": "centralus",
        "managedBy": null,
        "name": "ODL-aks-v2-gbb-8386",
        "properties": {
        "provisioningState": "Succeeded"
        },
        "tags": {
        "AttendeeId": "8391",
        "LaunchId": "486",
        "LaunchType": "ODL",
        "TemplateId": "1153"
        }
    }
    ]
    
    # copy the name from the results above and set to a variable 
    
    NAME=
    
    # We need to use a different cluster name, as sometimes the name in the group list has an underscore, and only dashes are permitted
    
    CLUSTER_NAME="${NAME//_}"
    
    
  8. Create your AKS cluster in the resource group created above with 2 nodes, targeting Kubernetes version 1.11.2

    # This command can take 5-25 minutes to run as it is creating the AKS cluster. Please be PATIENT...
    
    # set the location to one of the provided AKS locations (eg - centralus, eastus)
    LOCATION=
    
    az aks create -n $CLUSTER_NAME -g $NAME -c 2 -k 1.11.2 --generate-ssh-keys -l $LOCATION
    
  9. Verify your cluster status. The ProvisioningState should be Succeeded

    az aks list -o table
    
    Name                 Location    ResourceGroup         KubernetesVersion    ProvisioningState    Fqdn
    -------------------  ----------  --------------------  -------------------  -------------------  -------------------------------------------------------------------
    ODLaks-v2-gbb-16502  centralus   ODL_aks-v2-gbb-16502  1.11.2                Succeeded             odlaks-v2--odlaks-v2-gbb-16-b23acc-17863579.hcp.centralus.azmk8s.io
    
  10. Get the Kubernetes config files for your new AKS cluster

    az aks get-credentials -n $CLUSTER_NAME -g $NAME
    
  11. Verify you have API access to your new AKS cluster

    Note: It can take 5 minutes for your nodes to appear and be in READY state. You can run watch kubectl get nodes to monitor status.

    kubectl get nodes
    
    NAME                       STATUS    ROLES     AGE       VERSION
    aks-nodepool1-20004257-0   Ready     agent     4m        v1.11.2
    aks-nodepool1-20004257-1   Ready     agent     4m        v1.11.2
    

    To see more details about your cluster:

    kubectl cluster-info
    
    Kubernetes master is running at https://odlaks-v2--odlaks-v2-gbb-11-b23acc-115da6a3.hcp.centralus.azmk8s.io:443
    Heapster is running at https://odlaks-v2--odlaks-v2-gbb-11-b23acc-115da6a3.hcp.centralus.azmk8s.io:443/api/v1/namespaces/kube-system/services/heapster/proxy
    KubeDNS is running at https://odlaks-v2--odlaks-v2-gbb-11-b23acc-115da6a3.hcp.centralus.azmk8s.io:443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
    kubernetes-dashboard is running at https://odlaks-v2--odlaks-v2-gbb-11-b23acc-115da6a3.hcp.centralus.azmk8s.io:443/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy
    
    To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
    

You should now have a Kubernetes cluster running with 2 nodes. You do not see the master servers for the cluster because these are managed by Microsoft. The Control Plane services which manage the Kubernetes cluster such as scheduling, API access, configuration data store and object controllers are all provided as services to the nodes.