|
10 | 10 | String $role = 'worker', |
11 | 11 | String $container_runtime = 'docker', |
12 | 12 | String $kubelet_dir = '/var/lib/kubelet', |
13 | | - String $hard_eviction_memory_threshold = |
14 | | - five_percent_of_total_ram(dig44($facts, ['memory', 'system', 'total_bytes'], 1)), |
| 13 | + Optional[String] $eviction_hard_memory_available_threshold = '5%', |
| 14 | + Optional[String] $eviction_hard_nodefs_available_threshold = '10%', |
| 15 | + Optional[String] $eviction_hard_nodefs_inodes_free_threshold = '5%', |
| 16 | + Boolean $eviction_soft_enabled = true, |
| 17 | + Optional[String] $eviction_soft_memory_available_threshold = '10%', |
| 18 | + Optional[String] $eviction_soft_nodefs_available_threshold = '15%', |
| 19 | + Optional[String] $eviction_soft_nodefs_inodes_free_threshold = '10%', |
| 20 | + Optional[String] $eviction_soft_memory_available_grace_period = '0m', |
| 21 | + Optional[String] $eviction_soft_nodefs_available_grace_period = '0m', |
| 22 | + Optional[String] $eviction_soft_nodefs_inodes_free_grace_period = '0m', |
| 23 | + String $eviction_max_pod_grace_period = '-1', |
| 24 | + String $eviction_pressure_transition_period = '2m', |
| 25 | + Optional[String] $eviction_minimum_reclaim_memory_available = '100Mi', |
| 26 | + Optional[String] $eviction_minimum_reclaim_nodefs_available = '1Gi', |
| 27 | + Optional[String] $eviction_minimum_reclaim_nodefs_inodes_free = undef, |
15 | 28 | Optional[String] $network_plugin = undef, |
16 | 29 | Integer $network_plugin_mtu = 1460, |
17 | 30 | Boolean $allow_privileged = true, |
|
43 | 56 | ){ |
44 | 57 | require ::kubernetes |
45 | 58 |
|
| 59 | + if ! $eviction_soft_memory_available_threshold or ! $eviction_soft_memory_available_grace_period { |
| 60 | + $_eviction_soft_memory_available_threshold = undef |
| 61 | + $_eviction_soft_memory_available_grace_period = undef |
| 62 | + } else { |
| 63 | + $_eviction_soft_memory_available_threshold = $eviction_soft_memory_available_threshold |
| 64 | + $_eviction_soft_memory_available_grace_period = $eviction_soft_memory_available_grace_period |
| 65 | + } |
| 66 | + |
| 67 | + if ! $eviction_soft_nodefs_available_threshold or ! $eviction_soft_nodefs_available_grace_period { |
| 68 | + $_eviction_soft_nodefs_available_threshold = undef |
| 69 | + $_eviction_soft_nodefs_available_grace_period = undef |
| 70 | + } else { |
| 71 | + $_eviction_soft_nodefs_available_threshold = $eviction_soft_nodefs_available_threshold |
| 72 | + $_eviction_soft_nodefs_available_grace_period = $eviction_soft_nodefs_available_grace_period |
| 73 | + } |
| 74 | + |
| 75 | + if ! $eviction_soft_nodefs_inodes_free_threshold or ! $eviction_soft_nodefs_inodes_free_grace_period { |
| 76 | + $_eviction_soft_nodefs_inodes_free_threshold = undef |
| 77 | + $_eviction_soft_nodefs_inodes_free_grace_period = undef |
| 78 | + } else { |
| 79 | + $_eviction_soft_nodefs_inodes_free_threshold = $eviction_soft_nodefs_inodes_free_threshold |
| 80 | + $_eviction_soft_nodefs_inodes_free_grace_period = $eviction_soft_nodefs_inodes_free_grace_period |
| 81 | + } |
| 82 | + |
46 | 83 | $_systemd_wants = $systemd_wants |
47 | 84 | if $container_runtime == 'docker' { |
48 | 85 | $_systemd_after = ['docker.service'] + $systemd_after |
|
0 commit comments