Deploy k8S using kubeadm

Github deploys K8S using Kubeadm

instructions

  • System environment
LMF @ LMF: ~ $cat/etc/issue Ubuntu 18.04.5 LTS LMF @ LMF: \ n \ l ~ $cat/proc/meminfo | grep MemTotal MemTotal: 4015812 kB lmf@lmf:~$ cat /proc/cpuinfo | grep model\ name model name : Intel(R) Core(TM) i5-10500 CPU @ 3.10ghz Model Name: Model Name: Intel(R) Core(TM) i5-10500 CPU @ 3.10GHzCopy the code

Install the docker

  • For this step, refer to tsinghua University Docker Community Edition image Use help. If it has been installed, please ignore it
  • Ensure that the Cgroup Driver is systemed

  • Set Docker’s Cgroup Driver to systemd
sudo mkdir -p /etc/docker

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

sudo systemctl daemon-reload
sudo systemctl restart docker
Copy the code

Install kubelet Kubeadm Kubectl

sudo apt-get update && sudo apt-get install -y apt-transport-https
curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | sudo apt-key add -

cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
EOF

sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
Copy the code

The deployment of

Sudo kubeadm init - apiserver - advertise - address = 192.168.60.51 - image - repository registry.aliyuncs.com/google_containers - pod - network - cidr = 10.244.0.0/16Copy the code

–apiserver-advertise-address Specifies the local IP address

After the deployment is successful, the following information is displayed:

reference

Reference to use

  • Deploy Kubernetes using kubeadm
  • Kubernetes install latest step centos7
  • Failed to pull image coreDNS :v1.8.0 When installing K8s on Ubuntu 20.04 LTS

In the following reference, similar problems were encountered during the installation process, and the server was reinstalled later. Following the steps in this article, the following problems were not encountered

  • Initialize kubeadm init to curl – sSL http://localhost:10248/healthz ‘failed with error: Get http://localhost