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
- Use certs with TTL instead of ssh keys(for security and compliance -- rotation)
- Ansible roles to setup helm, Prometheus/grafana, k3s dashboard...
- [ ]
- You need an azure account(auth through the cli
az login, or create a principal and save the tokens) - create a vault called
wasp-vaultin your az account - optional: 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 on master and worker nodes:
bash ./scripts/run_ansible_inv.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