config-default.sh 2.9 KB

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