[etcd] Add support for setting the request size limit (#8849)

* [etcd] Add extra documentation for `etcd_memory_limit` and `etcd_quota_backend_bytes`

Signed-off-by: necatican <necaticanyildirim@gmail.com>

* [etcd] Add support for setting ETCD_MAX_REQUEST_BYTES

Signed-off-by: necatican <necaticanyildirim@gmail.com>
pull/8869/head
Necatican Yıldırım 2022-05-23 19:36:03 +03:00 committed by GitHub
parent 85bd1eea27
commit dc1af5a9c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 1 deletions

View File

@ -7,13 +7,20 @@
## Etcd is restricted by default to 512M on systems under 4GB RAM, 512MB is not enough for much more than testing. ## Etcd is restricted by default to 512M on systems under 4GB RAM, 512MB is not enough for much more than testing.
## Set this if your etcd nodes have less than 4GB but you want more RAM for etcd. Set to 0 for unrestricted RAM. ## Set this if your etcd nodes have less than 4GB but you want more RAM for etcd. Set to 0 for unrestricted RAM.
## This value is only relevant when deploying etcd with `etcd_deployment_type: docker`
# etcd_memory_limit: "512M" # etcd_memory_limit: "512M"
## Etcd has a default of 2G for its space quota. If you put a value in etcd_memory_limit which is less than ## Etcd has a default of 2G for its space quota. If you put a value in etcd_memory_limit which is less than
## etcd_quota_backend_bytes, you may encounter out of memory terminations of the etcd cluster. Please check ## etcd_quota_backend_bytes, you may encounter out of memory terminations of the etcd cluster. Please check
## etcd documentation for more information. ## etcd documentation for more information.
# 8G is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it.
# etcd_quota_backend_bytes: "2147483648" # etcd_quota_backend_bytes: "2147483648"
# Maximum client request size in bytes the server will accept.
# etcd is designed to handle small key value pairs typical for metadata.
# Larger requests will work, but may increase the latency of other requests
# etcd_max_request_bytes: "1572864"
### ETCD: disable peer client cert authentication. ### ETCD: disable peer client cert authentication.
# This affects ETCD_PEER_CLIENT_CERT_AUTH variable # This affects ETCD_PEER_CLIENT_CERT_AUTH variable
# etcd_peer_client_auth: true # etcd_peer_client_auth: true

View File

@ -46,10 +46,18 @@ etcd_extra_vars: {}
# Limits # Limits
# Limit memory only if <4GB memory on host. 0=unlimited # Limit memory only if <4GB memory on host. 0=unlimited
# This value is only relevant when deploying etcd with `etcd_deployment_type: docker`
etcd_memory_limit: "{% if ansible_memtotal_mb < 4096 %}512M{% else %}0{% endif %}" etcd_memory_limit: "{% if ansible_memtotal_mb < 4096 %}512M{% else %}0{% endif %}"
# The default storage size limit is 2G.
# 8G is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it.
# etcd_quota_backend_bytes: "2147483648" # etcd_quota_backend_bytes: "2147483648"
# Maximum client request size in bytes the server will accept.
# etcd is designed to handle small key value pairs typical for metadata.
# Larger requests will work, but may increase the latency of other requests
# etcd_max_request_bytes: "1572864"
# Uncomment to set CPU share for etcd # Uncomment to set CPU share for etcd
# etcd_cpu_limit: 300m # etcd_cpu_limit: 300m

View File

@ -19,6 +19,9 @@ ETCD_SNAPSHOT_COUNT={{ etcd_snapshot_count }}
{% if etcd_quota_backend_bytes is defined %} {% if etcd_quota_backend_bytes is defined %}
ETCD_QUOTA_BACKEND_BYTES={{ etcd_quota_backend_bytes }} ETCD_QUOTA_BACKEND_BYTES={{ etcd_quota_backend_bytes }}
{% endif %} {% endif %}
{% if etcd_max_request_bytes is defined %}
ETCD_MAX_REQUEST_BYTES={{ etcd_max_request_bytes }}
{% endif %}
# TLS settings # TLS settings
ETCD_TRUSTED_CA_FILE={{ etcd_cert_dir }}/ca.pem ETCD_TRUSTED_CA_FILE={{ etcd_cert_dir }}/ca.pem

View File

@ -23,6 +23,9 @@ ETCD_SNAPSHOT_COUNT={{ etcd_snapshot_count }}
{% if etcd_quota_backend_bytes is defined %} {% if etcd_quota_backend_bytes is defined %}
ETCD_QUOTA_BACKEND_BYTES={{ etcd_quota_backend_bytes }} ETCD_QUOTA_BACKEND_BYTES={{ etcd_quota_backend_bytes }}
{% endif %} {% endif %}
{% if etcd_max_request_bytes is defined %}
ETCD_MAX_REQUEST_BYTES={{ etcd_max_request_bytes }}
{% endif %}
{% if etcd_log_package_levels is defined %} {% if etcd_log_package_levels is defined %}
ETCD_LOG_PACKAGE_LEVELS={{ etcd_log_package_levels }} ETCD_LOG_PACKAGE_LEVELS={{ etcd_log_package_levels }}
{% endif %} {% endif %}

View File

@ -23,5 +23,6 @@ etcd_metrics: "basic"
etcd_extra_vars: {} etcd_extra_vars: {}
# etcd_quota_backend_bytes: "2147483648" # etcd_quota_backend_bytes: "2147483648"
# etcd_max_request_bytes: "1572864"
etcd_compaction_retention: "8" etcd_compaction_retention: "8"

View File

@ -58,6 +58,9 @@ etcd:
{% if etcd_quota_backend_bytes is defined %} {% if etcd_quota_backend_bytes is defined %}
quota-backend-bytes: "{{ etcd_quota_backend_bytes }}" quota-backend-bytes: "{{ etcd_quota_backend_bytes }}"
{% endif %} {% endif %}
{% if etcd_max_request_bytes is defined %}
max-request-bytes: "{{ etcd_max_request_bytes }}"
{% endif %}
{% if etcd_log_package_levels is defined %} {% if etcd_log_package_levels is defined %}
log-package-levels: "{{ etcd_log_package_levels }}" log-package-levels: "{{ etcd_log_package_levels }}"
{% endif %} {% endif %}
@ -450,4 +453,3 @@ featureGates:
{{ feature|replace("=", ": ") }} {{ feature|replace("=", ": ") }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}