@@ -853,6 +853,18 @@ func schemaNodeConfig() *schema.Schema {
853853 Optional : true ,
854854 Description : `Defines the maximum allowed grace period (in seconds) to use when terminating pods in response to a soft eviction threshold being met.` ,
855855 },
856+ "shutdown_grace_period_seconds" : {
857+ Type : schema .TypeInt ,
858+ Optional : true ,
859+ Computed : true ,
860+ Description : `Controls the total duration of time (in seconds) the node delays shutdown.` ,
861+ },
862+ "shutdown_grace_period_critical_pods_seconds" : {
863+ Type : schema .TypeInt ,
864+ Optional : true ,
865+ Computed : true ,
866+ Description : `Controls the portion of total grace period (in seconds) that is specifically reserved for terminating critical pods.` ,
867+ },
856868 "eviction_soft" : {
857869 Type : schema .TypeList ,
858870 Optional : true ,
@@ -1371,6 +1383,18 @@ func schemaNodePoolAutoConfigNodeKubeletConfig() *schema.Schema {
13711383 Elem : & schema.Resource {
13721384 Schema : map [string ]* schema.Schema {
13731385 "insecure_kubelet_readonly_port_enabled" : schemaInsecureKubeletReadonlyPortEnabled (),
1386+ "shutdown_grace_period_seconds" : {
1387+ Type : schema .TypeInt ,
1388+ Optional : true ,
1389+ Computed : true ,
1390+ Description : `Controls the total duration of time (in seconds) the node delays shutdown.` ,
1391+ },
1392+ "shutdown_grace_period_critical_pods_seconds" : {
1393+ Type : schema .TypeInt ,
1394+ Optional : true ,
1395+ Computed : true ,
1396+ Description : `Controls the portion of total grace period (in seconds) that is specifically reserved for terminating critical pods.` ,
1397+ },
13741398 },
13751399 },
13761400 }
@@ -1903,6 +1927,14 @@ func expandKubeletConfig(v interface{}) *container.NodeKubeletConfig {
19031927 if evictionMaxPodGracePeriodSeconds , ok := cfg ["eviction_max_pod_grace_period_seconds" ]; ok {
19041928 kConfig .EvictionMaxPodGracePeriodSeconds = int64 (evictionMaxPodGracePeriodSeconds .(int ))
19051929 }
1930+ if shutdownGracePeriodSeconds , ok := cfg ["shutdown_grace_period_seconds" ]; ok {
1931+ kConfig .ShutdownGracePeriodSeconds = int64 (shutdownGracePeriodSeconds .(int ))
1932+ kConfig .ForceSendFields = append (kConfig .ForceSendFields , "ShutdownGracePeriodSeconds" )
1933+ }
1934+ if shutdownGracePeriodCriticalPodsSeconds , ok := cfg ["shutdown_grace_period_critical_pods_seconds" ]; ok {
1935+ kConfig .ShutdownGracePeriodCriticalPodsSeconds = int64 (shutdownGracePeriodCriticalPodsSeconds .(int ))
1936+ kConfig .ForceSendFields = append (kConfig .ForceSendFields , "ShutdownGracePeriodCriticalPodsSeconds" )
1937+ }
19061938 if v , ok := cfg ["eviction_soft" ]; ok && len (v .([]interface {})) > 0 {
19071939 es := v .([]interface {})[0 ].(map [string ]interface {})
19081940 evictionSoft := & container.EvictionSignals {}
@@ -3058,27 +3090,29 @@ func flattenKubeletConfig(v interface{}) []map[string]interface{} {
30583090 return nil
30593091 }
30603092 transformed := map [string ]interface {}{
3061- "cpu_cfs_quota" : c ["cpuCfsQuota" ],
3062- "cpu_cfs_quota_period" : c ["cpuCfsQuotaPeriod" ],
3063- "cpu_manager_policy" : c ["cpuManagerPolicy" ],
3064- "memory_manager" : flattenMemoryManager (c ["memoryManager" ]),
3065- "topology_manager" : flattenTopologyManager (c ["topologyManager" ]),
3066- "insecure_kubelet_readonly_port_enabled" : flattenInsecureKubeletReadonlyPortEnabled (v ),
3067- "pod_pids_limit" : c ["podPidsLimit" ],
3068- "container_log_max_size" : c ["containerLogMaxSize" ],
3069- "container_log_max_files" : c ["containerLogMaxFiles" ],
3070- "image_gc_low_threshold_percent" : c ["imageGcLowThresholdPercent" ],
3071- "image_gc_high_threshold_percent" : c ["imageGcHighThresholdPercent" ],
3072- "image_minimum_gc_age" : c ["imageMinimumGcAge" ],
3073- "image_maximum_gc_age" : c ["imageMaximumGcAge" ],
3074- "allowed_unsafe_sysctls" : c ["allowedUnsafeSysctls" ],
3075- "single_process_oom_kill" : c ["singleProcessOomKill" ],
3076- "max_parallel_image_pulls" : c ["maxParallelImagePulls" ],
3077- "eviction_max_pod_grace_period_seconds" : c ["evictionMaxPodGracePeriodSeconds" ],
3078- "eviction_soft" : flattenEvictionSignals (c ["evictionSoft" ]),
3079- "eviction_soft_grace_period" : flattenEvictionGracePeriod (c ["evictionSoftGracePeriod" ]),
3080- "eviction_minimum_reclaim" : flattenEvictionMinimumReclaim (c ["evictionMinimumReclaim" ]),
3081- "crash_loop_back_off" : flattenCrashLoopBackOffConfig (c ["crashLoopBackOff" ]),
3093+ "cpu_cfs_quota" : c ["cpuCfsQuota" ],
3094+ "cpu_cfs_quota_period" : c ["cpuCfsQuotaPeriod" ],
3095+ "cpu_manager_policy" : c ["cpuManagerPolicy" ],
3096+ "memory_manager" : flattenMemoryManager (c ["memoryManager" ]),
3097+ "topology_manager" : flattenTopologyManager (c ["topologyManager" ]),
3098+ "insecure_kubelet_readonly_port_enabled" : flattenInsecureKubeletReadonlyPortEnabled (v ),
3099+ "pod_pids_limit" : c ["podPidsLimit" ],
3100+ "container_log_max_size" : c ["containerLogMaxSize" ],
3101+ "container_log_max_files" : c ["containerLogMaxFiles" ],
3102+ "image_gc_low_threshold_percent" : c ["imageGcLowThresholdPercent" ],
3103+ "image_gc_high_threshold_percent" : c ["imageGcHighThresholdPercent" ],
3104+ "image_minimum_gc_age" : c ["imageMinimumGcAge" ],
3105+ "image_maximum_gc_age" : c ["imageMaximumGcAge" ],
3106+ "allowed_unsafe_sysctls" : c ["allowedUnsafeSysctls" ],
3107+ "single_process_oom_kill" : c ["singleProcessOomKill" ],
3108+ "max_parallel_image_pulls" : c ["maxParallelImagePulls" ],
3109+ "eviction_max_pod_grace_period_seconds" : c ["evictionMaxPodGracePeriodSeconds" ],
3110+ "shutdown_grace_period_seconds" : c ["shutdownGracePeriodSeconds" ],
3111+ "shutdown_grace_period_critical_pods_seconds" : c ["shutdownGracePeriodCriticalPodsSeconds" ],
3112+ "eviction_soft" : flattenEvictionSignals (c ["evictionSoft" ]),
3113+ "eviction_soft_grace_period" : flattenEvictionGracePeriod (c ["evictionSoftGracePeriod" ]),
3114+ "eviction_minimum_reclaim" : flattenEvictionMinimumReclaim (c ["evictionMinimumReclaim" ]),
3115+ "crash_loop_back_off" : flattenCrashLoopBackOffConfig (c ["crashLoopBackOff" ]),
30823116 }
30833117
30843118 return []map [string ]interface {}{transformed }
@@ -3145,6 +3179,8 @@ func flattenNodePoolAutoConfigNodeKubeletConfig(v interface{}) []map[string]inte
31453179 transformed := map [string ]interface {}{}
31463180 if c != nil {
31473181 transformed ["insecure_kubelet_readonly_port_enabled" ] = flattenInsecureKubeletReadonlyPortEnabled (c )
3182+ transformed ["shutdown_grace_period_seconds" ] = c ["shutdownGracePeriodSeconds" ]
3183+ transformed ["shutdown_grace_period_critical_pods_seconds" ] = c ["shutdownGracePeriodCriticalPodsSeconds" ]
31483184 }
31493185
31503186 return []map [string ]interface {}{transformed }
0 commit comments