eddycharly / terraform-provider-kops

Brings kOps into terraform in a fully managed way
Apache License 2.0
85 stars 20 forks source link

kops_cluster_updater should have more verbose logs #1097

Open shapirus opened 10 months ago

shapirus commented 10 months ago
module.cluster.kops_cluster_updater.updater: Still creating... [19m40s elapsed]
module.cluster.kops_cluster_updater.updater: Still creating... [19m50s elapsed]
module.cluster.kops_cluster_updater.updater: Still creating... [20m0s elapsed]
module.cluster.kops_cluster_updater.updater: Still creating... [20m10s elapsed]
module.cluster.kops_cluster_updater.updater: Still creating... [20m20s elapsed]
module.cluster.kops_cluster_updater.updater: Still creating... [20m30s elapsed]
module.cluster.kops_cluster_updater.updater: Still creating... [20m40s elapsed]
module.cluster.kops_cluster_updater.updater: Still creating... [20m50s elapsed]
module.cluster.kops_cluster_updater.updater: Still creating... [21m0s elapsed]

At this point, all pods are up and running, all containers are healthy, all nodes are healthy, but kops_cluster_updater is still not happy. Why? What is it waiting for? This is where the ability to make it show the actual kops logs would be very helpful.

sl1pm4t commented 9 months ago

I don't think Terraform allows provider plugins to print any useful info to the console, unless TF is run in debug mode:

TF_LOG=DEBUG terraform apply

Perhaps a compromise is for the kops provider to intercept the kops output and write it to a log file?!

shapirus commented 9 months ago

There's probably a way, but it may work only on errors, I'm not sure. For example, with the aws provider, when there's an error creating something in the cloud and AWS returns error 400 (e.g., resource already exists), there is an actual error message printed on the console. Not sure if it's possible to do that outside of the error context.