search
HomeComputer TutorialsComputer KnowledgeContainerd Kubernetes tutorial for building a k8s cluster.

Containerd Kubernetes tutorial for building a k8s cluster.

Mar 16, 2024 am 08:40 AM
dockerContainerized applications

Containerd Kubernetes tutorial for building a k8s cluster.

Building a Kubernetes cluster is a common task, which can be achieved by using Containerd as the container runtime. An original tutorial that complies with Baidu SEO standards is provided below, demonstrating in detail how to use Containerd and Kubernetes to build a Kubernetes cluster.

Step 1: Install Docker and Containerd

First, we need to install Docker and Containerd on the server. These two tools will assume the management and running tasks of the container. You can complete the installation by following these steps:

  1. Update the package manager on the server:
$ sudo apt update
  1. Install Docker:
$ sudo apt install docker.io
  1. Install Containerd:
$ sudo apt install containerd

Step 2: Configure Containerd

Once the installation is complete, we need to configure Containerd to integrate with Kubernetes. Please follow the steps below to configure:

  1. Create and edit the Containerd configuration file:
$ sudo nano /etc/containerd/config.toml
  1. In the configuration file, find the following line and uncomment it (remove the # symbol before the line):
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
...
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true
  1. Save and close the file.
  2. Restart Containerd to apply configuration changes:
$ sudo systemctl restart containerd

Step 3: Install the Kubernetes control plane

Now, we will install the control plane components of Kubernetes. These components will manage the state and configuration of the entire cluster.

  1. Install Kubeadm, Kubelet and Kubectl using the package manager:
$ sudo apt install kubeadm kubelet kubectl

Step 4: Initialize Master node

The Master node is the control center of the Kubernetes cluster. We will use Kubeadm to initialize the Master node.

  1. Run the following command on the Master node:
$ sudo kubeadm init --pod-network-cidr=192.168.0.0/16
  1. After the initialization is completed, copy the kubeconfig command in the output to the user directory:
$ mkdir -p $HOME/.kube$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config$ sudo chown $(id -u):$(id -g) $HOME /.kube/config

Step 5: Deploy network plug-in

Kubernetes clusters require network plug-ins to implement communication between containers. Here we use Flannel as a network plug-in.

  1. Run the following command on the Master node to deploy Flannel:
$ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

Step 6: Join Worker node

Now, we need to add the Worker node to the Kubernetes cluster. Execute the following command on the Worker node:

  1. Run the Kubeadm join command on the Worker node. This command

Commands are provided in the output in step 4:

$ sudo kubeadm join <Master node IP>:<Master node port> --token <Token value> --discovery-token-ca-cert-hash <Certificate hash value>
  1. Return to the Master node and run the following command on the Master node to view the nodes in the cluster:
$ kubectl get nodes

If everything goes well, you should be able to see the list of Master nodes and joined Worker nodes.

Congratulations! You have successfully set up a Kubernetes cluster based on Containerd and Kubernetes. Now you can start deploying and managing containerized applications on your cluster.

Please note that this tutorial provides basic building guidelines and can be customized and expanded according to actual needs. If you need more in-depth understanding and configuration, please refer to the official Kubernetes documentation or other authoritative resources.

The above is the detailed content of Containerd Kubernetes tutorial for building a k8s cluster.. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:每日运维. If there is any infringement, please contact admin@php.cn delete
HP Battery Check – How to Download the Utility & Check HP Battery - MiniToolHP Battery Check – How to Download the Utility & Check HP Battery - MiniToolApr 25, 2025 am 12:53 AM

What is HP Battery Check? How to download HP Battery Check? How to check battery health on HP laptop in Windows 11/10? To find answers to these questions, go on reading and you can find much information given by php.cn.

Free Download Microsoft Excel 2019 on Windows/Mac/Android/iOSFree Download Microsoft Excel 2019 on Windows/Mac/Android/iOSApr 25, 2025 am 12:52 AM

Are you looking for a Microsoft Excel 2019 download source? You may want to download Excel 2019 for free on Windows/Mac/Android/iOS. php.cn Software writes this post to introduce some Microsoft Excel 2019 download sources for different platforms.

Powerful Solutions for Game Not Using GPU on PCPowerful Solutions for Game Not Using GPU on PCApr 25, 2025 am 12:51 AM

It is annoying to run into game not using GPU when playing a video game. How to fix it? If you find a game using 0 GPU, you can read through this post on php.cn Website to get help.

What's 192.168.10.1? Learn Essentials to Login, Change PasswordWhat's 192.168.10.1? Learn Essentials to Login, Change PasswordApr 25, 2025 am 12:50 AM

Do you know what “192.168.10.1” is? How to log in to your 192.168.0.1 IP address? php.cn will show you some basic information about this IP and some details on 192.168.10.1 admin login, change password & issue troubleshooting.

Resolved! Failed to Synchronize Achievements Error on Uplay - MiniToolResolved! Failed to Synchronize Achievements Error on Uplay - MiniToolApr 25, 2025 am 12:49 AM

The Failed to Synchronize Achievements error just not only happens on the Uplay client but also on Far Cry. When you launch the game, a message appears saying “Failed to Synchronize Achievements” which allows you to skip. If you want to get rid of th

How to Find the Process Start Time on Windows 10/11? - MiniToolHow to Find the Process Start Time on Windows 10/11? - MiniToolApr 25, 2025 am 12:48 AM

Many processes are running in the background when you use your computer. You may want to know the process start time. You can check a process start time using Windows PowerShell or Process Explorer. php.cn Software will introduce these two methods he

Microsoft Excel Price: Buy Microsoft Excel for PC/Mac - MiniToolMicrosoft Excel Price: Buy Microsoft Excel for PC/Mac - MiniToolApr 25, 2025 am 12:47 AM

To create and edit spreadsheets, most of you may use Microsoft Excel. Microsoft Excel is not free. Its stand-alone app costs $159.99. You can also buy a Microsoft 365 plan to get Excel and other Office apps. This post mainly explains the Microsoft Ex

How to Download, Install and Update Kyocera Drivers Windows 10/11 - MiniToolHow to Download, Install and Update Kyocera Drivers Windows 10/11 - MiniToolApr 25, 2025 am 12:46 AM

Do you use the printer in your work and life? Then, you must know before using it, you must download and install the corresponding driver. In this post on php.cn Website, we will mainly introduce to you how to install, update and download Kyocera pri

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Atom editor mac version download

Atom editor mac version download

The most popular open source editor