[size=large]1. 安装依赖[/size]
[size=large]2. 停用自带防火墙[/size]
[size=large]3. 安装master(192.168.56.146)[/size]
[size=large]4. 运行API Server[/size]
选型说明:
--etcd_servers:指定etcd连接地址
--insecure-bind-address:api监听地址
--insecure-port:api监听端口
--service-cluster-ip-range:上面说到service角色是定义集群中一个pod集合,这个pod中容器提供一种服务,当创建service时会分配一个CLUSTER_IP提供统一的访问入口,那么,这个选项就是指定分配的IP范围
[size=large]5. 运行Controller Manager[/size]
[size=large]6. 运行Scheduler[/size]
[size=large]7. 验证检查[/size]
[img]http://dl2.iteye.com/upload/attachment/0119/8207/a7f95e1e-1634-3fc0-8803-01a4bf39be30.png[/img]
[size=large]8. 设置开机启动[/size]
执行从kubernetes的安装文件中脚本
kubernetes-1.3.5/cluster/centos/master/scripts/
[img]http://dl2.iteye.com/upload/attachment/0119/8209/612d4304-c729-3987-82f2-a35bf2741227.png[/img]
生成/usr/lib/systemd/system/kube-apiserver.service和/opt/kubernetes/cfg/kube-apiserver
生成/usr/lib/systemd/system/kube-controller-manager.service和/opt/kubernetes/cfg/kube-controller-manager
生成/usr/lib/systemd/system/kube-scheduler.service和/opt/kubernetes/cfg/kube-scheduler
yum install –y curl,iptables-services,net-tools,wget
[size=large]2. 停用自带防火墙[/size]
systemctl stop firewalld
systemctl disable firewalld
[size=large]3. 安装master(192.168.56.146)[/size]
#curl -L https://github.com/kubernetes/kubernetes/releases/download/v1.3.5/kubernetes.tar.gz -o kubernetes.tar.gz
#tar zxvf kubernetes.tar.gz
#cd kubernetes/server
#tar zxvf kubernetes-server-linux-amd64.tar.gz
#cd kubernetes/server
# cp -r ./bin /opt/kubernetes/bin
export PATH=$PATH:/opt/kubernetes/bin/
[size=large]4. 运行API Server[/size]
#kube-apiserver --logtostderr=true --v=0 --etcd_servers=http://etcd:4001 --insecure-bind-address=0.0.0.0 --insecure-port=8080 --service-cluster-ip-range=10.254.0.0/16 >> /data/logs/kube-apiserver.log 2>&1 &
选型说明:
--etcd_servers:指定etcd连接地址
--insecure-bind-address:api监听地址
--insecure-port:api监听端口
--service-cluster-ip-range:上面说到service角色是定义集群中一个pod集合,这个pod中容器提供一种服务,当创建service时会分配一个CLUSTER_IP提供统一的访问入口,那么,这个选项就是指定分配的IP范围
[size=large]5. 运行Controller Manager[/size]
#kube-controller-manager --logtostderr=true --v=0 --master=http://kube-master:8080 >> /data/logs/kube-controller-manager.log 2>&1 &
[size=large]6. 运行Scheduler[/size]
#kube-scheduler --logtostderr=true --v=0 --master=http://kube-master:8080 >> /data/logs/kube-scheduler.log 2>&1 &
[size=large]7. 验证检查[/size]
kubectl -s http://kube-master:8080 get componentstatus
[img]http://dl2.iteye.com/upload/attachment/0119/8207/a7f95e1e-1634-3fc0-8803-01a4bf39be30.png[/img]
[size=large]8. 设置开机启动[/size]
执行从kubernetes的安装文件中脚本
kubernetes-1.3.5/cluster/centos/master/scripts/
[img]http://dl2.iteye.com/upload/attachment/0119/8209/612d4304-c729-3987-82f2-a35bf2741227.png[/img]
生成/usr/lib/systemd/system/kube-apiserver.service和/opt/kubernetes/cfg/kube-apiserver
生成/usr/lib/systemd/system/kube-controller-manager.service和/opt/kubernetes/cfg/kube-controller-manager
生成/usr/lib/systemd/system/kube-scheduler.service和/opt/kubernetes/cfg/kube-scheduler