如何在aw

时间:2016-04-16 14:20:30

标签: amazon-web-services kubernetes

我跟着the tutorial如何使用ubuntu在aws上创建一个k8s集群。这很好用,所以我有一个主节点和三个节点 - 小兵。但是,我没有找到任何正在运行的工作方法如何将新节点添加到群集中。

  1. 首先,我在aws中有一个新的自动缩放组。它是与群集一起创建的。我试图增加缩放组中的节点数量,缩放过程确实添加了一个实例,但节点不在k8s群集中。没有kubelet,kube-proxy,在实例上没有这样的东西。因此,它没有加入k8s集群是合理的。
  2. 由于我没有找到任何教程,也许我需要做一些手动程序。但这将是一种奇怪的自动缩放。我应该做些什么? kube脚本安装集群,添加扩展组,它不起作用?

    1. 我不坚持自动缩放,我只需要在出现任何故障的情况下添加新节点或者我们将如何添加新的运行pods / rcs。我在Add more nodes in a second zone部分的this article中找到了一个引用,请注意这是关于多区域部署。
    2. 所以我尝试过这样的事情:

      KUBE_USE_EXISTING_MASTER=true KUBERNETES_PROVIDER=aws KUBE_AWS_ZONE=eu-central-1b NUM_NODES=1 KUBE_SUBNET_CIDR=172.20.1.0/24 MASTER_INTERNAL_IP=172.20.0.9 kubernetes/cluster/kube-up.sh

      但总是失败:

      A client error (AlreadyExists) occurred when calling the CreateLaunchConfiguration operation: Launch Configuration by this name already exists - A launch configuration already exists with the name kubernetes-minion-group-eu-central-1b

      肯定有一些方法可以做到这一点,你能帮助别人吗?谢谢!

1 个答案:

答案 0 :(得分:2)

经过一些尝试后,似乎自动缩放组使用了debian图像。请注意,它需要aprox。实例准备就绪后2分钟,包含所有已安装的必需品,您可以使用import random Battleship_Board = [] for x in range(0,5): Battleship_Board.append(["O"] * 5) def print_Battleship_Board(Battleship_Board): for row in Battleship_Board: print (" ".join(row)) print ("Let's play a game of Battleships!") print_Battleship_Board(Battleship_Board) def Random_Battleship_Board_Row(Battleship_Board): return random.randint(0, len(Battleship_Board)-1) def Random_Battleship_Board_Column(Battleship_Board): return random.randint(0, len(Battleship_Board[0])-1) Battleship_Board_Row = Random_Battleship_Board_Row(Battleship_Board) Battleship_Board_Column = Random_Battleship_Board_Column(Battleship_Board) print (Battleship_Board_Row) print (Battleship_Board_Column) for turn in range(5): Guess_Battleship_Board_Row = int(input("Guess the X coordinate:")) -1 Guess_Battleship_Board_Column = int(input("Guess the Y coordinate:")) -1 if Guess_Battleship_Board_Row == Battleship_Board_Row and Guess_Battleship_Board_Column == Battleship_Board_Column: print ("You sunk the battleship!") print ("My ship was here: [" + str(Battleship_Board_Row) + "][" + str(Battleship_Board_Column) + "]") break else: if turn + 1 == 5: Battleship_Board[Guess_Battleship_Board_Row][Guess_Battleship_Board_Column] = "X" print_Battleship_Board(Battleship_Board) print ("Game Over") print ("My ship was here: [" + str(Battleship_Board_Row) + "][" + str(Battleship_Board_Column) + "]") if (Guess_Battleship_Board_Row < 0 or Guess_Battleship_Board_Row > 4) or (Guess_Battleship_Board_Column < 0 or Guess_Battleship_Board_Column > 4): print ("The inserted value is not on the grid.") elif(Battleship_Board[Guess_Battleship_Board_Row-1][Guess_Battleship_Board_Column-1] == "X"): print ("You already inserted this combination") else: print ("You missed my battleship") Battleship_Board[Guess_Battleship_Board_Row][Guess_Battleship_Board_Column] = "X" print ("Number of turns:", turn + 1,"out of 5") print_Battleship_Board(Battleship_Board)

查看实例