Skip to content

Azure AKS Deployment Guide

Prerequisites

Before deploying to Azure Kubernetes Service (AKS), ensure you have:

  • Azure CLI installed and configured
  • Kubernetes CLI (kubectl) installed
  • Helm 3.x installed

Cluster Setup

  1. Create a resource group:
bash
az group create --name prime-edm-rg --location eastus
  1. Create an AKS cluster:
bash
az aks create \
  --resource-group prime-edm-rg \
  --name prime-edm-cluster \
  --node-count 3 \
  --enable-addons monitoring \
  --generate-ssh-keys
  1. Get credentials:
bash
az aks get-credentials --resource-group prime-edm-rg --name prime-edm-cluster

Installing Prime EDM Charts

  1. Add the Helm repository:
bash
helm repo add prime-edm https://charts.acx-sandbox.net --username $USER --password $PASSWORD
helm repo update
  1. Create Azure-specific values:
yaml
# azure-values.yaml
global:
  provider: azure
  location: eastus

storage:
  class: managed-premium
  
serviceAccount:
  annotations:
    azure.workload.identity/client-id: CLIENT_ID

ingress:
  annotations:
    kubernetes.io/ingress.class: nginx
  1. Install the chart:
bash
helm install prime-edm prime-edm/prime-edm -f azure-values.yaml

Azure-Specific Configuration

Storage Classes

AKS provides several storage options:

yaml
storage:
  # Premium SSD
  class: managed-premium
  
  # Standard SSD
  # class: managed-standard
  
  # Standard HDD
  # class: managed-standard-hdd

Load Balancer

Using Azure Load Balancer:

yaml
service:
  type: LoadBalancer
  annotations:
    service.beta.kubernetes.io/azure-load-balancer-internal: "false"

Identity Management

Configure managed identities:

yaml
podIdentity:
  enabled: true
  userAssignedIdentityID: /subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/Microsoft.ManagedIdentity/userAssignedIdentities/IDENTITY_NAME

Secrets Management

Azure Key Vault Setup

  1. Create Key Vault:
bash
az keyvault create \
  --name prime-edm-kv \
  --resource-group prime-edm-rg \
  --location eastus
  1. Enable Managed Identity:
bash
az aks update \
  --name prime-edm-cluster \
  --resource-group prime-edm-rg \
  --enable-managed-identity
  1. Create role assignment:
bash
az role assignment create \
  --role "Key Vault Secrets User" \
  --assignee $(az aks show -g prime-edm-rg -n prime-edm-cluster --query identityProfile.kubeletidentity.clientId -o tsv) \
  --scope $(az keyvault show --name prime-edm-kv --resource-group prime-edm-rg --query id -o tsv)
  1. Install External Secrets Operator:
bash
helm repo add external-secrets https://charts.external-secrets.io
helm repo update

helm install external-secrets \
  external-secrets/external-secrets \
  --namespace external-secrets \
  --create-namespace \
  --set installCRDs=true
  1. Create SecretStore:
yaml
apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
  name: azure-backend
spec:
  provider:
    azurekv:
      tenantId: "$(az account show --query tenantId -o tsv)"
      vaultUrl: "https://prime-edm-kv.vault.azure.net"
      authType: ManagedIdentity
  1. Create ExternalSecret:
yaml
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: database-secret
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: azure-backend
    kind: SecretStore
  target:
    name: db-credentials
  data:
  - secretKey: username
    remoteRef:
      key: database-username
  - secretKey: password
    remoteRef:
      key: database-password

Monitoring

Azure Monitor Integration

Enable Azure Monitor:

yaml
monitoring:
  azureMonitor:
    enabled: true
    workspaceId: WORKSPACE_ID

Best Practices

  1. Use node selectors:
yaml
nodeSelector:
  agentpool: prime-edm-pool
  1. Configure resource limits:
yaml
resources:
  requests:
    cpu: 250m
    memory: 512Mi
  limits:
    cpu: 500m
    memory: 1Gi
  1. Enable auto-scaling:
yaml
autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 80

Troubleshooting

Common issues and solutions:

  1. Storage provisioning:

    • Verify storage class exists
    • Check PVC status
    • Validate permissions
  2. Network connectivity:

    • Review NSG rules
    • Check VNET configuration
    • Validate DNS settings
  3. Identity issues:

    • Verify managed identity setup
    • Check role assignments
    • Validate pod identity configuration

Released under the MIT License.