Spin up flexible, scalable, and compliant K3s clusters in Azure Cloud(for now) from a single configuration file.
- Modular azure cluster creation
- remote terraform state support(Terraform Cloud)
- Managed ssh keys through azure key vault
- Ansible to fully setup and config kubernetes in the clusters
- Modular ansible with playbooks and roles
- Teleport with github SSO
- A working Azure subscription
- Azure key-vault
wasp-vault - Terraform cloud account for remote state managment
1. create terraform.tfvars in terraform/ with your desired configs:
clusters = {
france = {
cluster_name = "france-cluster-1"
region = "francecentral"
admin_username = "azureuser"
workers = [
{
name = "worker-group-1"
instance_size = "Standard_B1ms"
disk_size = 30
count = 13
tags = { role = "ms1" }
},
{
name = "worker-group-2"
instance_size = "Standard_B1ms"
disk_size = 50
count = 5
tags = { role = "dbs" }
}
]
}
spain = {
cluster_name = "spain-cent-test"
region = "spaincentral"
admin_username = "azureuser"
workers = [
{
name = "wkr-1"
instance_size = "Standard_B1ms"
disk_size = 30
count = 13
tags = { role = "dev" }
},
{
name = "wkr-2"
instance_size = "Standard_B1ms"
disk_size = 50
count = 5
tags = { role = "test" }
}
]
}
}2. Provision infrastructure with Terraform:
bash ./scripts/run_tf.sh3. Generate Ansible inventory from Terraform state:
bash ./scripts/generate_ansible_inv.sh4. Run Ansible playbooks to setup K3s and Teleport on master and worker nodes :
bash ./scripts/install_k3s.shto configure the master with Teleport:
bash ./scripts/setup_teleport.shflowchart LR
%% Subgraph: Configuration
subgraph Config[Configuration]
A[terraform.tfvars - cluster config]
end
%% Subgraph: Provisioning
subgraph Provisioning[Provisioning]
B[Terraform - provision VMs]
B1[Terraform Cloud - remote state]
end
%% Subgraph: Secrets
subgraph Secrets[Secrets Management]
KV[Azure Key Vault - secrets and SSH keys]
end
%% Subgraph: Inventory & Setup
subgraph Setup[Cluster Setup]
C[Generate Ansible Inventory - from TF state]
D[Ansible - setup K3s and roles/playbooks]
end
%% Subgraph: Running Cluster
subgraph Running[Running Cluster]
E[Running K3s Cluster - masters and workers]
end
%% Flow connections
A --> B
B --> B1
B --> KV
B1 --> C
KV --> D
C --> D
D --> E