Adding support for node & pod pid limit (#9038)

This commit is contained in:
h9-HSFRQDH 2022-07-05 15:20:48 +08:00 committed by GitHub
parent 1d0b3829ed
commit 3bb9542606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -26,20 +26,24 @@ kubelet_fail_swap_on: true
kube_memory_reserved: 256Mi kube_memory_reserved: 256Mi
kube_cpu_reserved: 100m kube_cpu_reserved: 100m
# kube_ephemeral_storage_reserved: 2Gi # kube_ephemeral_storage_reserved: 2Gi
# kube_pid_reserved: 1000
# Reservation for master hosts # Reservation for master hosts
kube_master_memory_reserved: 512Mi kube_master_memory_reserved: 512Mi
kube_master_cpu_reserved: 200m kube_master_cpu_reserved: 200m
# kube_master_ephemeral_storage_reserved: 2Gi # kube_master_ephemeral_storage_reserved: 2Gi
# kube_master_pid_reserved: 1000
# Set to true to reserve resources for system daemons # Set to true to reserve resources for system daemons
system_reserved: false system_reserved: false
system_memory_reserved: 512Mi system_memory_reserved: 512Mi
system_cpu_reserved: 500m system_cpu_reserved: 500m
# system_ephemeral_storage_reserved: 2Gi # system_ephemeral_storage_reserved: 2Gi
# system_pid_reserved: 1000
# Reservation for master hosts # Reservation for master hosts
system_master_memory_reserved: 256Mi system_master_memory_reserved: 256Mi
system_master_cpu_reserved: 250m system_master_cpu_reserved: 250m
# system_master_ephemeral_storage_reserved: 2Gi # system_master_ephemeral_storage_reserved: 2Gi
# system_master_pid_reserved: 1000
## Eviction Thresholds to avoid system OOMs ## Eviction Thresholds to avoid system OOMs
# https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#eviction-thresholds # https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#eviction-thresholds
@ -92,6 +96,10 @@ kube_apiserver_node_port_range: "30000-32767"
# default is equal to application default # default is equal to application default
kubelet_max_pods: 110 kubelet_max_pods: 110
# Sets the maximum number of processes running per Pod
# Default value -1 = unlimited
kubelet_pod_pids_limit: -1
## Support parameters to be passed to kubelet via kubelet-config.yaml ## Support parameters to be passed to kubelet via kubelet-config.yaml
kubelet_config_extra_args: {} kubelet_config_extra_args: {}

View file

@ -27,6 +27,7 @@ cgroupDriver: {{ kubelet_cgroup_driver | default('systemd') }}
containerLogMaxFiles: {{ kubelet_logfiles_max_nr }} containerLogMaxFiles: {{ kubelet_logfiles_max_nr }}
containerLogMaxSize: {{ kubelet_logfiles_max_size }} containerLogMaxSize: {{ kubelet_logfiles_max_size }}
maxPods: {{ kubelet_max_pods }} maxPods: {{ kubelet_max_pods }}
podPidsLimit: {{ kubelet_pod_pids_limit }}
address: {{ kubelet_bind_address }} address: {{ kubelet_bind_address }}
readOnlyPort: {{ kube_read_only_port }} readOnlyPort: {{ kube_read_only_port }}
healthzPort: {{ kubelet_healthz_port }} healthzPort: {{ kubelet_healthz_port }}
@ -66,12 +67,18 @@ kubeReserved:
{% if kube_master_ephemeral_storage_reserved is defined %} {% if kube_master_ephemeral_storage_reserved is defined %}
ephemeral-storage: {{ kube_master_ephemeral_storage_reserved }} ephemeral-storage: {{ kube_master_ephemeral_storage_reserved }}
{% endif %} {% endif %}
{% if kube_master_pid_reserved is defined %}
pid: {{ kube_master_pid_reserved }}
{% endif %}
{% else %} {% else %}
cpu: {{ kube_cpu_reserved }} cpu: {{ kube_cpu_reserved }}
memory: {{ kube_memory_reserved }} memory: {{ kube_memory_reserved }}
{% if kube_ephemeral_storage_reserved is defined %} {% if kube_ephemeral_storage_reserved is defined %}
ephemeral-storage: {{ kube_ephemeral_storage_reserved }} ephemeral-storage: {{ kube_ephemeral_storage_reserved }}
{% endif %} {% endif %}
{% if kube_pid_reserved is defined %}
pid: {{ kube_pid_reserved }}
{% endif %}
{% endif %} {% endif %}
{% if system_reserved is defined and system_reserved %} {% if system_reserved is defined and system_reserved %}
systemReserved: systemReserved:
@ -81,12 +88,18 @@ systemReserved:
{% if system_master_ephemeral_storage_reserved is defined %} {% if system_master_ephemeral_storage_reserved is defined %}
ephemeral-storage: {{ system_master_ephemeral_storage_reserved }} ephemeral-storage: {{ system_master_ephemeral_storage_reserved }}
{% endif %} {% endif %}
{% if system_master_pid_reserved is defined %}
pid: {{ system_master_pid_reserved }}
{% endif %}
{% else %} {% else %}
cpu: {{ system_cpu_reserved }} cpu: {{ system_cpu_reserved }}
memory: {{ system_memory_reserved }} memory: {{ system_memory_reserved }}
{% if system_ephemeral_storage_reserved is defined %} {% if system_ephemeral_storage_reserved is defined %}
ephemeral-storage: {{ system_ephemeral_storage_reserved }} ephemeral-storage: {{ system_ephemeral_storage_reserved }}
{% endif %} {% endif %}
{% if system_pid_reserved is defined %}
pid: {{ system_pid_reserved }}
{% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if is_kube_master|bool and eviction_hard_control_plane is defined and eviction_hard_control_plane %} {% if is_kube_master|bool and eviction_hard_control_plane is defined and eviction_hard_control_plane %}