简体   繁体   English

在没有 minikube 的单节点上运行 k8s

[英]Run k8s on single node without minikube

is it possible to run k8s on single node without using minikube?是否可以在不使用 minikube 的情况下在单个节点上运行 k8s? Today I use kubeadm with 2 hosts, but I would like to know if it is possible to run using only one host.今天我在 2 台主机上使用 kubeadm,但我想知道是否可以只使用一台主机运行。

You can run kubeadm init command to initialize single node cluster.您可以运行 kubeadm init 命令来初始化单节点集群。 You can add/remove nodes to the cluster.您可以向集群添加/删除节点。

taint the master so that it can run containers using the below command污染 master 以便它可以使用以下命令运行容器

kubectl taint nodes --all node-role.kubernetes.io/master-

You need to look into the hardware requirements for running a single node cluster.您需要查看运行单节点集群的硬件要求。 You would need to run你需要运行

  1. etcd which is the backing store for all cluster data. etcd 是所有集群数据的后备存储。
  2. Control plane software(scheduler, controller manager, api-server, kubeadm)控制平面软件(调度程序、控制器管理器、api-server、kubeadm)
  3. Worker node software(kubectl, kube-proxy) all on one node.工作节点软件(kubectl、kube-proxy)都在一个节点上。

When installing kube-adm I see the hardware requirements( https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ ) as 2 GB or more of RAM per machine (any less will leave little room for your apps) and 2 CPUs or more安装 kube-adm 时,我看到硬件要求( https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ )作为每台机器 2 GB 或更多的 RAM (任何更少都会留下您的应用程序空间很小)和2 个或更多 CPU

Example configurations for etcd ( https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/hardware.md#example-hardware-configurations ). etcd 的示例配置( https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/hardware.md#example-hardware-configurations )。

For the CKA exam training material the recommended node setting for a single machine is 2 vcpu's and 7.5 GB memory with a note of caution that you may experience slowness.对于 CKA 考试培训材料,单台机器的推荐节点设置为 2 vcpu 和 7.5 GB 内存,请注意您可能会遇到速度缓慢的问题。 I am going by Ubuntu 18.04 Linux for my recommendations.我将使用 Ubuntu 18.04 Linux 作为我的建议。 Another thing you need to do is disable the swap( https://serverfault.com/questions/881517/why-disable-swap-on-kubernetes ).您需要做的另一件事是禁用交换( https://serverfault.com/questions/881517/why-disable-swap-on-kubernetes )。 It is necessary since kubernetes makes maximum use of disk and cpu resources provided.这是必要的,因为 kubernetes 最大限度地利用了提供的磁盘和 CPU 资源。

So if it for your learning.所以如果是为了你的学习。 Go ahead and start with 2 vcpu's and 7.5 GB memory.继续并从 2 个 vcpu 和 7.5 GB 内存开始。

You could check你可以检查

for single-node Kubernetes installations.用于单节点 Kubernetes 安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM