项目作者: hfutseld

项目描述 :
“计划经济”下的kubernetes的调度策略
高级语言:
项目地址: git://github.com/hfutseld/kubeTransition-schedule.git
创建时间: 2016-10-13T22:34:12Z
项目社区:https://github.com/hfutseld/kubeTransition-schedule

开源协议:

下载


kubeTransition-schedule

“计划经济”下的kubernetes的调度策略

背景

在传统的应用部署上,可能使用的是指定机器IP部署的策略,而kubernetes的docker编排采用的是“市场经济”策略,根据集群中机器的状况进行筛选、打分,选取最优的机器进行部署docker。从传统的应用部署方式转换到kubernetes的docker编排方式的过程中,可能需要一个过渡的阶段,即对应用进行计划分配IP,所以这个项目的名称为kubeTransition-schedule

功能

  • 在kubernetes中指定某些机器用于部署该pod
  • pod之间的互斥问题(亲和性)
  • pod独占机器部署(一台机器上只能部署一个pod)

kubernetes中的schedule模块源码分析

kubernetes的github地址

源码版本:1.3.10

kube-schedule的源码在/kubernetes/plugin下,以下是plugin目录下kube-schedule的代码结构(去掉了其他不相干的代码)

  1. plugin
  2. ├── cmd
  3. └── kube-scheduler
  4. ├── app
  5. ├── options
  6. └── options.go
  7. └── server.go //SchedulerServer的数据结构定义
  8. └── scheduler.go //kube-scheduler的入口程序
  9. └── pkg
  10. └── scheduler
  11. ├── algorithm //预选和优选策略算法
  12. ├── doc.go
  13. ├── listers.go
  14. ├── predicates
  15. ├── error.go
  16. ├── predicates.go
  17. └── predicates_test.go
  18. ├── priorities
  19. ├── interpod_affinity.go
  20. ├── interpod_affinity_test.go
  21. ├── metadata.go
  22. ├── node_affinity.go
  23. ├── node_affinity_test.go
  24. ├── priorities.go
  25. ├── priorities_test.go
  26. ├── selector_spreading.go
  27. ├── selector_spreading_test.go
  28. ├── taint_toleration.go
  29. ├── taint_toleration_test.go
  30. └── util
  31. ├── non_zero.go
  32. ├── topologies.go
  33. └── util.go
  34. ├── scheduler_interface.go
  35. ├── scheduler_interface_test.go
  36. └── types.go
  37. ├── algorithmprovider
  38. ├── defaults
  39. ├── compatibility_test.go
  40. └── defaults.go
  41. ├── plugins.go
  42. └── plugins_test.go
  43. ├── api
  44. ├── latest
  45. └── latest.go
  46. ├── register.go
  47. ├── types.go
  48. ├── v1
  49. ├── register.go
  50. └── types.go
  51. └── validation
  52. ├── validation.go
  53. └── validation_test.go
  54. ├── equivalence_cache.go
  55. ├── extender.go
  56. ├── extender_test.go
  57. ├── factory
  58. ├── factory.go
  59. ├── factory_test.go
  60. ├── plugins.go
  61. └── plugins_test.go
  62. ├── generic_scheduler.go
  63. ├── generic_scheduler_test.go
  64. ├── metrics
  65. └── metrics.go
  66. ├── scheduler.go
  67. ├── scheduler_test.go
  68. ├── schedulercache
  69. ├── cache.go
  70. ├── cache_test.go
  71. ├── interface.go
  72. ├── node_info.go
  73. └── util.go
  74. └── testing
  75. ├── fake_cache.go
  76. └── pods_to_cache.go