Get the App
SLTechnology News&Howtos  ›  Servers  › 

Rapid deployment of k8s cluster by kubeadm

Shulou Source: shulou.com Published: 2022-06-02 16:37:23 10月16日 Update

Kubeadm is a tool launched by the official community for rapid deployment of kubernetes clusters.

This tool can deploy a kubernetes cluster with two instructions:

Create a Master node

$kubeadm init

Add a Node node to the current cluster

$kubeadm join

1. Installation requirements

Before you begin, you need to meet the following conditions for deploying Kubernetes cluster machines:

One or more machines, operating system CentOS7.x-86_x64 hardware configuration: 2GB or more RAM,2 CPU or more CPU, hard disk 30GB or more cluster network interconnection between all machines can access the Internet, need to download images prohibit swap partition 2. The learning goal is to install Docker and kubeadm on all nodes, deploy Kubernetes Master deployment container network plug-ins to deploy Kubernetes Node, add nodes to the Kubernetes cluster and deploy Dashboard Web pages, and visually view Kubernetes resources 3. Prepare the environment

Turn off the firewall:

$systemctl stop firewalld

$systemctl disable firewalld

Turn off selinux:

$sed-I's Universe / etc/selinux/config

$setenforce 0

Turn off swap:

$swapoff-a $temporary

$vim / etc/fstab $permanent

Cd / etc/yum.repos.d/

Mv CentOS-Base.repo CentOS-Base.repo.ori

Wget-O / etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

Add the corresponding relationship between hostname and IP (remember to set hostname):

Such as hostnamectl set-hostname k8s-master01

Cat / etc/hosts

192.168.56.135 k8s-master01

192.168.56.136 k8s-node01

192.168.56.137 k8s-node02

Chain that passes bridged IPv4 traffic to iptables:

Cat > / etc/sysctl.d/k8s.conf / etc/yum.repos.d/kubernetes.repo ~ / .bashrc

Tags: Clusters nodes addresses mirrors tools more machines versions networks hosts commands containers plug-ins Ali output run frequent operating systems between Internet Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Apple Shulou Technology MariaDB MySQL