k8s安装

kubeadm

kubeadm是一个专门快速部署kubernetes集群的工具。
可以使用kubeadm init 来初始化master节点,然后使用kubeadm join 将其他的node节点加入到集群中
kubeadm通过一个简单的配置是将一个最小可用的集群运行起来

  • 新用户可以从kubeadm开始快速搭建kubernetes
  • 熟悉的人可以使用kubeadm快熟搭建集群并测试他们的应用
  • 大型的项目可以配合其他工具,

官方文档
https://kubernetes.io/docs/reference/setup-tools/kubueadm/kubeadm
https://kubernetes.io/docs/setup/independet/install-kubeadm

基于kubeadm部署k8s

14 master kubeadm,kubelet,kubectl,docker
10 node01 kubeadm,kubelet,kubectl,docker
11 node02 kubeadm,kubelet,kubectl,docker

k8s安装

关闭防火墙个selinux

[root@master ~]# setenforce 0
setenforce: SELinux is disabled
[root@master ~]# iptables -F
[root@master ~]# systemctl stop firewalld
[root@master ~]# systemctl disable firewalld
[root@master ~]# systemctl stop NetworkManager
[root@master ~]# systemctl disable NetworkManger
Failed to execute operation: No such file or directory
[root@master ~]# systemctl disable NetworkManager
[root@master ~]# sed -i '/^SELINUX=/s/enforcing/disabled/' /etc/selinux/config 

部署主机并绑定hosts

[root@k8s-master ~]# vim /etc/hosts
192.168.200.14  k8s-master
192.168.200.10  k8s-node01
a92.168.200.11  k8s-node02
[root@master ~]# scp /etc/hosts 192.168.200.10:/etc/
[root@master ~]# scp /etc/hosts 192.168.200.20:/etc/

主机配置初识化

[root@k8s-master ~]# yum -y install vim wget net-tools lrzsz
[root@k8s-master ~]# swapoff -a
[root@k8s-master ~]# sed -i '/swap/s/^/#/' /etc/fstab
cat <<EOF>> /etc/sysctl.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
[root@k8s-master ~]# modprobe br_netfilter
[root@k8s-master ~]# sysctl -p
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1

部署docker环境

上一篇:【MySQL】源码编译安装和配置MySql 5.5.32(单实例)


下一篇:k8s——kubeadm部署k8s(新添node节点)