[Playground]Provision a k8s cluster with terraform & kubeadm and use Calico as CNI on Azure
The code can be found in github https://github.com/Shuanglu/k8s_infra_azure
There are some limitations like Calico CIDR is using the default one. I’m working on a golang program to provide more customization.
[Architecture]

[Provision Process]

[Terraform]
In the terraform template, you could assign value to below variables:
- resource_group_name: [string] The name of the infra resource group
- location: [string] The location of the resources
- user_assigned_identity: [string] The name of the user assigned identity
- vnet: [string] The name of the Vnet
- address_space: [list(string)] The address space of the VNet including master,agent,bastion
- admin_username: [string] The name of the admin user. Username requirement: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/faq#what-are-the-username-requirements-when-creating-a-vm
- admin_password: [string] The password of the admin user. Password requirement: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/faq#what-are-the-password-requirements-when-creating-a-vm
- storageAccount: [string] The name of the StorageAccount
- bastion_domain_name_label: [string] The name of the apiserver fqdn. Please follow the link https://docs.microsoft.com/en-us/rest/api/virtualnetwork/checkdnsnameavailability/checkdnsnameavailability to check the availability
- publickey_path: [string] The path of the public key
- bastion_vm_name: [string] The name of the bastion vm. Name requirement: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftcompute
- master_domain_name_label: [string] The name of the apiserver fqdn. Please follow the link https://docs.microsoft.com/en-us/rest/api/virtualnetwork/checkdnsnameavailability/checkdnsnameavailability to check the availability
- master_vmss_name: [string] The name of the master vmss. Name requirement: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftcompute
- agent_vmss_name: [string] The name of the agent vmss. Name requirement: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftcompute
[Reference]
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/high-availability/
https://kubernetes.io/docs/setup/best-practices/certificates/