Create Azure AKS cluster

This section will help you create a Saagie-compatible Kubernetes cluster using the Microsoft Azure Kubernetes Service (AKS).

1. Prerequisites

You need to setup your computer before creating a new cluster.

  1. You need an Azure Kubernetes Services (AKS) account.

  2. Install and configure the Azure CLI.

  3. Increase your per VM Series vCPU quota to 12.

2. Create or configure cluster

  • Create new cluster

  • Configure existing cluster

  1. Create a new resource group

    1. Create a new resource group in the same region where you want to create the cluster.

    2. Run the az command line:

      az group create --location <location> --name <resource group name> (1)
      1 Replace <location> and <resource group name> with your location and resource group name.
    3. If you’d prefer to use the Azure portal, do the following:

      • Select Create a resource.

      • Search for Resource group.

      • Create your new group.

  2. Create your cluster

    1. Create the cluster with the following command:

          az aks create \
          --dns-name-prefix saagie \
          --network-plugin azure \
          --network-policy calico \
          --kubernetes-version <version> \ (1)
          --node-vm-size Standard_DS3_v2 \
          --location <location> \ (2)
          --name <cluster name> \ (3)
          --resource-group <resource group name> \ (4)
          --service-cidr 10.233.0.0/18 \
          --dns-service-ip 10.233.0.10
      1 Replace <version> with a Kubernetes version that is compatible with Saagie. Current compatible versions are 1.14.x and 1.15.x.
      2 Replace <location>,
      3 <cluster name>, and
      4 <resource group name> with your values.
  3. Once the cluster is created, it will take about ten minutes before the cluster is ready for use.

You can follow along with the Azure AKS Quickstart as a reference to create your Azure AKS cluster using the Azure CLI. The Quickstart guide assumes a basic understanding of Kubernetes, so read through Kubernetes core concepts for AKS if needed.
  1. Run the following command:

    az aks get-credentials --resource-group <resource group name> --name <cluster name> (1)
    1 Replace <resource group name> and <cluster name> with your values.

Refer to the Kubernetes documentation if needed.

3. Verify your Kubernetes cluster

  1. Run the following command to verify that you have access to your Kubernetes cluster:

    kubectl get nodes
  2. The output should be similar to this:

    NAME                                           STATUS   ROLES    AGE    VERSION
    ip-192-168-15-134.eu-west-1.compute.internal   Ready    <none>   9m8s   v1.13.8-eks-cd3eb0
    ip-192-168-35-150.eu-west-1.compute.internal   Ready    <none>   9m3s   v1.13.8-eks-cd3eb0
    ip-192-168-88-76.eu-west-1.compute.internal    Ready    <none>   9m7s   v1.13.8-eks-cd3eb0
All nodes must have the status ready.

4. Create storage classes

The storage.yml file contains the configuration for your storageClass resources:

  • common-storageclass: Used to store Saagie data, such as databases.

  • <prefix>-storageclass: Used to store job data, such as uploaded artifacts.

  • <prefix>-app-storageclass: Optional storageClass if you want to store app data and job data on different provisioner.

    <prefix> is the same value you determined for your DNS entry.

4.1. Create a storage.yml file

Here is a sample storage.yml for Azure AKS that can be customized according to your needs:

---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: common-storageclass
parameters:
  cachingmode: ReadOnly
  kind: Managed
  storageaccounttype: Standard_LRS
provisioner: kubernetes.io/azure-disk
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: <prefix>-storageclass (1)
parameters:
  cachingmode: ReadOnly
  kind: Managed
  storageaccounttype: Standard_LRS
provisioner: kubernetes.io/azure-disk

To store app data and job data on different provisioners, include the following in the same storage.yml file:

---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: <prefix>-app-storageclass (1)
parameters: (2)

provisioner: (3)
1 Replace <prefix> with the same value determined for your DNS entry.
2 Add the parameters for app data.
3 Indicate your second provisioner used to store app data.

4.2. Apply storage.yml

  1. Run the following command to apply your storage.yml file:

    kubectl apply -f storage.yml
  2. Run the following command to confirm that the storage classes are available:

    kubectl get sc
Next step

After creating or configuring your cluster, continue to Prepare your Kubernetes cluster.