mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #96418 from marseel/fix_large_k8s_clusters_without_vpc_native
Forbid creating clusters with more than 100 nodes without vpc-native
This commit is contained in:
commit
3146daf433
@ -350,11 +350,17 @@ if [ "${ENABLE_IP_ALIASES}" = true ]; then
|
||||
PROVIDER_VARS="${PROVIDER_VARS:-} ENABLE_IP_ALIASES"
|
||||
PROVIDER_VARS="${PROVIDER_VARS:-} NODE_IPAM_MODE"
|
||||
PROVIDER_VARS="${PROVIDER_VARS:-} SECONDARY_RANGE_NAME"
|
||||
elif [[ -n "${MAX_PODS_PER_NODE:-}" ]]; then
|
||||
else
|
||||
if [[ -n "${MAX_PODS_PER_NODE:-}" ]]; then
|
||||
# Should not have MAX_PODS_PER_NODE set for route-based clusters.
|
||||
echo -e "${color_red:-}Cannot set MAX_PODS_PER_NODE for route-based projects for ${PROJECT}." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$(get-num-nodes)" -gt 100 ]]; then
|
||||
echo -e "${color_red:-}Cannot create cluster with more than 100 nodes for route-based projects for ${PROJECT}." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Enable GCE Alpha features.
|
||||
if [[ -n "${GCE_ALPHA_FEATURES:-}" ]]; then
|
||||
|
@ -385,11 +385,17 @@ if [ "${ENABLE_IP_ALIASES}" = true ]; then
|
||||
PROVIDER_VARS="${PROVIDER_VARS:-} ENABLE_IP_ALIASES"
|
||||
PROVIDER_VARS="${PROVIDER_VARS:-} NODE_IPAM_MODE"
|
||||
PROVIDER_VARS="${PROVIDER_VARS:-} SECONDARY_RANGE_NAME"
|
||||
elif [[ -n "${MAX_PODS_PER_NODE:-}" ]]; then
|
||||
else
|
||||
if [[ -n "${MAX_PODS_PER_NODE:-}" ]]; then
|
||||
# Should not have MAX_PODS_PER_NODE set for route-based clusters.
|
||||
echo -e "${color_red:-}Cannot set MAX_PODS_PER_NODE for route-based projects for ${PROJECT}." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$(get-num-nodes)" -gt 100 ]]; then
|
||||
echo -e "${color_red:-}Cannot create cluster with more than 100 nodes for route-based projects for ${PROJECT}." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Enable GCE Alpha features.
|
||||
if [[ -n "${GCE_ALPHA_FEATURES:-}" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user