config-common.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. # Copyright 2016 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. # Vars assumed:
  16. # NUM_NODES
  17. function get-master-size {
  18. local suggested_master_size=1
  19. if [[ "${NUM_NODES}" -gt "5" ]]; then
  20. suggested_master_size=2
  21. fi
  22. if [[ "${NUM_NODES}" -gt "10" ]]; then
  23. suggested_master_size=4
  24. fi
  25. if [[ "${NUM_NODES}" -gt "100" ]]; then
  26. suggested_master_size=8
  27. fi
  28. if [[ "${NUM_NODES}" -gt "250" ]]; then
  29. suggested_master_size=16
  30. fi
  31. if [[ "${NUM_NODES}" -gt "500" ]]; then
  32. suggested_master_size=32
  33. fi
  34. echo "${suggested_master_size}"
  35. }
  36. if [[ "${FEDERATION:-}" == true ]]; then
  37. NODE_SCOPES="${NODE_SCOPES:-compute-rw,monitoring,logging-write,storage-ro,https://www.googleapis.com/auth/ndev.clouddns.readwrite}"
  38. else
  39. NODE_SCOPES="${NODE_SCOPES:-compute-rw,monitoring,logging-write,storage-ro}"
  40. fi