diff --git a/scaleway/Makefile b/scaleway/Makefile index f2d0a6b..0e49bb4 100644 --- a/scaleway/Makefile +++ b/scaleway/Makefile @@ -1,12 +1,15 @@ ENDPOINT:=${shell terraform output -raw controlplane_endpoint 2>/dev/null} +ifeq ($(ENDPOINT),) +ENDPOINT := 127.0.0.1 +endif help: @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) create-lb: ## Create load balancer terraform init - terraform apply -auto-approve -target=scaleway_vpc_public_gateway_ip.main -target=output.controlplane_endpoint + terraform apply -auto-approve -target=output.controlplane_endpoint terraform refresh create-config: ## Genereate talos configs diff --git a/scaleway/outputs.tf b/scaleway/outputs.tf index 49a0a44..c6b86eb 100644 --- a/scaleway/outputs.tf +++ b/scaleway/outputs.tf @@ -1,25 +1,10 @@ output "controlplane_endpoint" { description = "Kubernetes controlplane endpoint" - value = try(local.lbv4, "127.0.0.1") + value = try(scaleway_lb_ip.lb[0].ip_address, "127.0.0.1") } output "controlplane_firstnode" { description = "Kubernetes controlplane first node" value = try(scaleway_instance_ip.controlplane[0].address, "none") } - -# output "controlplane_nodes" { -# description = "Kubernetes controlplane nodes" -# value = [ -# for s in hcloud_server.controlplane[*] : -# { -# name = s.name -# ipv4_address = s.ipv4_address -# ipv6_address = s.ipv6_address -# zone = "hetzner" -# location = s.location -# params = "" -# } -# ] -# } diff --git a/scaleway/templates/controlplane.yaml.tpl b/scaleway/templates/controlplane.yaml.tpl index 915d02e..93c22e0 100644 --- a/scaleway/templates/controlplane.yaml.tpl +++ b/scaleway/templates/controlplane.yaml.tpl @@ -103,8 +103,8 @@ cluster: SCW_ACCESS_KEY: ${base64encode(access)} SCW_SECRET_KEY: ${base64encode(secret)} SCW_DEFAULT_PROJECT_ID: ${base64encode(project_id)} - SCW_DEFAULT_ZONE: ${base64encode(zone)} SCW_DEFAULT_REGION: ${base64encode(region)} + SCW_DEFAULT_ZONE: ${base64encode(zone)} SCW_VPC_ID: ${base64encode(vpc_id)} externalCloudProvider: enabled: true