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

Re-evaluate default output verbosity #564

Open johananl opened 4 years ago

johananl commented 4 years ago

General

Right now when a user runs lokoctl cluster apply, by default no Terraform output is shown. I think this isn't ideal for the following reasons:

Implementation

To address these problems, I propose we consider doing one or more of the following:

invidian commented 4 years ago
  • Show Terraform output by default (and possibly allow disabling it using a flag if we think that's useful).

That would be opposite to #225.

  • Buffer Terraform output in memory and print some or all of it in case of an error.

We already do that. I think we print last 20 lines in case of an error.

Print user-friendly info about the deployment's various "stages". Examples: "Preparing for deployment", "Creating nodes", "Creating DNS records", "Bootstrapping the control plane", "Deploying Lokomotive components".

I like the idea, that would require using more of -target method, it would also allow more fine-grained interruptions, if needed.

johananl commented 4 years ago
  • Show Terraform output by default (and possibly allow disabling it using a flag if we think that's useful).

That would be opposite to #225.

In what way? And in any case, do we want to have the output disabled by default? For what reason? This is not debug-level info AFAICT.

  • Buffer Terraform output in memory and print some or all of it in case of an error.

We already do that. I think we print last 20 lines in case of an error.

OK, then I guess what we show isn't enough since there are cases where running without -v leaves the user clueless as to the nature of the error.

Print user-friendly info about the deployment's various "stages". Examples: "Preparing for deployment", "Creating nodes", "Creating DNS records", "Bootstrapping the control plane", "Deploying Lokomotive components".

I like the idea, that would require using more of -target method, it would also allow more fine-grained interruptions, if needed.

Not necessarily. That would depend on what level of granularity we want. The "stages" above are examples. We can already print some useful info without touching the Terraform execution process.

rata commented 4 years ago

Wouldn't just a "show stderr" in case of errors do the trick in the short-term?

stdout is verbose, stderr is just the errors. I tried quickly and terraform seems to respect this.

johananl commented 4 years ago

What do you mean by "show stderr"? What change are you proposing?

rata commented 4 years ago

@johananl I propose to do the equivalent of what happens when you run in a regular terimnal: terraform plan > /dev/null. IOW, discard stdout and print stderr.

And replace plan with the terraform command you want to run, of course :)

johananl commented 4 years ago

I don't see why we would want to hide any Terraform output. One thing it's useful for is that it shows some form of progress to the user. Without the Terraform stdout, the user can sit at the terminal for 15 minutes without knowing what's going on. If we had very informative output of our own (namely printed by lokoctl), maybe we could hide the Terraform output under the hood, however right now there are many cases where the only way for you to know what broke or where you are in the deployment process is by examining the Terraform output. To prove my point, when was the last time you ran lokoctl cluster apply without -v? :slightly_smiling_face: Can you honestly say you use -v just because you're a Lokomotive developer? In my opinion the answer is "no".