-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix/1305 logging and monitoring config #1328
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@rwong2888 |
@Jberlinsky , @bharathkkb mind taking a look at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @rwong2888
# only one of logging/monitoring_service or logging/monitoring_config can be specified | ||
logging_service = local.logmon_config_is_set ? null : var.logging_service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have this in
terraform-google-kubernetes-engine/autogen/main/cluster.tf.tmpl
Lines 81 to 105 in 4bf0011
# only one of logging/monitoring_service or logging/monitoring_config can be specified | |
logging_service = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? null : var.logging_service | |
dynamic "logging_config" { | |
for_each = length(var.logging_enabled_components) > 0 ? [1] : [] | |
content { | |
enable_components = var.logging_enabled_components | |
} | |
} | |
monitoring_service = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? null : var.monitoring_service | |
dynamic "monitoring_config" { | |
for_each = length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus ? [1] : [] | |
content { | |
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : null | |
dynamic "managed_prometheus" { | |
for_each = var.monitoring_enable_managed_prometheus ? [1] : [] | |
content { | |
enabled = var.monitoring_enable_managed_prometheus | |
} | |
} | |
} | |
} |
We should just change the conditional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure about "cluster_telemetry_type_is_set", "managed_prometheus", and "monitoring_enable_managed_prometheus" as I was primarily looking for "logging_config", but I can revise the PR to include those as well if you think they are ready to promote out of beta @bharathkkb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bharathkkb, cluster_telemetry
and managed_prometheus
are still in beta as per below, so it does not look possible to simply modify the conditional. Please advise.
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwong2888 Can we try doing it inline and guard the dynamic block for managed_prometheus with a conditional. Similarly for the local.cluster_telemetry_type_is_set || local.logmon_config_is_set
conditional.
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |
fix 1305