标签:pos set source etc setup base color mes inf
Prerequisites:
Node | OS | IP |
k8s-master | CentOS7 | 192.168.137.161 |
k8s-node1 | CentOS7 | 192.168.137.162 |
Now we have 2 working CentOS virtual machine, which can connect to each other, also able access to Internet. Let‘s do some configuration before we provision kubernetes cluster on them.
Install kubernetes:
firewall-cmd --state # check firewall state
systemctl stop firewalld.service # stop firewall
systemctl disable firewalld.service # disable firewall to auto launch
getenforce # check SELinux status setenforce 0 # stop SELinux sed -i "s/SELINUX\=.*/SELINUX=disable/g" /etc/selinux/config # disable SELinux module
shutdown -r now # Reboot system is required
more /etc/hostname # check current hostname hostnamectl set-hostname master01 # update hostname to master01
Perform the same command to update hostname of k8s-node1:
cat >> /etc/hosts << EOF 192.168.137.161 master01 192.168.137.162 node01
NOTE: Perform the same update for k8s-node1
swapoff -a # switch of swap temporary free -m # check if swap turned off successful, the line swap should be showing 0
cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/ enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg EOF
yum clean all yum -y makecache
5 - CentOS system configuration before k8s installation
标签:pos set source etc setup base color mes inf
原文地址:https://www.cnblogs.com/waynewei/p/14852976.html