Skip to content

Microsoft Azure - AKS

Running Astrobase and deploying an AKS Cluster

Note: In order for Astrobase to work properly, you should authenticate to all cloud providers you wish to use in the same runtime as the astrobase server. Astrobase does not store or manage any provider credentials. Astrobase Enterprise and Astrobase Cloud do support cross-cloud and cross-account authentication and authorization.

For this example we'll deploy a cluster to Azure Kubernetes Engine.

Connect to Azure

Configure your Azure Resource Group

$ az group create --name my-resource-group --location eastus

Create an Azure Active Directory Application and Register the Application to manage resources

Follow these links (assuming you have an admin owner configured as yourself already)

  1. Register an application with Azure AD and create a service principal
  2. Assign a role to the application
  3. Get your tenant and app ID values
  4. Authentication: Create and get your Application Secret
  5. Configure your access policies

Export Azure Credentials in the shell session where you initialize astrobase

export AZURE_SUBSCRIPTION_ID=<AZURE_SUBSCRIPTION_ID>
export AZURE_CLIENT_ID=<AZURE_CLIENT_ID>
export AZURE_CLIENT_SECRET=<AZURE_CLIENT_SECRET>
export AZURE_TENANT_ID=<AZURE_TENANT_ID>

Set your Astrobase profile and start your server

astrobase profile create local --no-secure

Set your profile and check that it was set properly.

export ASTROBASE_PROFILE=local
astrobase profile current
{
  "name": "local",
  "host": "localhost",
  "port": 8787,
  "secure": false
}

Start the astrobase server

Make sure to run this where you've authenticated to Azure

astrobase server

Create the file aks-cluster.yaml

---
cluster:
  name: astrobase-quickstart
  provider: azure
  location: eastus
  dns_prefix: ab-quickstart
  agent_pool_profiles:
    - name: default
      mode: System
      count: 1
      min_count: 1
      max_count: 3

Deploy the cluster!

astrobase cluster aks create \
--resource-group-name my-resource-group \
--file aks-cluster.yaml

Cleaning up!

astrobase cluster aks delete \
--resource-group-name my-resource-group \
--cluster-name astrobase-quickstart