Kubernetes集群管理部署过程(centos7)
2016-01-29 11:36
976 查看
Kubernetes集群管理部署过程(centos7)
本文按照官网部署详情参考http://kubernetes.io/v1.1/docs/getting-started-guides/centos/centos_manual_config.html
安装准备
两台相同的centos7主机分别命名为master, minion配置静态IP地址,并且在hosts文件写入对应的地址解析
更换yum地址为国内源, ali 或者 163都可以
添加kubernetes源地址
http://cbs.centos.org/repos/virt7-docker-common-testing/x86_64/os/
关闭firewall , selinux
更新系统软件包后重启机器
开始安装
两台机器均要安装yum install kubernetes yum install http://cbs.centos.org/kojifiles/packages/etcd/0.4.6/7.el7.centos/x86_64/etcd-0.4.6-7.el7.centos.x86_64.rpm[/code]
两台机器修改以下配置,编辑/etc/kubernetes/config# Comma separated list of nodes in the etcd cluster KUBE_ETCD_SERVERS="--etcd-servers=http://master:4001" # logging to stderr means we get it in the systemd journal KUBE_LOGTOSTDERR="--logtostderr=true" # journal message level, 0 is debug KUBE_LOG_LEVEL="--v=0" # Should this cluster be allowed to run privileged docker containers KUBE_ALLOW_PRIV="--allow-privileged=false" KUBE_MASTER="--master=http://master:8080"
在master机器修改, 编辑/etc/kubernetes/apiserver# The address on the local server to listen to. KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0" # The port on the local server to listen on. KUBE_API_PORT="--port=8080" # How the replication controller and scheduler find the kube-apiserver KUBE_MASTER="--master=http://master:8080" # Address range to use for services KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16" # default admission control policies KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota" # Add your own! KUBE_API_ARGS=""
启动服务for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do systemctl restart $SERVICES systemctl enable $SERVICES done
在minion机器修改编辑 /etc/kubernetes/kubelet# The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces) KUBELET_ADDRESS="--address=0.0.0.0" # The port for the info server to serve on KUBELET_PORT="--port=10250" # You may leave this blank to use the actual hostname KUBELET_HOSTNAME="--hostname-override=minion" # location of the api-server KUBELET_API_SERVER="--api-servers=http://master:8080" # Add your own! KUBELET_ARGS=""
启动服务for SERVICES in kube-proxy kubelet docker; do systemctl restart $SERVICES systemctl enable $SERVICES done
检查集群状态
在master机器上执行[root@master ~]# kubectl get nodes NAME LABELS STATUS AGE minion kubernetes.io/hostname=minion Ready 14m
相关文章推荐
- grep 命令系列:使用 grep 命令来搜索多个单词
- CentOS下php安装mcrypt扩展
- linux命令-touch
- Linux如何实现开机启动程序详解
- Linux内核驱动加载过程
- linux后台进程管理工具supervisor
- kali linux下安装wingide
- Linux学习笔记--mkdir命令(建立目录)
- linux下mysql数据的导出和导
- 查看linux占用内存/CPU最多的进程
- linux支持中文
- CentOS6.5下openssl加密解密及CA自签颁发证书详解
- Linux 关机和重启命令
- Linux下查看CPU型号,内存大小,硬盘空间命令
- linux命令-mkdir
- Linux软连接和硬链接
- linux tar.xz文件解压
- centos6.5 Confluence5.1 最新版的安装&破解&汉化
- 安装kali linux
- linux命令-cp