Kubernetes体系结构-Kubernetes集群管理和初始化节点 [英] Kubernetes Architecture - Kubernetes Cluster Management and initializing Nodes

查看:121
本文介绍了Kubernetes体系结构-Kubernetes集群管理和初始化节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将部署方案从docker更改为Kubernetes.现在,我探索了Kubernetes的体系结构-群集,节点,荚,服务,副本集/控制器,Kubernetes-cni,kube-ctl等.现在,我需要开始部署到Kubernetes群集中.在探索时,我发现了可以在同一台计算机上或在VM中创建单个节点和主节点的文档和讨论.还找到了用于集群创建的kubespray和minikube文档.

I am trying to change my deploy scenario from docker to Kubernetes. Now I explored the architecture of Kubernetes - Cluster, Nodes, Pods, Services, replica Sets/controller, Kubernetes-cni, kube-ctl etc. Now I need to begin with deployment into Kubernetes cluster. When I am exploring, I found documentations and discussions that can create single node and master in same machine or possible in VMs. Also found kubespray and minikube documentations for cluster creation.

在这里,我对使用Kubernetes感到困惑.

Here I am adding my confusions about hands on with Kubernetes.

  1. 在创建和使用Kubernetes时,为什么在相同或VM中存在诸如单节点和主节点之类的变体?为什么群集容器有偏差?
  2. 如何确定我是需要在同一台计算机上选择单个节点还是主节点,还是需要在不同节点上使用Vms?
  3. Minikube和Kubespray如何在Kubernetes架构中提供不同的方法?,因为Kubernetes是单一来源的产品-Google.
  4. 如果我在ubuntu 16.04中安装kubeadm,kubernetes-cni和kubelet,可以在同一台计算机上启动节点吗?

我如何澄清这些困惑?

推荐答案

概念和术语的分类非常复杂,文档仍然很少.

The taxonomy of concepts and terms is very complicated, and the documentation is still pretty sparse.

1. For creating and working with kubernetes, 
why there is a variation like single node and master in same or in VMs? 
Why there is a deviation in cluster container?

偏差是为了支持许多不同的用例-容器工作负载开发人员在其笔记本电脑上工作,需要多少假冒集群,而无需进行大量运营仪式; kubernetes要求人们在一个很小但真实的集群上学习和测试;以及各种规模工厂的实际生产工作量.

The deviation is to support many distinct use cases- container workload developers working on their laptops needing what amounts to a fake cluster without a lot of operational ceremony; kubernetes ops folks learning and testing on a small but real clusters; and real production workloads for varyingly-sized plants.

在第一种情况下,对于容器工作负载开发,有一个名为minikube的软件,它类似于kubernetes发行版,可以使用VirtualBox或其他桌面级虚拟机工具自动创建单个虚拟机,即预配置为运行组合的kubernetes主节点和节点,足以在笔记本电脑上运行真正的kubernetes工作负载.

For the first case, for container workload development, there is a piece of software called minikube, which is like a distribution of kubernetes that automates creating a single virtual machine- using VirtualBox or other desktop-class virtual machine tooling- that is preconfigured to run a combined kubernetes master and node, sufficient to be able to run real kubernetes workloads, but on a laptop.

对于第二种情况,出于非生产目的,主机和工作程序功能可以在单个计算机上运行,​​也可以在少数工作机上使用单个主机.

For the second case, for non production purposes, the master and worker functions can be run on a single machine, or a single master machine can be used with a small number of worker machines.

生产kubernetes集群通常将具有3或5或7个主计算机-虚拟机或裸机.在机器故障的情况下,需要多个主服务器来维护etcd的仲裁-其中kubernetes存储所有运行时状态. 3台主机允许1台主机发生故障而不会破坏群集. 5个主机将容忍2个主机故障,等等.

A production kubernetes cluster will usually have 3 or 5 or 7 master machines- VMs or bare metals. Multiple masters are needed to maintain quorum for etcd- where kubernetes stores all runtime state- in the case of machine failures. 3 master machines allow for 1 master machine to fail without disrupting the cluster. 5 masters will tolerate 2 master machine failures, etc.

如此多的主服务器可以支持大量的工作机-数十到数百个-运行容器工作负载.在生产环境中,人们不希望在主计算机上运行客户端工作负载.

This number of masters can support a large number of worker machines- dozens to hundreds- running the container workloads. In a production environment, one would not want to run client workloads on master machines.

2. How I can decide whether I need to choose single node and master 
in same machine. Or do I need to use Vms for different nodes?

请参阅上文-为了进行开发,请使用minikube.对于生产而言,如果您自己在运行集群,或者使用云提供商的托管kubernetes产品,则计划使用多个冗余主服务器.

See above- for development, use minikube. For production, plan to use multiple redundant masters if you are running the cluster yourself, or use a cloud provider's managed kubernetes offering.

3. How the Minikube and Kubespray is providing different methodology
in kubernetes architecture?

Minikube仅用于开发. Kubespray是在构建生产集群时提供一些自动化帮助的众多工具之一. Kubespray的独特功能是Ansible在机器设置和自动化中的使用.取决于您对Ansible和/或其竞争对手的舒适度和兴趣,这可能是不希望的.

Minikube is for development only. Kubespray is one of many tools that provides some automation help when building a production cluster. Kubespray's distinguishing feature is the use of Ansible for machine setup and automation. This may or may not be desirable, depending on your comfort and interest in Ansible and/or its competitors.

4. Why have so many options when kubernetes is the product of a 
single source - google.

Kubernetes当然起源于Google,但是现在许多公司中有数百名或更多的工程师,包括Microsoft,Amazon,RedHat,Oracle和许多小型公司都在积极地致力于这一工作.这是一个了不起的项目.

Kubernetes certainly originated in Google, but now there are hundreds or more engineers across many companies, including Microsoft, Amazon, RedHat, Oracle, and tons of tiny companies, actively working on it. It is a remarkable project.

5. If I am installing kubeadm, kubernetes-cni and kubelet in my ubuntu 16.04
Can I initiate nodes in the same machine ?

Kubeadm是设置工具,而不是生产运行时工具,但是可以,您可以将容器与kubernetes主节点所需的位在同一台机器上运行.除了etcd,kubelet,apiserver,控制器管理器之外,您还需要运行Docker-与Docker进行Kubelet对话以安排容器.我只建议不要在此机器上运行其他任何东西-不正确的配置可能会导致作为主机/工作机的机器出现问题,因此所有其他工作都将丢失.

Kubeadm is a setup tool, not a production runtime tool, but yes, you can run containers on the same machine as the bits that are needed for a kubernetes master. In addition to etcd, kubelet, apiserver, controller manager, you need to run Docker as well- Kubelet talks to Docker to schedule containers. I would only advise NOT running anything else on this machine- improper configuration can cause problems with the machine serving as master/worker so any other work will be lost.

这篇关于Kubernetes体系结构-Kubernetes集群管理和初始化节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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