Skip to content

Create infrastructure Azure Kubernetes Service using Terraform and push terraform state file to Azure Storage.

Notifications You must be signed in to change notification settings

nhatthaiquang-agilityio/terraform-aks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create Infrastructure AKS using Terraform

+ Create infrastructure Azure Kubernetes Service using Terraform
+ Using GitHub Actions
    + Run Terraform
    + Push terraform state file to Azure Storage.

Requisite

+ Install azure cli

Using Terraform in Azure

  • Azure Login

    az login
    
  • Create group in Azure

    az ad sp create-for-rbac --name "myAKS" --role contributor --scopes /subscriptions/<SUBSCRIPTION_ID>
    

    Copy and paste appId and password into Secret GitHub with AZURE_AD_CLIENT_ID, AZURE_AD_CLIENT_SECRET and AZURE_AD_TENANT_ID respectively Note: Fix Role Assignment

  • Create storage accounts in Azure

    # Create Storage Account
    az storage account create -n storageakstest -g containers -l koreacentral --sku Standard_LRS
    
    # Create Storage Account Container
    az storage container create -n aks-container-test --account-name storageakstest --auth-mode login
    
  • Add secret values into Secret GitHub

    AZURE_AD_CLIENT_ID
    AZURE_AD_CLIENT_SECRET
    AZURE_SUBSCRIPTION_ID
    AZURE_AD_TENANT_ID
    

Result

AKS on Test

Terraform State File in Azure Storage of Test

AKS on Stage

Terraform State File in Azure Storage of Stage

References

About

Create infrastructure Azure Kubernetes Service using Terraform and push terraform state file to Azure Storage.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages