Ensure sysctls are set for Redis nodes in GKE

On VMs we set several custom sysctls for Redis nodes. Background for most of these can be found in the redis administration documentation.

In chef repo we have (source):

kernel.sem = 250 32000 32 1000
net.ipv4.tcp_keepalive_time = 300
net.core.somaxconn = 1024
vm.overcommit_memory = 1
vm.swappiness = 0

We should investigate which of these we will need in GKE, and how easy it is to set them.

This subset of sysctls is namespaced and thus can be changed on a pod (source):

  • kernel.shm*
  • kernel.msg*
  • kernel.sem
  • fs.mqueue.*
  • net.* (subset)

Everything else is a node-level sysctl that applies globally. Those can be specified via node configuration.

The google beta terraform provider supports setting these via node_config.linux_node_config.sysctls.

Edited by Igor