本文介绍了如何将节点添加到我的kops集群? (这里的节点是我的外部实例)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照以下说明在AWS上创建了一个Kubernetes集群.我所有的主节点和工作节点都在运行Ubuntu.

I have created a Kubernetes cluster on AWS by following the instructions below. All my master and worker nodes are running Ubuntu.

https://jee-appy .blogspot.in/2017/10/setup-kubernetes-cluster-kops-aws.html

我知道如何使用集群更新来增加或减少集群中节点的数量,而kubernetes会为我们增加一个新节点,

I am aware on how to increase or decrease the number of nodes in my cluster using cluster updates which kubernetes spins up a new node for us,

但是我想知道,是否可以将我的外部aws实例(例如,具有相同操作系统的实例,如ubuntu)附加到我现有的kops集群上?

However i was wondering, is it possible to attach my external aws instance(for eg: an instance with same OS like ubuntu) to my existing kops cluster?

推荐答案

Kops表示 Kubernetes Operations ,这是用于维护生产级Kubernetes安装的命令行工具. Kops与 Amazon Web Services 一起使用效果最佳.已经尝试完全支持GCE和其他云软件,但这是未来.

Kops means Kubernetes Operations, and this is a command line tool made to maintain production grade Kubernetes installation. Kops works best with Amazon Web Services. There have been attempts to fully support GCE and other cloud-ware software, but this is the future.

节点 "rel ="nofollow noreferrer"> Kubernetes 是指群集运行Pod的物理机或虚拟机.集群由旨在保持服务正常运行的多个节点组成.通过Kops实用程序在创建Kubernetes集群期间声明了指定节点的数量.

Nodes in Kubernetes mean physical or virtual machines where a cluster is running pods. The cluster consists of a number of nodes aimed to keep services working. The quantity of designated nodes is declared during the Kubernetes cluster creation by Kops utility.

有可能向群集添加(扩展)节点以获得更好的性能.当由内部群集例程管理新节点的供应过程时,此功能称为自动扩展.

There is a possibility to add (extend) nodes to the cluster to achieve better performance. When the process of provisioning new nodes is managed by internal cluster routines, this feature is called auto-scaling.

kops使用实例组进行自动缩放.使用

kops uses instance groups for auto-scaling. See your instance groups using

kops获取实例组

当然,您可以将现有的VM实例连接到Kubernetes集群(无论是否在AWS上运行),但是您需要手动完成全部操作-Kops实用程序中没有导入功能. 我不推荐这样做.

Of course, you can attach your existing VM instance to Kubernetes cluster (working on AWS or not), but you need to do the whole thing manually - there is no import facility in the Kops utility. I don't recommend this.

我找到了适用于Ubuntu计算机的Kubernetes元素.可能会对您有所帮助.

I found the description of manual installation process of Kubernetes elements for the Ubuntu machine. It may help you a bit.

如果您需要扩展Kubernetes配置的运行节点数,请考虑使用自动缩放功能.

If you need to extend the number of running nodes for your Kubernetes configuration, please consider using the autoscaling feature.

在这种情况下,请使用kops编辑群集属性:

In this case, use kops to edit cluster properties:

编辑器显示配置文件后,找到minSize参数并将其更改为所需的新集群大小.确保maxSize等于或大于minSize.下面的示例来自互联网.

After editor shows configuration file find minSize parameter and change it to desire new size of the cluster. Make sure the maxSize is equal to or larger than minSize. The example below was taken from the internet.

apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
  creationTimestamp: "2017-07-01T12:06:22Z"
  generation: 2
  labels:
    kops.k8s.io/cluster: URL_OF_CLUSTER
  name: nodes
spec:
  image: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-
  machineType: m3.large
  maxSize: 7
  minSize: 3
  nodeLabels:
    kops.k8s.io/instancegroup: nodes
  role: Node
  subnets:
  - eu-west-1a

然后,应用新配置,并让kops调整群集的大小:

Then, apply the new configuration and let kops resize the cluster:

AWS创建新的VM实例后,它们将准备就绪;接下来,kops将应用Kubernetes配置并将其与集群配置合并.

New VM instances will be ready after AWS creates them; next, kops applies Kubernetes configuration and merge them with cluster configuration.

这篇关于如何将节点添加到我的kops集群? (这里的节点是我的外部实例)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 14:46