简体   繁体   English

如何使用Kops或Kubernetes创建AWS竞价型实例?

[英]How to create AWS spot instances with Kops or Kubernetes?

I am currently using kops to create AWS EC2 clusters. 我目前正在使用kops创建AWS EC2集群。 But it does not seem to have an option to specify 'spot' instances. 但是它似乎没有指定“ spot”实例的选项。

Does anybody know how to create instances of type 'spot' with kops or with kubernetes? 有人知道如何使用kops或kubernetes创建类型为'spot'的实例吗?

From the docs https://github.com/kubernetes/kops/blob/master/docs/instance_groups.md#converting-an-instance-group-to-use-spot-instances 从文档https://github.com/kubernetes/kops/blob/master/docs/instance_groups.md#converting-an-instance-group-to-use-spot-instances

Follow the normal procedure for reconfiguring an InstanceGroup, but set the maxPrice property to your bid. 按照正常过程重新配置InstanceGroup,但将maxPrice属性设置为您的出价。 For example, "0.10" represents a spot-price bid of $0.10 (10 cents) per hour. 例如,“ 0.10”表示每小时$ 0.10(10美分)的现货价格。

So after kops create cluster but before kops update cluster --yes run kops edit ig nodes --name $NAME and set maxPrice to your max bid. 因此,在kops create cluster但在kops update cluster --yes之前-是, kops update cluster --yes运行kops edit ig nodes --name $NAME并将maxPrice设置为最高出价。

metadata:
  creationTimestamp: "2016-07-10T15:47:14Z"
  name: nodes
spec:
  machineType: t2.medium
  maxPrice: "0.01"
  maxSize: 3
  minSize: 3
  role: Node

It appears that gardener/machine-controller-manager could be taught about Spot instances fairly easily, and there is an existing issue to do just such a thing. 似乎可以很容易地向园丁/机器控制器-经理学习有关Spot实例的知识,并且存在要做这种事情的现有问题 I can't recall off-hand if that is the Node Controller Manager that I recalled seeing, or it is merely a Node Controller Manager and thus there may be other implementations of that idea which already include spot support. 如果是我回忆起节点控制器管理器,或者只是一个节点控制器管理器,那么我就不会立刻想起,因此,该想法的其他实现可能已经包含现场支持。

That makes a presumption that you actually meant spot for the workers , and not for the whole cluster. 这就意味着您实际上是在为工人而不是整个集群服务。 If you mean the whole cluster, then you may be much, much happier with something like kubespray and use that to lay a functioning cluster on top of existing machines. 如果您指的是整个集群,那么您对kubespray之类的东西可能会感到非常高兴,并使用它在现有机器之上放置一个正常运行的集群。 Just bear in mind that while kubernetes certainly is resilient to "damage," including the loss of a master, an etcd member, and without question the loss of a Node , it might frown if a huge portion of its machines vanish at once. 请记住,虽然kubernetes 当然可以抵抗“损坏”,包括丢失master,etcd成员以及毫无疑问丢失Node ,但如果大量机器立即消失,它可能会皱眉。 In other words: using spot could mean that you spend more programmer/devops/glucose triaging spot disappearance, or you have to so vastly overprovision replicas that it starts to eat into the savings from spot in the first place. 换句话说:使用现货可能意味着您要花费更多的程序员/开发人员/葡萄糖分流现货消失,或者您必须过度配置过多的复制品,以至于一开始就占用了现货的节省。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM