This guide provides guidelines regarding kubernetes cluster creation using Microsoft Azure with AKS (Azure Kubernetes Service) with AAD (Azure Active Directory) using bash script automation.
Azure Kubernetes Cluster can be created in two ways:
Following pre-requisite requirements must be fullfilled:
A domain on AWS (currently we use AWS domain to forward it to Azure AKS).
A Micorsoft Azure account with admin rights (needed to grant consent to server application)
If admin account is not available and you need to request admin consent for application permission, comment out the line 50 and uncomment the line 48 in
Configuration & Deployment
GitHub Repository to deploy AKS cluster can be found here. Clone it:
Project has the following directory structure:
. ├── terraform/ │ └── active_directory.tf │ └── main.tf │ └── outputs.tf │ └── service_principal.tf │ └── variables.tf ├── bash/ │ └── config │ └── deploy-aks.sh │ └── deploy.sh │ └── setup-domain.sh
- AKS with AAD cluster creation is automated using bash scripts. These bash scripts run according to the configuration provided in the
configfile. Set the following parameters in order to create the desired cluster.
|username||username of the admin account|
|password||password of the admin account|
|aksName||Name of the AKS cluster to be created|
|resourceGroup||Name of ResourceGroup in which AKS Cluster is to be created|
|location||Desired location of the cluster e.g. |
|location||Number of nodes in the cluster|
|externalDnsNamespace||Namespace in which externaldns service is running |
|dnsResourceGroup||ResourceGroup for externaldns service |
|dnsZoneName||DNS entry for Domain e.g. |
Azure Kuberbetes Service with Azure Active Directory requires following steps:
- Move to the
configfile to setup the variables
Make sure all three .sh files are executable
chmod 744 <file>
- Run by using the following command to start the deployment
- After a while terminal will display this message:
Note the Nameservers and add it to the hosted zone in AWS. Hit any key to continue deployment.
Use the above Nameservers and add their values in the hosted zones.
- Following line will be displayed on the terminal to request the admin to consent to the permissions if the account being used is
not an admin account. When the admin has consented to the permissions, Press any key to continue the deployment
Ask Administrator to consent on the Application Permissions
- When the deployment is done, it will ask the user to login using a web browser with a token. Use the token to login via web browser.
This guide provides guideline regarding kubernetes cluster creation using Terraform
- Terraform Install
- az-cli Install
- A Micorsoft Azure account with admin rights (needed to grant consent to server application)
If admin account is not available and you need to request admin consent for application permission, the command
terraform apply will fail. When it fails. Request the admin to consent for the Server Application, and run
terraform apply again to complete the deployment
All the configuration that is to be needed should be done in
variables.tf file. Edit the
variables.tf for the creation of desired cluster.
- Move to terraform folder
variables.tfas per requirement.
- Plan Terraform deployment. Remove errors if it shows any errors
- Apply the changes
- When deployment is complete, use the following command on the terminal to start the proxy server:
- Open any browser and pas the URL given below to check whether cluster is deployed successfully or not: