mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
GKE provider: Add a HEAPSTER_MACHINE_TYPE option
Allows heterogeneous cluster configurations for large cluster synthetic testing.
This commit is contained in:
parent
cc5e159fe5
commit
1fde6f867c
@ -128,6 +128,7 @@ function validate-cluster {
|
|||||||
# ADDITIONAL_ZONES (optional)
|
# ADDITIONAL_ZONES (optional)
|
||||||
# NODE_SCOPES
|
# NODE_SCOPES
|
||||||
# MACHINE_TYPE
|
# MACHINE_TYPE
|
||||||
|
# HEAPSTER_MACHINE_TYPE (optional)
|
||||||
# CLUSTER_IP_RANGE (optional)
|
# CLUSTER_IP_RANGE (optional)
|
||||||
# GKE_CREATE_FLAGS (optional, space delineated)
|
# GKE_CREATE_FLAGS (optional, space delineated)
|
||||||
function kube-up() {
|
function kube-up() {
|
||||||
@ -155,12 +156,26 @@ function kube-up() {
|
|||||||
echo "... Using firewall-rule: ${FIREWALL_SSH}" >&2
|
echo "... Using firewall-rule: ${FIREWALL_SSH}" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local create_args=(
|
local shared_args=(
|
||||||
"--zone=${ZONE}"
|
"--zone=${ZONE}"
|
||||||
"--project=${PROJECT}"
|
"--project=${PROJECT}"
|
||||||
"--num-nodes=${NUM_NODES}"
|
|
||||||
"--network=${NETWORK}"
|
|
||||||
"--scopes=${NODE_SCOPES}"
|
"--scopes=${NODE_SCOPES}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ ! -z "${IMAGE_TYPE:-}" ]]; then
|
||||||
|
shared_args+=("--image-type=${IMAGE_TYPE}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${HEAPSTER_MACHINE_TYPE:-}" ]]; then
|
||||||
|
local -r nodes="${NUM_NODES}"
|
||||||
|
else
|
||||||
|
local -r nodes=$(( NUM_NODES - 1 ))
|
||||||
|
fi
|
||||||
|
|
||||||
|
local create_args=(
|
||||||
|
${shared_args[@]}
|
||||||
|
"--num-nodes=${nodes}"
|
||||||
|
"--network=${NETWORK}"
|
||||||
"--cluster-version=${CLUSTER_API_VERSION}"
|
"--cluster-version=${CLUSTER_API_VERSION}"
|
||||||
"--machine-type=${MACHINE_TYPE}"
|
"--machine-type=${MACHINE_TYPE}"
|
||||||
)
|
)
|
||||||
@ -173,14 +188,14 @@ function kube-up() {
|
|||||||
create_args+=("--cluster-ipv4-cidr=${CLUSTER_IP_RANGE}")
|
create_args+=("--cluster-ipv4-cidr=${CLUSTER_IP_RANGE}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -z "${IMAGE_TYPE:-}" ]]; then
|
|
||||||
create_args+=("--image-type=${IMAGE_TYPE}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
create_args+=( ${GKE_CREATE_FLAGS:-} )
|
create_args+=( ${GKE_CREATE_FLAGS:-} )
|
||||||
|
|
||||||
# Bring up the cluster.
|
# Bring up the cluster.
|
||||||
"${GCLOUD}" ${CMD_GROUP:-} container clusters create "${CLUSTER_NAME}" "${create_args[@]}"
|
"${GCLOUD}" ${CMD_GROUP:-} container clusters create "${CLUSTER_NAME}" "${create_args[@]}"
|
||||||
|
|
||||||
|
if [[ ! -z "${HEAPSTER_MACHINE_TYPE:-}" ]]; then
|
||||||
|
"${GCLOUD}" ${CMD_GROUP:-} container node-pools create "heapster-pool" --cluster "${CLUSTER_NAME}" --num-nodes=1 --machine-type="${HEAPSTER_MACHINE_TYPE}" "${shared_args[@]}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Execute prior to running tests to initialize required structure. This is
|
# Execute prior to running tests to initialize required structure. This is
|
||||||
|
Loading…
Reference in New Issue
Block a user