mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
add config-vm flag to enable terminated pod garbage collection.
This commit is contained in:
parent
407f9b9e42
commit
ef015c3574
@ -47,6 +47,7 @@ MASTER_IP_RANGE="${MASTER_IP_RANGE:-10.246.0.0/24}"
|
|||||||
MINION_SCOPES="${MINION_SCOPES:-compute-rw,monitoring,logging-write,storage-ro}"
|
MINION_SCOPES="${MINION_SCOPES:-compute-rw,monitoring,logging-write,storage-ro}"
|
||||||
RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}"
|
RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}"
|
||||||
ENABLE_EXPERIMENTAL_API="${KUBE_ENABLE_EXPERIMENTAL_API:-false}"
|
ENABLE_EXPERIMENTAL_API="${KUBE_ENABLE_EXPERIMENTAL_API:-false}"
|
||||||
|
TERMINATED_POD_GC_THRESHOLD=${TERMINATED_POD_GC_THRESHOLD:-100}
|
||||||
|
|
||||||
# Increase the sleep interval value if concerned about API rate limits. 3, in seconds, is the default.
|
# Increase the sleep interval value if concerned about API rate limits. 3, in seconds, is the default.
|
||||||
POLL_SLEEP_INTERVAL=3
|
POLL_SLEEP_INTERVAL=3
|
||||||
|
@ -322,6 +322,11 @@ EOF
|
|||||||
if [ -n "${ENABLE_EXPERIMENTAL_API:-}" ]; then
|
if [ -n "${ENABLE_EXPERIMENTAL_API:-}" ]; then
|
||||||
cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
|
cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
|
||||||
enable_experimental_api: '$(echo "$ENABLE_EXPERIMENTAL_API" | sed -e "s/'/''/g")'
|
enable_experimental_api: '$(echo "$ENABLE_EXPERIMENTAL_API" | sed -e "s/'/''/g")'
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
if [ -n "${TERMINATED_POD_GC_THRESHOLD:-}" ]; then
|
||||||
|
cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
|
||||||
|
terminated_pod_gc_threshold: '$(echo "${TERMINATED_POD_GC_THRESHOLD}" | sed -e "s/'/''/g")'
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,11 @@ EOF
|
|||||||
if [ -n "${KUBE_APISERVER_REQUEST_TIMEOUT:-}" ]; then
|
if [ -n "${KUBE_APISERVER_REQUEST_TIMEOUT:-}" ]; then
|
||||||
cat >>$file <<EOF
|
cat >>$file <<EOF
|
||||||
KUBE_APISERVER_REQUEST_TIMEOUT: $(yaml-quote ${KUBE_APISERVER_REQUEST_TIMEOUT})
|
KUBE_APISERVER_REQUEST_TIMEOUT: $(yaml-quote ${KUBE_APISERVER_REQUEST_TIMEOUT})
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
if [ -n "${TERMINATED_POD_GC_THRESHOLD:-}" ]; then
|
||||||
|
cat >>$file <<EOF
|
||||||
|
TERMINATED_POD_GC_THRESHOLD: $(yaml-quote ${TERMINATED_POD_GC_THRESHOLD})
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
if [ -n "${TEST_CLUSTER:-}" ]; then
|
if [ -n "${TEST_CLUSTER:-}" ]; then
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{% set cluster_name = "" -%}
|
{% set cluster_name = "" -%}
|
||||||
{% set cluster_cidr = "" -%}
|
{% set cluster_cidr = "" -%}
|
||||||
{% set allocate_node_cidrs = "" -%}
|
{% set allocate_node_cidrs = "" -%}
|
||||||
|
{% set terminated_pod_gc = "" -%}
|
||||||
|
|
||||||
|
|
||||||
{% if pillar['instance_prefix'] is defined -%}
|
{% if pillar['instance_prefix'] is defined -%}
|
||||||
{% set cluster_name = "--cluster-name=" + pillar['instance_prefix'] -%}
|
{% set cluster_name = "--cluster-name=" + pillar['instance_prefix'] -%}
|
||||||
@ -11,6 +13,9 @@
|
|||||||
{% if pillar['allocate_node_cidrs'] is defined -%}
|
{% if pillar['allocate_node_cidrs'] is defined -%}
|
||||||
{% set allocate_node_cidrs = "--allocate-node-cidrs=" + pillar['allocate_node_cidrs'] -%}
|
{% set allocate_node_cidrs = "--allocate-node-cidrs=" + pillar['allocate_node_cidrs'] -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
{% if pillar['terminated_pod_gc_threshold'] is defined -%}
|
||||||
|
{% set terminated_pod_gc = "--terminated-pod-gc-threshold=" + pillar['terminated_pod_gc_threshold'] -%}
|
||||||
|
{% endif -%}
|
||||||
|
|
||||||
{% set cloud_provider = "" -%}
|
{% set cloud_provider = "" -%}
|
||||||
{% set cloud_config = "" -%}
|
{% set cloud_config = "" -%}
|
||||||
@ -34,7 +39,8 @@
|
|||||||
{% set root_ca_file = "--root-ca-file=/srv/kubernetes/ca.crt" -%}
|
{% set root_ca_file = "--root-ca-file=/srv/kubernetes/ca.crt" -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
{% set params = "--master=127.0.0.1:8080" + " " + cluster_name + " " + cluster_cidr + " " + allocate_node_cidrs + " " + cloud_provider + " " + cloud_config + service_account_key + pillar['log_level'] + " " + root_ca_file -%}
|
{% set params = "--master=127.0.0.1:8080" + " " + cluster_name + " " + cluster_cidr + " " + allocate_node_cidrs + " " + terminated_pod_gc + " " + cloud_provider + " " + cloud_config + service_account_key + pillar['log_level'] + " " + root_ca_file -%}
|
||||||
|
|
||||||
|
|
||||||
# test_args has to be kept at the end, so they'll overwrite any prior configuration
|
# test_args has to be kept at the end, so they'll overwrite any prior configuration
|
||||||
{% if pillar['controller_manager_test_args'] is defined -%}
|
{% if pillar['controller_manager_test_args'] is defined -%}
|
||||||
|
Loading…
Reference in New Issue
Block a user