kinvolk / lokomotive

🪦 DISCONTINUED Further Lokomotive development has been discontinued. Lokomotive is a 100% open-source, easy to use and secure Kubernetes distribution from the volks at Kinvolk
https://kinvolk.io/lokomotive-kubernetes/
Apache License 2.0
321 stars 49 forks source link

Packet: Improve handling of disabled BGP #1264

Open johananl opened 3 years ago

johananl commented 3 years ago

Right now, when trying to deploy a cluster on EM in a project which has BGP disabled, the following error is shown:

INFO[0003] Executing step "create infrastructure"        phase=infrastructure
module.worker-pool-1.data.packet_project.project: Refreshing state...
module.dns.data.aws_route53_zone.selected: Refreshing state...

Error: Attempt to index null value

  on ../terraform-modules/packet/flatcar-linux/kubernetes/workers/workers.tf line 54, in locals:
  54:   my_asn = format("metallb.lokomotive.io/my-asn=%d", data.packet_project.project.bgp_config.0.asn)
    |----------------
    | data.packet_project.project.bgp_config is null

This value is null, so it does not have any indices.

FATA[0011] Applying cluster failed: applying platform: failed checking execution status: exit status 1  args="[]" command="lokoctl cluster apply"

We should consider doing one of the following:

invidian commented 3 years ago

Enable BGP on behalf of the user in case it's disabled (needs to be discussed first).

Can this be done from Terraform level? I cannot see such option in the provider.

johananl commented 3 years ago

@invidian it's a project knob:

https://registry.terraform.io/providers/packethost/packet/latest/docs/resources/project