Skip to content

GCP logging/monitoring configurable #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

contil
Copy link

@contil contil commented May 25, 2023

what

  • GCP logging and monitoring for container now configurable in the module
  • cleanup examples and add the oslogin settings for the child module

why

  • GCP monitoring and logging are optional
  • oslogin can be useful if we need to login into the VM / container

Copy link
Contributor

@kpocius kpocius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but since it introduces a new metadata attribute, this becomes a breaking change as it will re-create the instance.

Maybe we can use this opportunity and flip oslogin to false by default, what do you think, @bschaatsbergen?

@contil
Copy link
Author

contil commented May 26, 2023

@kpocius I see oslogin being set to false already by default in the variable file .... where do you see it set to true?

@kpocius
Copy link
Contributor

kpocius commented May 28, 2023

@contil, sorry for the confusion. My memory tricked me -- I thought it was set to true in order not to become a breaking change. Turns out it wasn't.

@bschaatsbergen
Copy link
Member

@contil thanks for raising this PR, I'll go through it tomorrow 👍🏼

Copy link
Member

@bschaatsbergen bschaatsbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, it looks ok - though I'm curious what it exactly enables as I already see logs and metrics.. can you be a bit more specific on the metadata attributes please? :)

And regarding the examples that you've updated, I would prefer to have them not in there as it adds extra noise to the example code as they're simply optional variables anyways.

image = "<your-image>"
domain = "<example.com>"
managed_zone = "<your-managed-zone>"
enable_oslogin = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the locals from all the examples, as these are optional variables anyways and now add extra entries to the list in the example.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main reason I created this PR was to allow to make these settings configurable ... i.e. logging is being transitioned from old to new ( using now fluentbit etc ). The main idea was to make sure we have terraform clearly state the requirements and do not depend on defaults as well for different versions of COS etc.

managed_zone = "<your-managed-zone>"
enable_oslogin = false
google_logging_enabled = true
google_logging_use_fluentbit = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the locals from all the examples, as these are optional variables anyways and now add extra entries to the list in the example.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the locals to make sure the user understand the choices are deliberate and can be changed ONLY looking at the locals section without altering the bulk of the code past the locals.

managed_zone = "<your-managed-zone>"
enable_oslogin = false
google_logging_enabled = true
google_logging_use_fluentbit = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the locals from all the examples, as these are optional variables anyways and now add extra entries to the list in the example.


variable "google_logging_enabled" {
type = bool
description = "Enable Google Cloud Logging"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it exactly enable? As logging already works, if I look a Cloud Logging I can already see container logs being written there.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging is being changed and these settings should allow to make some choices that will enforce settings even when defaults will change and/or to disable some features


variable "google_monitoring_enabled" {
type = bool
description = "Enable Google Cloud Monitoring"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it exactly enable?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metadata settings and their mapping to COS milestones are described in https://cloud.google.com/container-optimized-os/docs/how-to/logging

@bschaatsbergen
Copy link
Member

Hi @contil, I was on holiday for a long period - I'm addressing some changes this week and will look into yours!

@bschaatsbergen
Copy link
Member

@contil your proposed change is introduced in #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants