Panfactum / stack

The Panfactum Stack
https://panfactum.com
Other
14 stars 5 forks source link

[Bug]: error in kube_ingress when trying to enable ingress for kube_monitoring #173

Open mschnee opened 2 hours ago

mschnee commented 2 hours ago

Prior Search

What happened?

On edge.24-10-21, we have newly deployed kube_monitoring successfully with ingress disabled. When we enable ingress and attempt to init, plan, or apply, we receive the attached following error. Our production environment already had monitoring deployed from a previous release.

We are considering pinning kube_monitoring to an earlier edge version to attempt to deploy it (though the module is in alpha, having Grafana and Loki is still incredibly useful), but are holding off in order to provide more details if asked.

Steps to Reproduce

Deploy kube_monitoring with ingress disabled.

Attempt to init, plan, or apply kube_monitoring with ingress enabled.

Relevant log output

╷
│ Error: Invalid for_each argument
│
│   on ../kube_ingress/main.tf line 275, in resource "kubectl_manifest" "ingress":
│  275:   for_each = var.cdn_mode_enabled ? local.ingress_configs_with_cdn : local.ingress_configs
│     ├────────────────
│     │ local.ingress_configs will be known only after apply
│     │ local.ingress_configs_with_cdn will be known only after apply
│     │ var.cdn_mode_enabled is false
│
│ The "for_each" map includes keys derived from resource attributes that
│ cannot be determined until apply, and so OpenTofu cannot determine the full
│ set of keys that will identify the instances of this resource.
│
│ When working with unknown values in for_each, it's better to define the map
│ keys statically in your configuration and place apply-time results only in
│ the map values.
│
│ Alternatively, you could use the -target planning option to first apply
│ only the resources that the for_each value depends on, and then apply a
│ second time to fully converge.
mschnee commented 2 hours ago

I have not attempted to deploy a net new module that uses ingress yet, but will report back if I am able to.