您的位置:首页 > 其它

K8S 1.9.0二进制包部署(一)

2018-02-05 14:29 351 查看
master 192.168.254.53
node1 192.168.254.54
node2 192.168.254.55

版本信息:
k8s V1.9.0 下载https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.9.md
etcd v3.2.10
flannel v0.9.0
docker 17.05.0-ce

systemctl disable firewalld
systemctl stop firewalld

1、安装docker

先更新yum源,这里用163的源
yum install -y wget
cd /etc/yum.repos.d
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
/usr/bin/yum clean all
/usr/bin/yum makecache
更新系统
yum update
编辑生成docker的yum源
tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
查看版本
yum info docker-engine
yum install docker-engine -y

systemctl enable docker.service
systemctl start docker.service
systemctl status docker.service

2、etcd

cp etcd etcdctl /usr/bin
chmod 755 /usr/bin/etcd
chmod 755 /usr/bin/etcdctl
mkdir -p /app/etcd/data
mkdir -p /app/etcd/conf

vi /usr/lib/systemd/system/etcd.service
[Unit]
Description=Etcd Server
After=network.target
[Service]
Type=notify
WorkingDirectory=/app/etcd/data
EnvironmentFile=/app/etcd/conf/etcd.conf
ExecStart=/usr/bin/etcd
[Install]
WantedBy=multi-user.target

vi /app/etcd/conf/etcd.conf
ETCD_NAME=default
ETCD_DATA_DIR="/app/etcd/data/default.etcd"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379,http://0.0.0.0:4001";
ETCD_ADVERTISE_CLIENT_URLS="http://0.0.0.0:2379,http://0.0.0.0:4001";

systemctl daemon-reload
systemctl enable etcd.service
systemctl start etcd.service
systemctl status etcd.service

etcdctl --version
etcdctl cluster-health
etcdctl -C http://localhost:2379 cluster-health
curl -L http://localhost:2379/health
[root@testapp3 ~]# etcdctl set testkey "hello world"
hello world
[root@testapp3 ~]# etcdctl get testkey
hello world
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  k8s 二进制