Skip to content

Commit

Permalink
Added support for tcp keepalive settings
Browse files Browse the repository at this point in the history
  • Loading branch information
givanovexpe committed Jun 28, 2024
1 parent c4ae518 commit 2bff7bf
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
6 changes: 3 additions & 3 deletions VARIABLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@
| datadog_agent_version | Version of the Datadog Agent running in the ECS cluster. This is only applicable to ECS deployments. | string | 7.50.3-jmx | no |
| datadog_agent_enabled | Whether to include the datadog-agent container. This is only applicable to ECS deployments. | string | false | no |
| enable_sysctl_config_in_eks | Enable sysctl configuration for Hive Metastore. For EKS you need to allow this on your cluster (https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ check EKS version for details). Also see tcp_keepalive_* variables. | bool | false | no |
| tcp_keepalive_time | Sets net.ipv4.tcp_keepalive_time (seconds), enable via 'enable_sysctl_config'. | number | `200` | no |
| tcp_keepalive_intvl | Sets net.ipv4.tcp_keepalive_intvl (seconds), enable via 'enable_sysctl_config'. | number | `30` | no |
| tcp_keepalive_probes | Sets net.ipv4.tcp_keepalive_probes (seconds), enable via 'enable_sysctl_config'. | number | `2` | no |
| tcp_keepalive_time | Sets net.ipv4.tcp_keepalive_time (seconds). | number | `200` | no |
| tcp_keepalive_intvl | Sets net.ipv4.tcp_keepalive_intvl (seconds) | number | `30` | no |
| tcp_keepalive_probes | Sets net.ipv4.tcp_keepalive_probes (seconds) | number | `2` | no |

### apiary_assume_roles

Expand Down
6 changes: 3 additions & 3 deletions k8s-readonly.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ resource "kubernetes_deployment_v1" "apiary_hms_readonly" {
content {
sysctl {
name="net.ipv4.tcp_keepalive_time"
value="${var.tcp_keepalive_time}"
value= var.tcp_keepalive_time
}
sysctl {
name="net.ipv4.tcp_keepalive_intvl"
value="${var.tcp_keepalive_intvl}"
value= var.tcp_keepalive_intvl
}
sysctl {
name="net.ipv4.tcp_keepalive_probes"
value="${var.tcp_keepalive_probes}"
value= var.tcp_keepalive_probes
}
}
}
Expand Down
16 changes: 9 additions & 7 deletions k8s-readwrite.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,18 @@ resource "kubernetes_deployment_v1" "apiary_hms_readwrite" {
dynamic "security_context" {
for_each = var.enable_sysctl_config_in_eks ? ["enabled"] : []
content {
sysctl = [{
sysctl {
name="net.ipv4.tcp_keepalive_time"
value="${var.tcp_keepalive_time}"
},{
value= var.tcp_keepalive_time
}
sysctl {
name="net.ipv4.tcp_keepalive_intvl"
value="${var.tcp_keepalive_intvl}"
},{
value= var.tcp_keepalive_intvl
}
sysctl {
name="net.ipv4.tcp_keepalive_probes"
value="${var.tcp_keepalive_probes}"
}]
value= var.tcp_keepalive_probes
}
}
}
dynamic "init_container" {
Expand Down
9 changes: 4 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -792,22 +792,21 @@ variable "hms_rw_datanucleus_connection_pool_config" {
description = "A map of env vars supported by Apiary docker image that can configure the chosen Datanucleus connection pool"
type = map(any)
default = {}
=======

variable "tcp_keepalive_time" {
description = "Sets net.ipv4.tcp_keepalive_time (seconds), enable via 'enable_sysctl_config'."
description = "Sets net.ipv4.tcp_keepalive_time (seconds)."
type = number
default = 200
}

variable "tcp_keepalive_intvl" {
description = "Sets net.ipv4.tcp_keepalive_intvl (seconds), enable via 'enable_sysctl_config'."
description = "Sets net.ipv4.tcp_keepalive_intvl (seconds)."
type = number
default = 30
}

variable "tcp_keepalive_probes" {
description = "Sets net.ipv4.tcp_keepalive_probes (number), enable via 'enable_sysctl_config'."
description = "Sets net.ipv4.tcp_keepalive_probes (number)."
type = number
default = 2
>>>>>>> ac9f0f9 (Added tcp keep alive config)
}

0 comments on commit 2bff7bf

Please sign in to comment.