Task Objectives#
- Complete the installation and deployment of a highly available k8s cluster.
Task Platform#
- Physical devices--
- Operating System: openEuler 22.03 LTS SP2
Deployment Guide#
Cluster Topology Diagram
1: Deploy Ceph Cluster#
Task 1: Configuration Preparation#
- Rename hostname
# Change the hostname of the host at 10.10.1.80 to future-k8s-master0
hostnamectl set-hostname future-k8s-master0 && bash
# Change the hostname of the host at 10.10.1.81 to future-k8s-master1
hostnamectl set-hostname future-k8s-master1 && bash
# Change the hostname of the host at 10.10.1.82 to future-k8s-master2
hostnamectl set-hostname future-k8s-master2 && bash
# Change the hostname of the host at 10.10.1.16 to k8s-ceph-node0
hostnamectl set-hostname k8s-ceph-node0 && bash
# Change the hostname of the host at 10.10.1.17 to k8s-ceph-node1
hostnamectl set-hostname k8s-ceph-node1 && bash
# Change the hostname of the host at 10.10.1.18 to k8s-ceph-node2
hostnamectl set-hostname k8s-ceph-node2 && bash
# Change the hostname of the host at 10.10.1.15 to k8s-ceph-node3
hostnamectl set-hostname k8s-ceph-node3 && bash
- Pre-installation configuration modifications
# Disable the firewall
systemctl stop firewalld
systemctl disable firewalld
firewall-cmd --state
# Permanently disable SELinux
setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
cat /etc/selinux/config
# Permanently disable swap
swapoff --all
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
cat /etc/fstab
# Add hosts
cat >> /etc/hosts << EOF
10.10.1.80 future-k8s-master0
10.10.1.81 future-k8s-master1
10.10.1.82 future-k8s-master2
10.10.1.16 k8s-ceph-node0
10.10.1.17 k8s-ceph-node1
10.10.1.18 k8s-ceph-node2
10.10.1.15 k8s-ceph-node3
10.10.1.83 future-k8s-vip
EOF
# View
cat /etc/hosts
# Add bridge filtering and kernel forwarding configuration file
cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
# View
cat /etc/sysctl.d/k8s.conf
# Load br_netfilter module
modprobe br_netfilter
# Check if loaded
lsmod | grep br_netfilter
# Load bridge filtering and kernel forwarding configuration file
sysctl -p /etc/sysctl.d/k8s.conf
# Synchronize time
yum install ntp -y
systemctl start ntpd
systemctl enable ntpd
yum install chrony -y
systemctl start chronyd
systemctl enable chronyd
# Modify configuration, add content
echo "
server 10.10.3.70 iburst
allow 10.10.3.0/24
allow 10.10.1.0/24
" >> /etc/chrony.conf
timedatectl set-ntp true
systemctl restart chronyd
timedatectl status
date
- Install ipset and ipvsadm