...
1#!/usr/bin/env bash
2
3# Copyright 2017 The Kubernetes Authors.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# A configuration for Kubemark cluster. It doesn't need to be kept in
18# sync with gce/config-default.sh (except the filename, because I'm reusing
19# gce/util.sh script which assumes config filename), but if some things that
20# are enabled by default should not run in hollow clusters, they should be disabled here.
21
22# shellcheck disable=SC2034 # Variables sourced in other scripts.
23
24source "${KUBE_ROOT}/cluster/gce/config-common.sh"
25
26CLEANUP_KUBEMARK_IMAGE=${CLEANUP_KUBEMARK_IMAGE:-true}
27TEST_CLUSTER_LOG_LEVEL="${TEST_CLUSTER_LOG_LEVEL:-"--v=4"}"
28
29# If you want to set up multiple kubemark clusters with different "names",
30# you should change this env per each start-kubemark.sh invocation.
31KUBE_GCE_INSTANCE_PREFIX="${KUBE_GCE_INSTANCE_PREFIX:-"default"}"
32
33# NUM_NODES is used by start-kubemark.sh to determine a correct number of replicas.
34NUM_NODES=${KUBEMARK_NUM_NODES:-10}
35NUM_WINDOWS_NODES=${KUBEMARK_NUM_WINDOWS_NODES:-0}
36
37HOLLOW_KUBELET_TEST_LOG_LEVEL="${HOLLOW_KUBELET_TEST_LOG_LEVEL:-$TEST_CLUSTER_LOG_LEVEL}"
38HOLLOW_PROXY_TEST_LOG_LEVEL="${HOLLOW_PROXY_TEST_LOG_LEVEL:-$TEST_CLUSTER_LOG_LEVEL}"
39
40# Hollow-node components' test arguments.
41HOLLOW_KUBELET_TEST_ARGS="${HOLLOW_KUBELET_TEST_ARGS:-} ${HOLLOW_KUBELET_TEST_LOG_LEVEL}"
42HOLLOW_PROXY_TEST_ARGS="${HOLLOW_PROXY_TEST_ARGS:-} ${HOLLOW_PROXY_TEST_LOG_LEVEL}"
43
44# Optional: Enable cluster autoscaler.
45ENABLE_KUBEMARK_CLUSTER_AUTOSCALER="${ENABLE_KUBEMARK_CLUSTER_AUTOSCALER:-false}"
46# When using Cluster Autoscaler, always start with one hollow-node replica.
47# NUM_NODES should not be specified by the user. Instead we use
48# NUM_NODES=KUBEMARK_AUTOSCALER_MAX_NODES. This gives other cluster components
49# (e.g. kubemark master, Heapster) enough resources to handle maximum cluster size.
50if [[ "${ENABLE_KUBEMARK_CLUSTER_AUTOSCALER}" == "true" ]]; then
51 NUM_REPLICAS=1
52 if [[ -n "$NUM_NODES" ]]; then
53 echo "WARNING: Using Cluster Autoscaler, ignoring NUM_NODES parameter. Set KUBEMARK_AUTOSCALER_MAX_NODES to specify maximum size of the cluster."
54 fi
55fi
56
57#Optional: Enable kube dns.
58ENABLE_KUBEMARK_KUBE_DNS="${ENABLE_KUBEMARK_KUBE_DNS:-true}"
59KUBE_DNS_DOMAIN="${KUBE_DNS_DOMAIN:-cluster.local}"
60
61CLEANUP_KUBEMARK_IMAGE=false
View as plain text