Assume you are a workshop instructor who needs to quickly set up the lab environments for the attendees. Without a doubt, you should have experience with IaaC tools in order to standardize your environment requirements in manifests.
As a consultant who has been presenting and performing PoCs with clients, I recognized a need for IaaC to provision the environments. This is the motivation of this repository.
I really hope that you will be able to find some helpful techniques and knowledge in this repository.
This repository includes an implementation of Terraform manifests that responsible to create;
- Common VNET
- devtest subnet
- preprod subnet
- prod subnet
- VPN subnets
- VPN for created VNET
- Lab environment for attendees as much as demanded (e.g.: contoso and four attendees)
rg-contoso-01-infra
Resource Groupacrworkshopbtcontoso01
Azure Container Registryvm-k3s-contoso-01-devtest
Virtual Machine- nic
- os disk
vm-k3s-contoso-01-preprod
Virtual Machine- nic
- os disk
vm-k3s-contoso-01-prod
Virtual Machine- nic
- os disk
rg-contoso-01-devtest
Resource Groupkv-contoso-01-devtest
Azure KeyVaultarc-k3s-contoso-01-devtest
TODO Arc-Enabled Kubernetes Cluster
rg-contoso-01-preprod
Resource Groupkv-contoso-01-preprod
Azure KeyVaultarc-k3s-contoso-01-preprod
TODO Arc-Enabled Kubernetes Cluster
rg-contoso-01-prod
Resource Groupkv-contoso-01-prod
Azure KeyVaultarc-k3s-contoso-01-prod
TODO Arc-Enabled Kubernetes Cluster
- To complete this task, please
cd
to root directory then run the following snippet:chmod +x ./01-create-cert.sh ./01-create-cert.sh
Once the execution is complete, three files should be created in .assets
directory.
- BT-WORKSHOP-ROOT.key
- BT-WORKSHOP-ROOT.cer
- BT-WORKSHOP-ROOT.b64
You will provision the following resources in this step:
- Common Resource Group
- Common VNet
- Subnets
- VPN Public IP
- VPN
- Common VNet
NOTE THAT This task may take longer than twenty minutes to complete due to the VPN provisioning time.
-
Please
cd
to root directory, then run the bash script with your unique name:chmod +x ./02-install-common.sh ./02-install-common.sh "contoso"
-
You will be prompted for
Execute 01-common
step which is responsible for common resource group, vnet and subnet creations.-
Type
Y
and press ENTER to continue. -
Once the
terraform plan
execution is completed, you will be informed about the resources to be created. Again, -
Visit the Azure Portal once you see the
terraform apply is succeeded
message for this step. Below resources should be created in your Azure subscription.
-
-
Once the execution is completed, you will be again prompted for a task. This is for
Execute 02-common-vpn
step which is responsible for creation of VPN. This step may take several times to complete but also it is crucial for accessing the VM and VNET hosted on Azure.
In this task, you will execute the 03-provision-lab.sh
bash script which required two arguments;
-
Unique name (e.g.: contoso)
-
Indice of attendee, it should be unique also for per attendee (e.g..: 8 for 8th people)
-
Please
cd
to root directory, then run the following script with two arguments that suitable for your environmentchmod +x ./03-provision-lab.sh ./02-install-common.sh "contoso" 8
-
Once the execution is completed, you will see the
terraform apply is succeeded for 8
output from script, after that, please visit the Azure Portal.
- Before installing and connection to VPN you created, you should install the self signed certificate you created in first step.
- Navigate to
.assets
directory
- Navigate to
TODO
TODO