简体   繁体   English

将Kents的Centos VM彼此连接

[英]Connecting Centos VMs to each other for K8s

Im trying to set up kubernetes on my centos VMs using virtualbox. 我试图使用virtualbox在我的centos VM上设置kubernetes。 I prefer to use the kubeadm method, so that I can join slave nodes with a join token. 我更喜欢使用kubeadm方法,以便可以使用连接令牌连接从属节点。

My issue is that I think I am lacking understanding of how to connect my VMs to one another beforehand. 我的问题是,我认为我之前对如何将虚拟机相互连接缺乏了解。 This is the resource I am using for the Kubernetes installation: https://www.profiq.com/kubernetes-cluster-setup-using-virtual-machines/ 这是我用于Kubernetes安装的资源: https ://www.profiq.com/kubernetes-cluster-setup-using-virtual-machines/

When I create VMs and run ifconfig, they all have the same IPs listed, even if they are new VMs and not just a copy of the original. 当我创建VM并运行ifconfig时,它们都具有列出的相同IP,即使它们是新VM,而不仅仅是原始VM的副本。 I must be doing something wrong. 我一定做错了什么。

Anyway, Im just wondering if anyone would be so kind as to give me some steps to get my VMs talking to each other, just to be sure Im doing it correctly. 无论如何,Im只是想知道是否有人会给我一些步骤让我的VM互相交谈,以确保Im正确执行。 Im following the article I posted, and can ping each VM from the other, but then ran ifconfig and, since each machine has the same 10.0.2.15 IP, I feel like its just pinging itself and not the master from slave, etc 我按照我发布的文章,可以互相ping通每个VM,但是随后运行了ifconfig,并且由于每台机器都具有相同的10.0.2.15 IP,我觉得它只是可以ping通自身,而不是从slave主机。

Did you perform the step after the cloning and before you load kubernetes to change the IP addresses of the 2nd and 3rd VM? 您是否在克隆之后且在加载kubernetes之前执行步骤以更改第二和第三VM的IP地址?

from the instructions you are following, I see: 从您遵循的说明中,我看到:

Now create a linked clone machines from kubemaster machines created before. Once you’re done, boot into machine and change following things to match infrastructure:

Set IP address 192.168.99.21 (or 22 for second slave) for host only network.
Set hostname hostnamectl set-hostname kubeslave1 (or kubeslave2 for second slave) Everything else is already configured.

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

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