码迷,mamicode.com
首页 > 其他好文 > 详细

k8s实战

时间:2017-10-06 16:57:34      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:got   upd   points   cat   contain   brctl   mtu   core   manage   

wget https://github.com/coreos/etcd/releases/download/v2.2.0/etcd-v2.2.0-linux-amd64.tar.gz

etcd -name etcd  -data-dir /var/lib/etcd -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 -advertise-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 >> /var/log/etcd.log 2>&1 &

[root@mhc1 etcd-v2.2.0-linux-amd64]# etcdctl -C http://etcd:4001 cluster-health
member ce2a822cea30bfca is healthy: got healthy result from http://0.0.0.0:2379
cluster is healthy

 

wget https://github.com/kubernetes/kubernetes/releases/download/v1.1.1/kubernetes.tar.gz

 ./kube-apiserver --logtostderr --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 >> /var/log/kube-apiserver.log 2>&1 &

./kube-controller-manager --logtostderr --v=0 --master=http://kube-master:8080 >> /var/log/kube-controller-manager.log 2>&1 &

./kube-scheduler --logtostderr --v=0 --master=http://kube-master:8080 >> /var/log/kube-scheduler.log 2>&1 &

 

 

./kubelet --logtostderr=true --v=0 --config=/etc/kubernetes/manigests --address=0.0.0.0 --api-servers=http://kube-master:8080 >> /var/log/kubelet.log 2>&1 &

./kube-proxy --logtostderr --v=0 --master=http://kube-master:8080 >> /var/log/kube-proxy.log 2>&1

 

wget https://github.com/coreos/flannel/releases/download/v0.5.4/flannel-0.5.4-linux-amd64.tar.gz

flanneld -etcd-endpoints=http://etcd:4001 >> /var/log/flanneld.log 2>&1 &

[root@mhc flannel-0.5.4]# iptables -t nat -F
[root@mhc flannel-0.5.4]# ifconfig docker0 down
[root@mhc flannel-0.5.4]# brctl delbr docker0
[root@mhc flannel-0.5.4]# source /run/flannel/subnet.env

[root@mhc sysconfig]# echo $FLANNEL_SUBNET
10.0.54.1/24
[root@mhc sysconfig]# echo ${FLANNEL_MTU}
1472

[root@mhc sysconfig]# vim /lib/systemd/system/docker.service

[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target
Wants=docker-storage-setup.service
Requires=docker-cleanup.timer

[Service]
Type=notify
NotifyAccess=all
EnvironmentFile=-/run/containers/registries.conf
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash
Environment=DOCKER_HTTP_HOST_COMPAT=1
Environment=PATH=/usr/libexec/docker:/usr/bin:/usr/sbin
ExecStart=/usr/bin/dockerd-current \
--add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \
--default-runtime=docker-runc \
--exec-opt native.cgroupdriver=systemd \
--userland-proxy-path=/usr/libexec/docker/docker-proxy-current \
$OPTIONS \
$DOCKER_STORAGE_OPTIONS \
$DOCKER_NETWORK_OPTIONS \
$ADD_REGISTRY \
$BLOCK_REGISTRY \
$INSECURE_REGISTRY\
$REGISTRIES \
-H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 \
--bip=10.0.54.1/24 --mtu=1472

 

[root@mhc sysconfig]# systemctl daemon-reload
[root@mhc sysconfig]# systemctl restart docker.service

 

k8s实战

标签:got   upd   points   cat   contain   brctl   mtu   core   manage   

原文地址:http://www.cnblogs.com/mhc-fly/p/7631701.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!