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

React native realizes the monitoring gesture up and down pull effect

React native implements the monitoring gesture to...

Introduction to the use of base link tag base

<br />When you click the link, the web page ...

CSS easily implements fixed-ratio block-level containers

When designing H5 layout, you will usually encoun...

How to use the jquery editor plugin tinyMCE

Modify the simplified file size and download the ...

What are the new features of Apache Spark 2.4, which will be released in 2018?

This article is from the Apache Spark Meetup held...

Solution to Ubuntu 20.04 Firefox cannot play videos (missing flash plug-in)

1. Flash plug-in package download address: https:...

CSS achieves the effect of two elements blending (sticky effect)

I remember that a few years ago, there was an int...

An audio-visual Linux distribution that appeals to audiophiles

I recently stumbled upon the Audiovisual Linux Pr...

Analysis of the Nesting Rules of XHTML Tags

In the XHTML language, we all know that the ul ta...

CSS implements six adaptive two-column layout methods

HTML structure <body> <div class="w...

CSS3 realizes the red envelope shaking effect

There is a requirement to realize the shaking eff...

How to add configuration options to Discuz! Forum

Discuz! Forum has many configuration options in th...