Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use RancherVM in K8S

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

K8S how to use RancherVM, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

Design idea of RancherVM

RancherVM makes extensive use of Docker containerization and container image repositories at a deep level. The virtual machine base image is packaged as a Docker image and published to any Docker image repository. RancherVM also comes with a number of popular operating system images stored in Docker Hub. Users are free to choose from a variety of public and private image repositories, and can even run their own private image repositories: https://docs.docker.com/registry/deploying/.

Now, each virtual machine runs in Kubernetes pod, which we call VM pod. The Kubernetes controller is responsible for managing the life cycle of the vm pod, granting users the right to start or shut down the virtual machine, modify the machine's cpu and memory allocation, and so on.

Persistent storage

The RancherVM system defines its own custom resource definition (Custom Resource Definitions, referred to as CRD) and stores all states in it. Therefore, RancherVM has no additional requirements for storage in addition to the persistent data storage required to run Kubernetes. The REST server provides ports for CRUD operations on these CRD to be performed. And through the new UI,REST server has a better user experience.

Dispatching

We now use the Kubernetes scheduler to intelligently place vm pod on multiple nodes. Limiting CPU and memory resources ensures that vm pod can be safely dispatched to hosts with sufficient resources. Depending on the size of the node, a single host can achieve 100 + vm pods. There is no additional overhead to schedule virtual machines, and scalability limitations should be determined by the Kubernetes itself. In practice, we have seen a case of 1000 + node clusters.

The network

RancherVM uses bridging networks to provide connectivity to user virtual machines. In order to retain its network identity, each virtual machine pod will save its assigned MAC address to its virtual machine CRD. IP address management requires an external DHCP server. Of course, if DHCP's lease expires and vm pod is closed for a long time, its IP address may change.

The controller runs on each node to resolve the MAC address to the IP address assigned by the external DHCP. Typically, cloud providers do not do this because they perform their own IP address management (IPAM) by implementing DHCP servers. In this way, we do not need to control the DHCP server or add instrument inside the virtual machine when bridging the network.

There are also some inherent scalability limitations in this design-the network you bridge must be large enough to provide a unique IP address to each VM.

How to use RancherVM

RancherVM needs a running Kubernetes cluster that contains nodes running Debian-based operating systems and KVM.

Run the following command to deploy the RancherVM component to your Kubernetes cluster.

GUI

After deployment, you can find the UI endpoint by querying the front-end Kubernetes service:

Now you can navigate to: 30874 to access UI.

If you want to start SSH remote access, you can also add your public key. On the Credentials interface, click Create, add your public key, give it a good name, and then click OK.

Creating an instance is also very simple. Stand-alone Create on the Instances interface. You will see a form that needs to be filled out. You need to add your own public key or enable the NoVNC network server. Just click OK!

After a while you can see that the virtual machine is running and the IP address is assigned.

Now you can use your own private key to connect to the machine through SSH. The user name varies depending on the operating system to which you are assigned. For example, the user name of the Ubuntu user is Ubuntu,CentOS, the Centos,Fedora user is Fedora, and so on.

For security reasons, password-based SSH connections are disabled by default. If you choose not to add the public key to the virtual machine specification, you can use NoVNC to access the machine. Click the NoVNC button to open the console within the browser. If the image is provided by Rancher, the user name is rancher and the password is rancher.

Dashboard provides an overview of the CRDs in the current system:

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report