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 set up Kubernetes with Ubuntu and Xen

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly shows you "how to use Ubuntu and Xen to set up Kubernetes", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use Ubuntu and Xen to set Kubernetes" this article.

I want to run my own Kubernetes deployment to run applications and experiments. I don't just want to test Kubernetes, but I also want it to run 24 hours a day. The easiest way to do this is to use Google GCE or AWS. If you use these two methods, you don't need to spend so much money on keeping the base installation running.

After considering a number of options (including running a raspberry pie cluster), I concluded that my best setting is to run a single physical server that hosts many virtual machines.

I chose Xen as my super manager, Ubuntu as "dom0" (more on this later), and Core OS as my Kubernetes host. Here are my settings.

Hardware

Dell T20 server

Intel i5-4590

16GB RAM

120 GB SSD

Software

Super manager: Xen super manager / Ubuntu16.04. I found myself completely confused by the talk of "dom0", but the point is: install Ubuntu16.04 on your own server, and then you install (through apt-get) Xen, and installing Xen is like installing a virtual machine with your original Ubuntu. This virtual machine is called "dem0" and can be used to manage your other virtual machines.

Another problem is that Xen is not a Xen server, and you can completely ignore the commercial product of Xen server.

Kubernetes OS:Core OS Alpha Channel . So far, Stable does not include kubelet (which is exactly what we need), so we use Alpha. This is what I chose because it is easy and easy to support Kubernetes.

Install Xen

Install Xen,libvirt and virtinst on top of a new Ubuntu16.04. Use it as the default boot point and restart. Virtinst

Give us a CLI, which we will use to start the virtual machine later.

What comes back is the original Ubuntu, which runs as a virtual machine on the Xen super manager. Because it is the original installation, we don't know exactly what has changed. Let's take a look:

It will work!

Install Kubernetes

Kubernetes and these beautiful scripts set up the entire cluster for you at the basic level. The problem I found was that I wanted to manage (or understand) the software myself. I don't want a mystery bash script to handle everything for me.

Instead, I created my own set of scripts that are less generated and templated and may be useful for some examples. What is shown here is how to use them.

We will try to use my stuff as little as possible-the following git repository is the 4Core OS cloud profile. These define configurations (network settings, applications). It is also configured for the cluster to generate our SSL certificate.

So, grab my files from Github, grab my files from the latest CoreOS Alpha:

Now create a disk for master,node1,node2,node3:

If you don't have a SSH key, you may need to generate one:

Then we put our SSH key in the cloud file:

We also need to generate our certificates:

Then put the certificate we generated into the master node:

After the configuration is complete, we can now verify the double check:

If it passes ("null" from the server), use these disks to create a Core OS virtual machine:

This will open up four virtual machines running on Core OS, our cloud profile. It depends on where you run (network speed, server power), and it takes a long time to start and run.

What may happen:

Download Flannel image

Kubelet enables and downloads Super kube

The container is opened for the scheduler on API server, controller administrator and master.

Start on the node for the container of kube-proxy

If you want, you can connect to the console and start the monitoring node:

You can also ssh to master and check journalctl:

So, is it up and running? Let's use kubectl (we'll install this locally first):

Let's see:

Finally, if we try and list pods (running processes), we won't get anything. We need to create the "kube-system" namespace. This is easy:

Now:

Woohoo!

Conclusion

So what have we actually accomplished? We have moved the Ubuntu server into a Xen hypervisor. On that super manager, we created four virtual machines running on Core OS. In the Core OS file in my Git repository, we set up an Core OS installation that runs on the master Kubernetes component, and the other three run on the node component.

There are many ways for Kubernetes to run on Core OS. The special point is that we follow the following process to set up:

Flannel service-- can be used to handle our network. It allows containers on one node to communicate with containers on other nodes.

Etcd service--, this is where Kubernetes stays in its state.

Docker service--Docker is how Kubernetes sets mirroring to be enabled.

Kubelet service-- this is the only kubernetes component that acts as a system service. We use kubelet to join our Kubernetes cluster and then start other kubernetes applications.

Like the system service, we also installed the following things as services, managed by Kubernetes, and we did this by replacing the Kubernetes file in / etc/kubernetes/manifests/. Kubelet service monitors this directory and starts the application based on what it finds.

Kube-apiserver

Kube-scheduler

Kube-controller-manager

Kube-proxy

Just the sauce! We don't have a fully functional Kubernetes cluster yet. It's time to play with it!

The above is all the contents of the article "how to set up Kubernetes with Ubuntu and Xen". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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