How to build a K8S cluster and install docker under Hyper-V

How to build a K8S cluster and install docker under Hyper-V

If you have installed the Win10 system and want to build a k8s cluster, the Hyper-V that comes with Win10 is also a very suitable virtual machine environment. In the previous section, we installed two virtual machines. In this section, we will install Docker on both.

master: 192.168.137.2

node1: 192.168.137.3

root password: 123456

1. Log in to the virtual machine using ssh

With ssh, you can directly connect to the virtual machine in the win10 host

2. Turn off security configuration

vi /etc/selinux/config 

3. Turn off the firewall

systemctl stop firewalld
systemctl disable firewalld

4. Permanently disable swap

swapoff -a
vi /etc/fstab

Use # to comment out the swap line

5. Install the latest version of docker

https://docs.docker.com/install/linux/docker-ce/centos/

Uninstall the old version of Docker

sudo yum remove docker \
         docker-client \
         docker-client-latest \
         docker-common \
         docker-latest \
         docker-latest-logrotate \
         docker-logrotate \
         docker-engine

Install dependency packages

sudo yum install -y yum-utils \
 device-mapper-persistent-data \
 lvm2

Configure Docker repository source

sudo yum-config-manager \
  --add-repo \
  https://download.docker.com/linux/centos/docker-ce.repo

Install Docker

sudo yum install docker-ce docker-ce-cli containerd.io

Let Docker start automatically

systemctl enable docker
systemctl start docker

Check whether the installation is successful

docker -v

6. Configure the cgroupdriver type for Alibaba Cloud Image Accelerator and Docker

Set to systemd to be consistent with k8s

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
 "registry-mirrors": ["https://pmp7i8xs.mirror.aliyuncs.com"],
 "exec-opts": ["native.cgroupdriver=systemd"]
}
EOF

Restart Docker

sudo systemctl daemon-reload
sudo systemctl restart docker

TBD: After configuring the docker of two virtual machines, the next step is to install k8s on the two virtual machines

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed steps to install and configure k8s cluster in centos 7
  • Docker learning notes k8s deployment method
  • Introduction to Kubernetes (k8s)
  • Steps to deploy Django project using k8s
  • Implementation of k8s deployment of docker container
  • Docker+K8S cluster environment construction and distributed application deployment
  • Tutorial on deploying high-performance PHP applications on K8S using Rancher
  • Example of how to automatically generate K8S-YAML using python scripts
  • Detailed tutorial on how to quickly deploy SpringBoot applications to K8S
  • Implementation of k8s node rejoining the master cluster
  • Introduction to cloud native technology kubernetes (K8S)
  • How to deploy a Redis cluster on K8s
  • Detailed tutorial on building a continuous integration delivery environment based on Docker+K8S+GitLab/SVN+Jenkins+Harbor
  • Implementation of k8s deployment of redis cluster
  • How to deploy k8s in docker
  • How to package the docker image, push it to the remote server and deploy it to k8s
  • Steps to deploy ingress-nginx on k8s
  • Detailed explanation of how to deploy Kafka interface management tool (kafkamanager) on K8S

<<:  Instance method for mysql string concatenation and setting null value

>>:  Use Python to connect to MySQL database using the pymysql module

Recommend

Vue implements the product tab of the product details page function

This article example shares the specific code of ...

Detailed explanation of JavaScript's Set data structure

Table of contents 1. What is Set 2. Set Construct...

How to query data from multiple unrelated tables and paging in Mysql

Mysql multiple unrelated tables query data and pa...

Reasons and solutions for not being able to detect array changes in Vue2

Table of contents Workaround Why can't I moni...

The difference and usage of Vue2 and Vue3 brother component communication bus

Table of contents vue2.x vue3.x tiny-emitter plug...

How to choose the format when using binlog in MySQL

Table of contents 1. Three modes of binlog 1.Stat...

Summary of Button's four Click response methods

Button is used quite a lot. Here I have sorted ou...

Summary of MySQL LOAD_FILE() function method

In MySQL, the LOAD_FILE() function reads a file a...

An example of using CSS methodologies to achieve modularity

1. What are CSS methodologies? CSS methodologies ...

Linux file systems explained: ext4 and beyond

Today I will take you through the history of ext4...