Deploy KubeSphere on AKS

    Azure can help you implement infrastructure as code by providing resource deployment automation options. Commonly adopted tools include ARM templates and . In this guide, we will use Azure CLI to create all the resources that are needed for the installation of KubeSphere.

    You don’t have to install Azure CLI on your machine as Azure provides a web-based terminal. Click the Cloud Shell button on the menu bar at the upper-right corner in Azure portal.

    Select Bash Shell.

    Bash Shell

    An Azure resource group is a logical group in which Azure resources are deployed and managed. The following example creates a resource group named in the location westus.

    1. az aks create --resource-group KubeSphereRG --name KuberSphereCluster --node-count 3 --enable-addons monitoring --generate-ssh-keys

    Note

    You can use --node-vm-size or -s option to change the size of Kubernetes nodes. The default node size is Standard_DS2_v2 (2vCPU, 7GB memory). For more options, see az aks create.

    To configure kubectl to connect to the Kubernetes cluster, use the command az aks get-credentials. This command downloads the credentials and configures that the Kubernetes CLI will use.

    1. az aks get-credentials --resource-group KubeSphereRG --name KuberSphereCluster

    After you execute all the commands above, you can see there are 2 Resource Groups created in Azure Portal.

    Azure Kubernetes Services itself will be placed in KubeSphereRG.

    All the other Resources will be placed in MC_KubeSphereRG_KuberSphereCluster_westus, such as VMs, Load Balancer and Virtual Network.

    Azure Kubernetes Services

    To start deploying KubeSphere, use the following commands.

    You can inspect the logs of installation through the following command:

    1. kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

    To access KubeSphere console from a public IP address, you need to change the service type to LoadBalancer.

    Find the following section and change the type to LoadBalancer.

    1. spec:
    2. clusterIP: 10.0.78.113
    3. externalTrafficPolicy: Cluster
    4. ports:
    5. - name: nginx
    6. nodePort: 30880
    7. port: 80
    8. protocol: TCP
    9. app: ks-console
    10. tier: frontend
    11. version: v3.0.0
    12. sessionAffinity: None
    13. type: LoadBalancer # Change NodePort to LoadBalancer
    14. status:
    15. loadBalancer: {}
    1. $ kubectl get svc/ks-console -n kubesphere-system
    2. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
    3. ks-console LoadBalancer 10.0.181.93 13.86.xxx.xxx 80:30194/TCP 13m 6379/TCP 10m

    The example above demonstrates the process of a default minimal installation. For pluggable components, you can enable them either before or after the installation. See for details.