使用Kubernetes kubeadm和minikube在VM中创建节点 [英] Creation of nodes in VMs by using Kubernetes kubeadm and minikube

查看:101
本文介绍了使用Kubernetes kubeadm和minikube在VM中创建节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用同一台机器创建具有不同数量节点的Kubernetes集群.在这里,我想创建单独的VM,并需要在这些VM中创建节点.我目前正在探索针对这些任务的kubeadm和minikube.

I am trying to create Kubernetes cluster with different number of nodes using same machine. Here I want to create separate VMs and need to create node in those VMs. I am currently exploring about kubeadm and minikube for these tasks.

在探索时,我有以下困惑:

When I am exploring I had the following confusions:

  1. 我需要创建4个节点,每个节点都需要在不同的VM中创建.我可以使用kubeadm满足这些要求吗?
  2. 还发现Minikube用于创建单节点结构,也可以用于创建VM. kubeadm和minikube有什么区别?
  3. 如果我想在不同的VM中创建节点,那么在安装Kubernetes集群主服务器时应该使用哪个工具?
  4. 如果我使用的是VM,那么我可以在Ubuntu 16.04中直接安装VMware工作站/virtualbox吗?
  5. 在AWS EC2中,他们已经将Ubuntu用作虚拟机.那么可以在ubuntu上安装VMware工作站吗?因为它是另一个VM上的VM.

推荐答案

Kubeadm应该是您的不错选择.只需遵循文档,它就非常容易使用. Minikube只会给您单节点Kubernetes.

Kubeadm should be a good choice for you. It is quite easy to use by just following the documentation. Minikube would give you only single node Kubernetes.

  1. Kubeadm是一种工具,用于在现有机器上启动Kubernetes并使其运行.它将基本配置并启动所有必需的Kubernetes组件(以实现最小可行集群). Kubeadm是在虚拟机上引导Kubernetes集群的正确工具.但是您需要自行准备机器(安装操作系统+所需的软件,网络等). kubeadm不会为您这样做.
  2. Minikube是一个工具,可让您在本地启动单节点Kubernetes集群.这通常在VM中完成-minikube支持VirtualBox KVM和其他.它将为您启动虚拟机并处理所有事情.但这不会为您提供4节点群集.
  3. Kubeadm照顾了这两者.您首先要设置主服务器,然后在辅助节点上使用kubeadm来加入主服务器.
  4. 当您使用Kubeadm时,实际上并不在乎您将什么用于虚拟化.您可以选择任何内容.
  5. 为什么要在EC2计算机之上运行虚拟机?为什么不为集群创建更多(也许更小)的EC2计算机呢?您可以以此为灵感: https://github.com/scholzj/terraform-aws-kubernetes .还有一些用于设置整个集群的更高级的工具,例如 Kops .
  1. Kubeadm is a tool to get Kubernetes up and running on already existing machine. It will basically configure and start all required Kubernetes components (for minimum viable cluster). Kubeadm is the right tool to bootstrap the Kubernetes cluster on your virtual machines. But you need to prepare the machines your self (install OS + required software, networking, ...). kubeadm will not do it for you.
  2. Minikube is a tool which will allow you to start locally single node Kubernetes cluster. This is usually done in a VM - minikube supports VirtualBox KVM and others. It will start for you the virtual machine and take care of everything. But it will not do a 4 node cluster for you.
  3. Kubeadm takes care of both. You first setup the master and then use kubeadm on the worker nodes to join the master.
  4. When you use Kubeadm, it doesn't really care what do you use for the virtualization. You can choose whatever you want.
  5. Why do you want to run virtual machines on top of your EC2 machine? Why not just create more (perhaps smaller) EC2 machines for the cluster? You can use this as an inspiration: https://github.com/scholzj/terraform-aws-kubernetes. There are also some more advanced tools for setting up the whole cluster such as (for example) Kops.

这篇关于使用Kubernetes kubeadm和minikube在VM中创建节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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