Skip to content

Kubernetes daemonset for node initial configuration. Currently for modifying files and systemd services on eksctl nodes without changing userdata

License

Notifications You must be signed in to change notification settings

mumoshu/kube-node-init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kube-node-init

kube-node-init is a Kubernetes daemonset for node initial configuration including:

  • Write files
  • Restart systemd services
  • Customize kernel parameters
  • Add Kubernetes node labels
  • Add Kubernetes node taints

Getting Started

$ helm repo add kube-node-init-charts https://raw.githubusercontent.com/mumoshu/kube-node-init/master/docs
$ helm install --name kube-node-init kube-node-init-charts/kube-node-init

This installs the followings to your nodes:

  • The init script
  • Kernel parameters

You can customze every aspect of kube-node-init via values.yaml. Please read the chart's README for more configuration options.

The init script

The default script does the following to improve your EKS nodes runnin Amazon Linux 2:

  • Installs a tweaked /etc/chrony.conf and then restarts chrony systemd service. The conf includes allow 127.0.0.1/32, so that Prometheus node-exporter's ntp-collector is able to connect the chronyd running on the node.

Customizing the init script

You can create your own values.yaml as follows to let kube-node-init use your own script:

values.yaml:

script: |
  echo your alternative, bespoke node init script here!

Run helm upgrade to let kube-node-init rerun with your script:

$ helm upgrade --name kube-node-init stable/kube-node-init --values values.yaml

Kernel parameters

kube-node-init also tweaks several kernel parameters listed under the sysctl.params key in the default values.yaml:

# default: 128
net.core.somaxconn: 65535
# default: 256
net.ipv4.tcp_max_syn_backlog: 65535
# dfault: 1000
net.core.netdev_max_backlog: 16384
# default: 32768 60999
net.ipv4.ip_local_port_range: 1024 65535
# default: 0
# enable(1) to optimize against short-lived sessions
net.ipv4.tcp_tw_reuse: 1
# default: 7200
net.ipv4.tcp_keepalive_time: 200
# default: 75
net.ipv4.tcp_keepalive_intvl: 60
# default: 9
net.ipv4.tcp_keepalive_probes: 3
# default: 6
net.ipv4.tcp_syn_retries: 5

In case you want to disable this feature, set --set sysctl.enabled=true while installing the chart.

About

Kubernetes daemonset for node initial configuration. Currently for modifying files and systemd services on eksctl nodes without changing userdata

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •