how to add an node to my kops cluster? (node in here is my external instance)

最后都变了- 提交于 2019-12-01 03:44:38

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.

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 autoscaling.

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 found the description of manual installation process of Kubernetes elements for the Ubuntu machine. It may help you a bit.

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

In this case, use kops to edit cluster properties:

kops edit ig --name= nodes

After editor showns configuration file find maxSize parameter and change it to desire new size of the cluster: (example configuration file taken from internet)

apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  creationTimestamp: "2017-07-01T12:06:22Z"
  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
  role: Node
  subnets:
  - eu-west-1a

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

kops update cluster --yes

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!