docker安装

wget    https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo

yum install -y docker-ce

systemctl start docker
systemctl enable docker

一:配置hosts文件

cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.3 xiaolizi

二:配置内核参数

创建/etc/sysctl.d/k8s.conf文件,添加如下内容:

net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1

执行命令使修改生效。

sysctl -p /etc/sysctl.d/k8s.conf

三:关闭防火墙和selinux

systemctl stop firewalld && systemctl disable firewalld

setenforce 0

sed -i 's/^SELINUX=enforcing$/SELINUX=disabled/' /etc/selinux/config && setenforce 0

四:配置k8s仓库

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

五:安装kubelet

yum install -y kubelet kubeadm kubectl
systemctl enable kubelet && systemctl start kubelet

六:初始化

kubeadm init --apiserver-advertise-address=192.168.0.3 --image-repository registry.aliyuncs.com/google_containers
--kubernetes-version v1.17.0 --pod-network-cidr=192.168.0.0/16

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

kubectl taint nodes --all node-role.kubernetes.io/master-

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml

七:查看

最新文章

  1. Android UiAutomator快速调试
  2. C#Light 再推荐,顺便介绍WP8 功能展示项目
  3. PHP入门 - - 05--&gt;编写HTML页面的常用标签
  4. apache/php 开启 gzip压缩
  5. Linux下升级python版本
  6. source insight3.5中文乱码解决方案
  7. pagination jquery最简单的分页【无刷新和刷新都通用】
  8. 序言 - PHP零基础快速入门
  9. MySQL之数据备份、pymysql模块
  10. 使用python画一只佩奇
  11. git 入门教程之github 教程
  12. 开源自己写的Library到github,让别人或自己的项目依赖
  13. 菜单联动,select联动菜单(搜索之后默认选中)
  14. 转 举例说明使用MATLAB Coder从MATLAB生成C/C++代码步骤
  15. 【Unix网络编程】chapter5TCP回射服务器程序
  16. JAVA-开发IDE版本
  17. os.path 模块
  18. js中常用的内部函数的使用
  19. layui 弹框
  20. Python 关于数组矩阵变换函数numpy.nonzero(),numpy.multiply()用法

热门文章

  1. python库之——sklearn
  2. [Windows] Windows API 串口通信
  3. FPGA设计思想之串并转换
  4. async包 ES6 async/await的区别
  5. 使用zxing生成和解析二维码
  6. JAVA的堆栈和内存、垃圾回收解说
  7. keepalive笔记之二:keepalive+nginx(自定义脚本实现,上述例子也可以实现)
  8. 发现日志文件和打印在eclipse控制台中的编码不一致
  9. 吴裕雄--天生自然 python数据分析:葡萄酒分析
  10. android activity 启动过程分析(source code 4.4)