From 999586a110eed72914358a1b5bd182df514e755b Mon Sep 17 00:00:00 2001 From: Kay Yan Date: Mon, 3 Oct 2022 14:06:14 +0800 Subject: [PATCH] sysctl_additional (#9351) --- .../preinstall/tasks/0080-system-configurations.yml | 9 +++++++++ roles/kubespray-defaults/defaults/main.yaml | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/roles/kubernetes/preinstall/tasks/0080-system-configurations.yml b/roles/kubernetes/preinstall/tasks/0080-system-configurations.yml index 720e7337b..dafa47f79 100644 --- a/roles/kubernetes/preinstall/tasks/0080-system-configurations.yml +++ b/roles/kubernetes/preinstall/tasks/0080-system-configurations.yml @@ -127,3 +127,12 @@ state: present params: 'numdummies=0' when: enable_nodelocaldns + +- name: Set additional sysctl variables + sysctl: + sysctl_file: "{{ sysctl_file_path }}" + name: "{{ item.name }}" + value: "{{ item.value }}" + state: present + reload: yes + with_items: "{{ additional_sysctl }}" diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index ad3080d16..a34eae913 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -487,6 +487,12 @@ kubelet_rotate_server_certificates: false # If set to true, kubelet errors if any of kernel tunables is different than kubelet defaults kubelet_protect_kernel_defaults: true +# Set additional sysctl variables to modify Linux kernel variables, for example: +# additional_sysctl: +# - { name: kernel.pid_max, value: 131072 } +# +additional_sysctl: [] + ## List of key=value pairs that describe feature gates for ## the k8s cluster. kube_feature_gates: []