Skip to content
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

feat: add logging_config and monitoring_config to autopilot modules #2155

Merged

Conversation

pocesar
Copy link
Contributor

@pocesar pocesar commented Oct 25, 2024

Matches the other submodules inputs

@pocesar pocesar requested review from ericyz, gtsorbo and a team as code owners October 25, 2024 21:07
Copy link
Collaborator

@apeabody apeabody left a comment

Choose a reason for hiding this comment

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

@pocesar pocesar requested a review from apeabody October 25, 2024 22:04
@pocesar pocesar force-pushed the enabled-components-autopilot branch from 5f91fce to 7161cdf Compare October 25, 2024 22:38
@apeabody
Copy link
Collaborator

/gcbrun

@apeabody
Copy link
Collaborator

Hi @pocesar - Still something with the module generation from template:

Checking submodule's files generation
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/modules/beta-autopilot-private-cluster/cluster.tf /tmp/tmp.sFm4Tid78E/workspace/modules/beta-autopilot-private-cluster/cluster.tf
350,364d349
<   dynamic "logging_config" {
<     for_each = length(var.logging_enabled_components) > 0 ? [1] : []
< 
<     content {
<       enable_components = var.logging_enabled_components
<     }
<   }
< 
<   dynamic "monitoring_config" {
<     for_each = length(var.monitoring_enabled_components) > 0 ? [1] : []
<     content {
<       enable_components = var.monitoring_enabled_components
<     }
<   }
< 
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/modules/beta-autopilot-private-cluster/variables.tf /tmp/tmp.sFm4Tid78E/workspace/modules/beta-autopilot-private-cluster/variables.tf
327,337d326
< variable "monitoring_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
<   default     = []
< }
< 
< variable "logging_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
<   default     = []
< }
535a525,536
> }
> 
> variable "monitoring_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
>   default     = []
> }
> 
> variable "logging_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
>   default     = []
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/modules/beta-autopilot-public-cluster/cluster.tf /tmp/tmp.sFm4Tid78E/workspace/modules/beta-autopilot-public-cluster/cluster.tf
329,343d328
<   dynamic "logging_config" {
<     for_each = length(var.logging_enabled_components) > 0 ? [1] : []
< 
<     content {
<       enable_components = var.logging_enabled_components
<     }
<   }
< 
<   dynamic "monitoring_config" {
<     for_each = length(var.monitoring_enabled_components) > 0 ? [1] : []
<     content {
<       enable_components = var.monitoring_enabled_components
<     }
<   }
< 
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/modules/beta-autopilot-public-cluster/variables.tf /tmp/tmp.sFm4Tid78E/workspace/modules/beta-autopilot-public-cluster/variables.tf
291,301d290
< variable "monitoring_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
<   default     = []
< }
< 
< variable "logging_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
<   default     = []
< }
499a489,500
> }
> 
> variable "monitoring_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
>   default     = []
> }
> 
> variable "logging_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
>   default     = []
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/modules/beta-private-cluster/variables.tf /tmp/tmp.sFm4Tid78E/workspace/modules/beta-private-cluster/variables.tf
814a815,826
> variable "monitoring_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
>   default     = []
> }
> 
> variable "logging_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
>   default     = []
> }
> 
831,842d842
< }
< 
< variable "monitoring_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
<   default     = []
< }
< 
< variable "logging_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
<   default     = []
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/modules/beta-private-cluster-update-variant/variables.tf /tmp/tmp.sFm4Tid78E/workspace/modules/beta-private-cluster-update-variant/variables.tf
814a815,826
> variable "monitoring_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
>   default     = []
> }
> 
> variable "logging_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
>   default     = []
> }
> 
831,842d842
< }
< 
< variable "monitoring_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
<   default     = []
< }
< 
< variable "logging_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
<   default     = []
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/modules/beta-public-cluster/variables.tf /tmp/tmp.sFm4Tid78E/workspace/modules/beta-public-cluster/variables.tf
778a779,790
> variable "monitoring_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
>   default     = []
> }
> 
> variable "logging_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
>   default     = []
> }
> 
795,806d806
< }
< 
< variable "monitoring_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
<   default     = []
< }
< 
< variable "logging_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
<   default     = []
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/modules/beta-public-cluster-update-variant/variables.tf /tmp/tmp.sFm4Tid78E/workspace/modules/beta-public-cluster-update-variant/variables.tf
778a779,790
> variable "monitoring_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
>   default     = []
> }
> 
> variable "logging_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
>   default     = []
> }
> 
795,806d806
< }
< 
< variable "monitoring_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
<   default     = []
< }
< 
< variable "logging_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
<   default     = []
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/modules/private-cluster/variables.tf /tmp/tmp.sFm4Tid78E/workspace/modules/private-cluster/variables.tf
779a780,791
> variable "monitoring_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
>   default     = []
> }
> 
> variable "logging_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
>   default     = []
> }
> 
796,807d807
< }
< 
< variable "monitoring_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
<   default     = []
< }
< 
< variable "logging_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
<   default     = []
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/modules/private-cluster-update-variant/variables.tf /tmp/tmp.sFm4Tid78E/workspace/modules/private-cluster-update-variant/variables.tf
779a780,791
> variable "monitoring_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
>   default     = []
> }
> 
> variable "logging_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
>   default     = []
> }
> 
796,807d807
< }
< 
< variable "monitoring_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
<   default     = []
< }
< 
< variable "logging_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
<   default     = []
diff -r '--exclude=.terraform' '--exclude=.kitchen' '--exclude=.git' /workspace/variables.tf /tmp/tmp.sFm4Tid78E/workspace/variables.tf
743a744,755
> variable "monitoring_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
>   default     = []
> }
> 
> variable "logging_enabled_components" {
>   type        = list(string)
>   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
>   default     = []
> }
> 
760,771d771
< }
< 
< variable "monitoring_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
<   default     = []
< }
< 
< variable "logging_enabled_components" {
<   type        = list(string)
<   description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
<   default     = []
Error: submodule's files generation has not been run, please run the
'make build' command and commit changes

@pocesar pocesar force-pushed the enabled-components-autopilot branch from 09ab8ed to 7a80653 Compare October 30, 2024 21:43
@pocesar
Copy link
Contributor Author

pocesar commented Oct 30, 2024

@apeabody had to shuffle the blocks around to be able to not increase the if/else/endif nesting on non-autopilot settings, created this big changeset

@apeabody
Copy link
Collaborator

/gcbrun

@apeabody
Copy link
Collaborator

/gcbrun

@apeabody apeabody self-assigned this Oct 31, 2024
@apeabody
Copy link
Collaborator

/gcbrun

@apeabody
Copy link
Collaborator

/gcbrun

Copy link
Collaborator

@apeabody apeabody 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 the contribution @pocesar!

A few very minor nits before merge.

autogen/main/cluster.tf.tmpl Outdated Show resolved Hide resolved
autogen/main/cluster.tf.tmpl Outdated Show resolved Hide resolved
autogen/main/variables.tf.tmpl Show resolved Hide resolved
autogen/main/variables.tf.tmpl Show resolved Hide resolved
@pocesar pocesar requested a review from apeabody November 1, 2024 18:45
@apeabody
Copy link
Collaborator

apeabody commented Nov 1, 2024

/gcbrun

@apeabody
Copy link
Collaborator

apeabody commented Nov 1, 2024

/gcbrun

@apeabody apeabody merged commit 0ebdfda into terraform-google-modules:master Nov 1, 2024
4 checks passed
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.

2 participants