Example: exoscale-shc
terraform/examples/exoscale-shc builds a cluster in one Exoscale zone.
Exoscale has no region layer and its DNS is a paid add-on, so the zone is
the only placement axis and Cloudflare serves DNS.
What differs
Section titled “What differs”modules/shc/exoscaletakes azone, atypeper group and aroot_volumesize. The example makes the worker group conditional onworker_node_count, withmerge()over two maps.- The hosts are derived in locals:
cloud.<cluster>.<zone>is the cluster host the daemon registers itself,whoami.<cluster>.<zone>the demo app. - The private key is also written to a file with
local_sensitive_file, as page 02 did, at.ssh/clusterinside the root.
module "shc" { source = var.module_source
cluster_name = var.cluster_name zone = var.zone ssh_public_key = tls_private_key.cluster.public_key_openssh node_groups = merge( { compose = { count = 1, type = var.node_type, runtime = "docker" } }, var.worker_node_count > 0 ? { workers = { count = var.worker_node_count, type = var.node_type, runtime = "docker" } } : {} ) root_volume = { size = var.root_volume_size }}Running it
Section titled “Running it”TF_VAR_exoscale_api_key, TF_VAR_exoscale_api_secret, TF_VAR_dns_token,
TF_VAR_dns_zone and TF_VAR_acme_email come from the environment.
tofu -chdir=learn/shc/terraform/examples/exoscale-shc inittofu -chdir=learn/shc/terraform/examples/exoscale-shc applytofu -chdir=learn/shc/terraform/examples/exoscale-shc destroyThis page was not walked: no Exoscale credential is on the learning workstation. Track F’s Exoscale page covers the same account through the CLI.
Next: Example: alibaba-shc.
shc@docs:~$