Azure Libraries
The Azure libraries provide functions for Azure Kubernetes Service (AKS) management, Azure Container Registry (ACR) operations, authentication, resource naming, and AKS self-healing. These modules are used when the platform is deployed on Azure infrastructure.
Source: scripts/lib/azure/
aks.sh -- AKS Cluster Management
Module: scripts/lib/azure/aks.sh
Configuration
| Variable | Default | Description |
|---|---|---|
AKS_CLUSTER_NAME | matihlabsaks | AKS cluster name |
AKS_RESOURCE_GROUP | matihplatformrg | Azure resource group |
Functions
| Function | Description |
|---|---|
aks_exists | Check if the AKS cluster exists |
aks_get_credentials | Download kubectl credentials for the cluster |
aks_get_nodepool_count | Get the number of nodes in a nodepool |
aks_scale_nodepool | Scale a nodepool to a target count |
Credential Retrieval
aks_get_credentials "matihlabsaks" "matihplatformrg" false true
# --admin=false --overwrite-existing=trueacr.sh -- Container Registry
Module: scripts/lib/azure/acr.sh
Functions
| Function | Description |
|---|---|
acr_login | Authenticate to Azure Container Registry |
acr_image_exists | Check if an image tag exists in ACR |
acr_get_latest_tag | Get the most recent tag for a repository |
acr_list_tags | List tags for a repository |
auth.sh -- Authentication
Module: scripts/lib/azure/auth.sh
Functions
| Function | Description |
|---|---|
azure_login | Login to Azure CLI (service principal or interactive) |
azure_set_subscription | Set the active Azure subscription |
azure_check_login | Verify Azure CLI is authenticated |
naming.sh -- Resource Naming
Module: scripts/lib/azure/naming.sh
Provides consistent naming conventions for Azure resources.
Naming Pattern
matih-{component}-{environment}-{region}-{suffix}aks-healing.sh -- Self-Healing
Module: scripts/lib/azure/aks-healing.sh
Implements pre-deployment health checks and automatic recovery for AKS clusters.
Functions
| Function | Description |
|---|---|
aks_healing_pre_deploy | Run health checks before deployment |
aks_healing_check_nodes | Verify all nodes are Ready |
aks_healing_check_system_pods | Verify kube-system pods are healthy |
aks_healing_restart_unhealthy | Restart unhealthy system components |
providers.sh -- Resource Provider Registration
Module: scripts/lib/azure/providers.sh
Ensures required Azure resource providers are registered in the subscription.
Related Pages
- Kubernetes Libraries -- K8s operations
- Core Libraries -- Configuration and logging
- Terraform Azure Modules -- Infrastructure provisioning