This is a guide to set up the Azure infrastructure for the POC.

Requirements

  • AKS
    • System Pool - 1 node - Standard_DS2_v2 (2 vcpus, 7 GiB memory)
    • User Pool - 1 node - Standard_DS2_v2 (2 vcpus, 7 GiB memory)
  • Azure CLI
  • Helm 3.14+

Define environment variables

export RANDOM_ID="$(openssl rand -hex 3)"

export DIFY_RESOURCE_GROUP_NAME="LG-Dev"
export LOCATION="eastus2"

export DIFY_AKS_CLUSTER_NAME="difyakscluster$RANDOM_ID"
export DIFY_AKS_SYSTEM_VM_SIZE="Standard_DS2_v2"
export DIFY_AKS_USER_VM_SIZE="Standard_DS2_v2"

Create System Pool

az aks create \
    --name $DIFY_AKS_CLUSTER_NAME \
    --resource-group $DIFY_RESOURCE_GROUP_NAME \
    --node-count 1 \
    --node-vm-size $DIFY_AKS_SYSTEM_VM_SIZE \
    --os-sku Ubuntu \
    --nodepool-name systempool \
    --generate-ssh-keys

Create User Pool

az aks nodepool add \
    --resource-group $DIFY_RESOURCE_GROUP_NAME \
    --cluster-name $DIFY_AKS_CLUSTER_NAME \
    --name userpool \
    --node-count 1 \
    --node-vm-size $DIFY_AKS_USER_VM_SIZE \
    --os-sku Ubuntu \
    --mode User

Get the credentials for the AKS cluster

az aks get-credentials --resource-group $DIFY_RESOURCE_GROUP_NAME --name $DIFY_AKS_CLUSTER_NAME