Linux sysctls configuration and Kubelet config (#388)
* Linux sysctls configuration and Kubelet config * Fix terraform linting issues * Updated README.md * Updated Kubelet config object type * Update readme Co-authored-by: Sergio Tejón <stejon@freepik.com> Co-authored-by: Julio Castillo <jccb@google.com>
This commit is contained in:
parent
0fe5b6b03f
commit
6a42929df3
|
@ -45,6 +45,8 @@ module "cluster-1-nodepool-1" {
|
|||
| *autoscaling_config* | Optional autoscaling configuration. | <code title="object({ min_node_count = number max_node_count = number })">object({...})</code> | | <code title="">null</code> |
|
||||
| *gke_version* | Kubernetes nodes version. Ignored if auto_upgrade is set in management_config. | <code title="">string</code> | | <code title="">null</code> |
|
||||
| *initial_node_count* | Initial number of nodes for the pool. | <code title="">number</code> | | <code title="">1</code> |
|
||||
| *kubelet_config* | Kubelet configuration. | <code title="object({ cpu_cfs_quota = string cpu_cfs_quota_period = string cpu_manager_policy = string })">object({...})</code> | | <code title="">null</code> |
|
||||
| *linux_node_config_sysctls* | Linux node configuration. | <code title="map(string)">map(string)</code> | | <code title="">null</code> |
|
||||
| *management_config* | Optional node management configuration. | <code title="object({ auto_repair = bool auto_upgrade = bool })">object({...})</code> | | <code title="">null</code> |
|
||||
| *max_pods_per_node* | Maximum number of pods per node. | <code title="">number</code> | | <code title="">null</code> |
|
||||
| *name* | Optional nodepool name. | <code title="">string</code> | | <code title="">null</code> |
|
||||
|
|
|
@ -144,6 +144,23 @@ resource "google_container_node_pool" "nodepool" {
|
|||
mode = var.workload_metadata_config
|
||||
}
|
||||
|
||||
dynamic "kubelet_config" {
|
||||
for_each = var.kubelet_config != null ? [var.kubelet_config] : []
|
||||
iterator = config
|
||||
content {
|
||||
cpu_manager_policy = config.value.cpu_manager_policy
|
||||
cpu_cfs_quota = config.value.cpu_cfs_quota
|
||||
cpu_cfs_quota_period = config.value.cpu_cfs_quota_period
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "linux_node_config" {
|
||||
for_each = var.linux_node_config_sysctls != null ? [var.linux_node_config_sysctls] : []
|
||||
iterator = config
|
||||
content {
|
||||
sysctls = config.value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "autoscaling" {
|
||||
|
|
|
@ -40,6 +40,22 @@ variable "initial_node_count" {
|
|||
default = 1
|
||||
}
|
||||
|
||||
variable "kubelet_config" {
|
||||
description = "Kubelet configuration."
|
||||
type = object({
|
||||
cpu_cfs_quota = string
|
||||
cpu_cfs_quota_period = string
|
||||
cpu_manager_policy = string
|
||||
})
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "linux_node_config_sysctls" {
|
||||
description = "Linux node configuration."
|
||||
type = map(string)
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
description = "Cluster location."
|
||||
type = string
|
||||
|
|
Loading…
Reference in New Issue