support reserve ephemeral-storage (#8895)

This commit is contained in:
Thearas 2022-06-06 22:34:26 +08:00 committed by GitHub
parent 4dfce51ded
commit 01ca7293f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 1 deletions

1
.gitignore vendored
View file

@ -4,6 +4,7 @@
*.iml *.iml
temp temp
.idea .idea
.vscode
.tox .tox
.cache .cache
*.bak *.bak

View file

@ -252,9 +252,11 @@ podsecuritypolicy_enabled: false
## Uncomment to override default values ## Uncomment to override default values
# system_memory_reserved: 512Mi # system_memory_reserved: 512Mi
# system_cpu_reserved: 500m # system_cpu_reserved: 500m
# system_ephemeral_storage_reserved: 2Gi
## 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
## 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

View file

@ -28,17 +28,21 @@ kubelet_fail_swap_on: true
# Reserve this space for kube resources # Reserve this space for kube resources
kube_memory_reserved: 256Mi kube_memory_reserved: 256Mi
kube_cpu_reserved: 100m kube_cpu_reserved: 100m
# kube_ephemeral_storage_reserved: 2Gi
# 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
# 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
# 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
## 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

View file

@ -23,7 +23,7 @@ enforceNodeAllocatable:
{% endfor %} {% endfor %}
{% endif %} {% endif %}
staticPodPath: {{ kube_manifest_dir }} staticPodPath: {{ kube_manifest_dir }}
cgroupDriver: {{ kubelet_cgroup_driver }} 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 }}
@ -63,18 +63,30 @@ kubeReserved:
{% if is_kube_master|bool %} {% if is_kube_master|bool %}
cpu: {{ kube_master_cpu_reserved }} cpu: {{ kube_master_cpu_reserved }}
memory: {{ kube_master_memory_reserved }} memory: {{ kube_master_memory_reserved }}
{% if kube_master_ephemeral_storage_reserved is defined %}
ephemeral-storage: {{ kube_master_ephemeral_storage_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 %}
ephemeral-storage: {{ kube_ephemeral_storage_reserved }}
{% endif %}
{% endif %} {% endif %}
{% if system_reserved is defined and system_reserved %} {% if system_reserved is defined and system_reserved %}
systemReserved: systemReserved:
{% if is_kube_master|bool %} {% if is_kube_master|bool %}
cpu: {{ system_master_cpu_reserved }} cpu: {{ system_master_cpu_reserved }}
memory: {{ system_master_memory_reserved }} memory: {{ system_master_memory_reserved }}
{% if system_master_ephemeral_storage_reserved is defined %}
ephemeral-storage: {{ system_master_ephemeral_storage_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 %}
ephemeral-storage: {{ system_ephemeral_storage_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 %}