Skip to content

Lifecycle

Azure Kubernetes Service (AKS) is a fully managed Kubernetes service provided by Microsoft Azure. We have developed an integration with AKS to ensure that users can provision AKS Clusters in any region using the RCTL CLI.


Create Cluster

Imperative

Use this command to create an AKS cluster object in the configured project on the controller. You can optionally also specify the cluster blueprint during this step.

To create an AKS cluster, region and resource group name are mandatory.

./rctl create cluster aks demo-aks1 -g demo -l westus

To create an AKS cluster with cluster autoscaler enabled and a custom blueprint:

./rctl create cluster aks demo-aks -g demo --node-count 1 -l eastus --enable-cluster-autoscaler --min-count 1 --max-count 3 -b standard-blueprint

Note

In the current version, RCTL assumes that you have azure CLI v2.15 or later and kubectl installed. Azure CLI has to be configured with the correct subscription details where you want to provision AKS cluster.


Declarative

You can also create the cluster based on a version controlled cluster spec that you can store in a Git repository. This enables users to develop automation for reproducible infrastructure.

./rctl create cluster -f cluster-spec.yml

An illustrative example of the cluster spec YAML file for AKS is shown below

kind: Cluster
metadata:
  # display name of cluster
  name: demo-aks
  project: defaultproject
spec:
  type: aks
  # field below is optional, if not specified, default value is "default"
  # blueprint: rctl-test-blueprint
  # location, can be custom or predefined
  location: eastus

  # Azure resource Group. Name of resource group in Azure.
  resourcegroup: demo

  # ARM Template : A uri to a remote template file.
  #templateuri: https://github.com/Azure/azure-quickstart-templates/blob/master/101-aks/azuredeploy.json

  # ARM Template : A template file path in the file system.
  templatefile: /aks/deploy.json

  # Parameters for the ARM template
  parameters: /aks/parameters.json

Successfully provisioned AKS cluster


Adding a Spot node pool to existing cluster

You can also add a new node pool (Spot or Standard) to an existing AKS cluster.

./rctl update cluster aks addnodepool --cluster-name demo-aks -g demo --name spotnodepool1 --enable-cluster-autoscaler --priority Spot --eviction-policy Delete --spot-max-price -1 --min-count 1 --max-count 3

Delete Cluster

Delete cluster will clean up the resources in Azure as well.

./rctl delete cluster demo-aks -t aks -g demo