#!/bin/bash

WALLAROO_RESOURCE_GROUP=example-resource-group
WALLAROO_GROUP_LOCATION=eastus
WALLAROO_CLUSTER=wallaroo # rename as required
WALLAROO_SKU_TYPE=Basic
WALLAROO_VM_SIZE=Standard_D8as_v5
PIPELINE_VM_SIZE=Standard_D8s_v5

az group create --name $WALLAROO_RESOURCE_GROUP --location $WALLAROO_GROUP_LOCATION

az aks create \
  --resource-group $WALLAROO_RESOURCE_GROUP \
  --name $WALLAROO_CLUSTER \
  --node-count 1 \
  --min-count 1 \
  --max-count 3 \
  --node-osdisk-size 100 \
  --enable-private-cluster \
  --enable-cluster-autoscaler \
  --generate-ssh-keys \
  --node-vm-size $WALLAROO_VM_SIZE \
  --nodepool-name general \
  --nodepool-labels wallaroo.ai/node-purpose=general \
  --kubernetes-version=1.30 \
  --location $WALLAROO_GROUP_LOCATION

az aks nodepool add \
  --resource-group $WALLAROO_RESOURCE_GROUP \
  --cluster-name $WALLAROO_CLUSTER \
  --mode User \
  --name persistent \
  --node-count 1 \
  --min-count 1 \
  --max-count 3 \
  --node-osdisk-size 100 \
  --enable-cluster-autoscaler \
  --node-vm-size $WALLAROO_VM_SIZE \
  --no-wait \
  --labels wallaroo.ai/node-purpose=persistent \
  --node-taints wallaroo.ai/persistent=true:NoSchedule \
  --zones 1

az aks nodepool add \
  --resource-group $WALLAROO_RESOURCE_GROUP \
  --cluster-name $WALLAROO_CLUSTER \
  --mode User \
  --name pipesx86 \
  --node-count 2 \
  --min-count 0 \
  --max-count 3 \
  --node-osdisk-size 100 \
  --enable-cluster-autoscaler \
  --node-vm-size $PIPELINE_VM_SIZE \
  --no-wait \
  --labels wallaroo.ai/node-purpose=pipelines \
  --node-taints wallaroo.ai/pipelines=true:NoSchedule

# ARM pipelines - optional, for model deployment- optional
# az aks nodepool add \
#   --resource-group $WALLAROO_RESOURCE_GROUP \
#   --cluster-name $WALLAROO_CLUSTER \
#   --mode User \
#   --name pipesarm \
#   --node-count 0 \
#   --min-count 0 \
#   --max-count 3 \
#   --node-osdisk-size 100 \
#   --enable-cluster-autoscaler \
#   --node-vm-size Standard_D8plds_v5 \
#   --no-wait \
#   --labels wallaroo.ai/node-purpose=pipelines \
#   --node-taints wallaroo.ai/pipelines=true:NoSchedule

# ARM general - optional, for model packaging and conversion to ARM
# az aks nodepool add \
#   --resource-group $WALLAROO_RESOURCE_GROUP \
#   --cluster-name $WALLAROO_CLUSTER \
#   --mode User \
#   --name generalarm \
#   --node-count 0 \
#   --min-count 0 \
#   --max-count 3 \
#   --node-osdisk-size 100 \
#   --enable-cluster-autoscaler \
#   --node-vm-size Standard_D8plds_v5 \
#   --no-wait \
#   --labels wallaroo.ai/node-purpose=general

# GPU nodepools - optional, for model deployment with GPUs
# az aks nodepool add \
#   --resource-group $WALLAROO_RESOURCE_GROUP \
#   --cluster-name $WALLAROO_CLUSTER \
#   --mode User \
#   --name pipesa100 \
#   --node-count 0 \
#   --min-count 0 \
#   --max-count 3 \
#   --node-osdisk-size 100 \
#   --enable-cluster-autoscaler \
#   --node-vm-size Standard_NC24ads_A100_v4 \
#   --no-wait \