Kubernetes安装及使用
环境配置
系统要求: CentOS 7
软件版本: 1.5.2
配置目标:
master端 | node端 | |
---|---|---|
IP | 10.0.0.100 | 10.0.0.101 |
etcd | ✔ | |
flannel | ✔ | ✔ |
kube-apiserver | ✔ | |
kube-controller-manager | ✔ | |
kube-scheduler | ✔ | |
kubelet | ✔ | ✔ |
kube-proxy | ✔ | ✔ |
docker | ✔ | ✔ |
共同配置(即master和node都需要进行的操作)
(1)修改/etc/hosts文件,添加master和node节点IP
$ echo "10.0.0.100 centos-master
10.0.0.101 centos-minion" >> /etc/hosts
$ cat /etc/hosts
10.0.0.100 centos-master
10.0.0.101 centos-minion
(2)禁用fierwalld,安装iptables,设置iptables开机自动启动,启用iptables,禁用iptables-services
# 关闭fierwalld
$ systemctl stop firewalld
$ systemctl disable firewalld
# 安装iptables,启动该服务并设置开机自启动
$ yum install iptables
$ systemctl start iptables
$ systemctl enable iptables
# 关闭iptables-services
$ systemctl disable iptables-services
$ systemctl stop iptables-services
# 关闭iptables-services时,可能出现"Failed to issue method call: Access denied"
# 解决方法:修改SElinux配置
$ vi /etc/selinux/config
# SELINUX=enforcing #注释掉
# SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
:wq! #保存退出
$ setenforce 0 #使配置立即生效
(3)安装
This blog is under a CC BY-NC-SA 3.0 Unported License
本文链接:http://yov.oschina.io/article/容器/Docker/Kubernetes安装及使用/