如何将节点添加到我的 kops 集群?(这里的节点是我的外部实例) [英] how to add a node to my kops cluster? (node in here is my external instance)

查看:21
本文介绍了如何将节点添加到我的 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 操作,这是一个用于维护生产级 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.

节点Kubernetes 表示集群运行 Pod 的物理或虚拟机.集群由许多旨在保持服务正常工作的节点组成.指定节点的数量在 Kubernetes 集群创建期间由 Kops 实用程序声明.

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.

我找到了Kubernetes 元素 用于 Ubuntu 机器.或许能帮到你.

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:

kops 编辑 ig 节点

kops edit ig nodes

编辑器显示配置文件后,找到 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:

kops 更新集群 --yes

kops update cluster --yes

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

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

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆