Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

amazon web services - how to add a node to my kops cluster? (node in here is my external instance)

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

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,

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 auto-scaling.

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

kops get instancegroups

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.

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 nodes

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

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

kops update cluster --yes

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...