config-default.sh 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. #!/bin/bash
  2. # Copyright 2014 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. ZONE=${KUBE_AWS_ZONE:-us-west-2a}
  16. MASTER_SIZE=${MASTER_SIZE:-}
  17. NODE_SIZE=${NODE_SIZE:-}
  18. NUM_NODES=${NUM_NODES:-4}
  19. # Dynamically set node sizes so that Heapster has enough space to run
  20. if [[ -z ${NODE_SIZE} ]]; then
  21. if (( ${NUM_NODES} < 50 )); then
  22. NODE_SIZE="t2.micro"
  23. elif (( ${NUM_NODES} < 150 )); then
  24. NODE_SIZE="t2.small"
  25. else
  26. NODE_SIZE="t2.medium"
  27. fi
  28. fi
  29. # Dynamically set the master size by the number of nodes, these are guesses
  30. if [[ -z ${MASTER_SIZE} ]]; then
  31. MASTER_SIZE="m3.medium"
  32. if [[ "${NUM_NODES}" -gt "5" ]]; then
  33. suggested_master_size="m3.large"
  34. fi
  35. if [[ "${NUM_NODES}" -gt "10" ]]; then
  36. suggested_master_size="m3.xlarge"
  37. fi
  38. if [[ "${NUM_NODES}" -gt "100" ]]; then
  39. suggested_master_size="m3.2xlarge"
  40. fi
  41. if [[ "${NUM_NODES}" -gt "250" ]]; then
  42. suggested_master_size="c4.4xlarge"
  43. fi
  44. if [[ "${NUM_NODES}" -gt "500" ]]; then
  45. suggested_master_size="c4.8xlarge"
  46. fi
  47. fi
  48. # Optional: Set AWS_S3_BUCKET to the name of an S3 bucket to use for uploading binaries
  49. # (otherwise a unique bucket name will be generated for you)
  50. # AWS_S3_BUCKET=kubernetes-artifacts
  51. # Because regions are globally named, we want to create in a single region; default to us-east-1
  52. AWS_S3_REGION=${AWS_S3_REGION:-us-east-1}
  53. # Which docker storage mechanism to use.
  54. DOCKER_STORAGE=${DOCKER_STORAGE:-aufs}
  55. # Extra docker options for nodes.
  56. EXTRA_DOCKER_OPTS="${EXTRA_DOCKER_OPTS:-}"
  57. INSTANCE_PREFIX="${KUBE_AWS_INSTANCE_PREFIX:-kubernetes}"
  58. CLUSTER_ID=${INSTANCE_PREFIX}
  59. VPC_NAME=${VPC_NAME:-kubernetes-vpc}
  60. AWS_SSH_KEY=${AWS_SSH_KEY:-$HOME/.ssh/kube_aws_rsa}
  61. CONFIG_CONTEXT="${KUBE_CONFIG_CONTEXT:-aws_${INSTANCE_PREFIX}}"
  62. IAM_PROFILE_MASTER="kubernetes-master"
  63. IAM_PROFILE_NODE="kubernetes-minion"
  64. LOG="/dev/null"
  65. MASTER_DISK_TYPE="${MASTER_DISK_TYPE:-gp2}"
  66. MASTER_DISK_SIZE=${MASTER_DISK_SIZE:-20}
  67. # The master root EBS volume size (typically does not need to be very large)
  68. MASTER_ROOT_DISK_TYPE="${MASTER_ROOT_DISK_TYPE:-gp2}"
  69. MASTER_ROOT_DISK_SIZE=${MASTER_ROOT_DISK_SIZE:-8}
  70. # The minions root EBS volume size (used to house Docker images)
  71. NODE_ROOT_DISK_TYPE="${NODE_ROOT_DISK_TYPE:-gp2}"
  72. NODE_ROOT_DISK_SIZE=${NODE_ROOT_DISK_SIZE:-32}
  73. MASTER_NAME="${INSTANCE_PREFIX}-master"
  74. MASTER_TAG="${INSTANCE_PREFIX}-master"
  75. NODE_TAG="${INSTANCE_PREFIX}-minion"
  76. NODE_SCOPES=""
  77. NON_MASQUERADE_CIDR="${NON_MASQUERADE_CIDR:-10.0.0.0/8}" # Traffic to IPs outside this range will use IP masquerade
  78. SERVICE_CLUSTER_IP_RANGE="${SERVICE_CLUSTER_IP_RANGE:-10.0.0.0/16}" # formerly PORTAL_NET
  79. CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.244.0.0/16}"
  80. MASTER_IP_RANGE="${MASTER_IP_RANGE:-10.246.0.0/24}"
  81. SSH_CIDR="${SSH_CIDR:-0.0.0.0/0}" # IP to restrict ssh access to nodes/master
  82. HTTP_API_CIDR="${HTTP_API_CIDR:-0.0.0.0/0}" # IP to restrict HTTP API access
  83. # If set to an Elastic IP address, the master instance will be associated with this IP.
  84. # Otherwise a new Elastic IP will be acquired
  85. # (We used to accept 'auto' to mean 'allocate elastic ip', but that is now the default)
  86. MASTER_RESERVED_IP="${MASTER_RESERVED_IP:-}"
  87. # Runtime config
  88. RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}"
  89. # Optional: Cluster monitoring to setup as part of the cluster bring up:
  90. # none - No cluster monitoring setup
  91. # influxdb - Heapster, InfluxDB, and Grafana
  92. ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-influxdb}"
  93. # Optional: Enable node logging.
  94. ENABLE_NODE_LOGGING="${KUBE_ENABLE_NODE_LOGGING:-true}"
  95. LOGGING_DESTINATION="${KUBE_LOGGING_DESTINATION:-elasticsearch}" # options: elasticsearch, gcp
  96. # Optional: When set to true, Elasticsearch and Kibana will be setup as part of the cluster bring up.
  97. ENABLE_CLUSTER_LOGGING="${KUBE_ENABLE_CLUSTER_LOGGING:-true}"
  98. ELASTICSEARCH_LOGGING_REPLICAS=1
  99. # Optional: Don't require https for registries in our local RFC1918 network
  100. if [[ ${KUBE_ENABLE_INSECURE_REGISTRY:-false} == "true" ]]; then
  101. EXTRA_DOCKER_OPTS="${EXTRA_DOCKER_OPTS} --insecure-registry ${NON_MASQUERADE_CIDR}"
  102. fi
  103. # Optional: Install cluster DNS.
  104. ENABLE_CLUSTER_DNS="${KUBE_ENABLE_CLUSTER_DNS:-true}"
  105. DNS_SERVER_IP="${DNS_SERVER_IP:-10.0.0.10}"
  106. DNS_DOMAIN="cluster.local"
  107. DNS_REPLICAS=1
  108. # Optional: Install Kubernetes UI
  109. ENABLE_CLUSTER_UI="${KUBE_ENABLE_CLUSTER_UI:-true}"
  110. # Optional: Create autoscaler for cluster's nodes.
  111. ENABLE_CLUSTER_AUTOSCALER="${KUBE_ENABLE_CLUSTER_AUTOSCALER:-false}"
  112. if [[ "${ENABLE_CLUSTER_AUTOSCALER}" == "true" ]]; then
  113. # TODO: actually configure ASG or similar
  114. AUTOSCALER_MIN_NODES="${KUBE_AUTOSCALER_MIN_NODES:-1}"
  115. AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-${NUM_NODES}}"
  116. TARGET_NODE_UTILIZATION="${KUBE_TARGET_NODE_UTILIZATION:-0.7}"
  117. fi
  118. # Admission Controllers to invoke prior to persisting objects in cluster
  119. # If we included ResourceQuota, we should keep it at the end of the list to prevent incremeting quota usage prematurely.
  120. ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,ResourceQuota
  121. # Optional: Enable/disable public IP assignment for minions.
  122. # Important Note: disable only if you have setup a NAT instance for internet access and configured appropriate routes!
  123. ENABLE_NODE_PUBLIC_IP=${KUBE_ENABLE_NODE_PUBLIC_IP:-true}
  124. # OS options for minions
  125. KUBE_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION:-jessie}"
  126. MASTER_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION}"
  127. NODE_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION}"
  128. KUBE_NODE_IMAGE="${KUBE_NODE_IMAGE:-}"
  129. COREOS_CHANNEL="${COREOS_CHANNEL:-alpha}"
  130. CONTAINER_RUNTIME="${KUBE_CONTAINER_RUNTIME:-docker}"
  131. RKT_VERSION="${KUBE_RKT_VERSION:-0.5.5}"
  132. # OpenContrail networking plugin specific settings
  133. NETWORK_PROVIDER="${NETWORK_PROVIDER:-none}" # opencontrail
  134. OPENCONTRAIL_TAG="${OPENCONTRAIL_TAG:-R2.20}"
  135. OPENCONTRAIL_KUBERNETES_TAG="${OPENCONTRAIL_KUBERNETES_TAG:-master}"
  136. OPENCONTRAIL_PUBLIC_SUBNET="${OPENCONTRAIL_PUBLIC_SUBNET:-10.1.0.0/16}"
  137. # Optional: if set to true, kube-up will configure the cluster to run e2e tests.
  138. E2E_STORAGE_TEST_ENVIRONMENT=${KUBE_E2E_STORAGE_TEST_ENVIRONMENT:-false}