Complete Guide to Installing Kubernetes 1.23.5 Cluster on Ubuntu 18.04

This document provides detailed steps for setting up Kubernetes 1.23.5 cluster using Aliyun's mirror sources on Ubuntu 18.04, including component installation and network configuration.

This article was published 2122 days ago, some content may be outdated. If you have any questions, please leave a comment.

Installing Kubernetes

Install kubelet, kubeadm, kubectl

  • Add Kubernetes repository
1
2
3
4
5
6
7
8
  sudo apt-get install -y ca-certificates curl software-properties-common apt-transport-https curl
  curl -s https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | sudo apt-key add -
  
  sudo tee /etc/apt/sources.list.d/kubernetes.list <<EOF
  deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
  EOF
  
  sudo apt-get update
  • Install kubeadm, kubelet, kubectl
1
  apt install -y kubelet=1.23.5-00 kubectl=1.23.5-00 kubeadm=1.23.5-00
  • Start kubelet service and enable it to start on boot
1
2
  systemctl start kubelet
  systemctl enable kubelet

Initialize Kubernetes cluster

1
2
3
4
5
6
7
kubeadm init --kubernetes-version v1.23.5 \
--apiserver-advertise-address 192.168.142.63 \
--image-repository registry.aliyuncs.com/google_containers \
--service-cidr 172.95.0.0/12 \
--pod-network-cidr 172.245.0.0/16 \
--upload-certs \
--v=5

Install network plugin

calico-ipv4.yaml

Facing the sea with spring blossoms.
Built with Hugo
Theme Stack designed by Jimmy