K8S 1.9.0二进制包部署(四)

5、flannel

cp flanneld /usr/bin/
chmod 755 /usr/bin/flanneld
mkdir -p /app/flannel/conf/

vi /usr/lib/systemd/system/flanneld.service
[Unit]
Description=flanneld overlay address etcd agent
After=network.target
Before=docker.service
[Service]
Type=notify
EnvironmentFile=/app/flannel/conf/flanneld
ExecStart=/usr/bin/flanneld -etcd-endpoints=${FLANNEL_ETCD} ${FLANNEL_OPTIONS}
[Install]
RequiredBy=docker.service
WantedBy=multi-user.target

vi /app/flannel/conf/flanneld
FLANNEL_ETCD="http://192.168.254.53:2379" #此处输入集群master地址
FLANNEL_ETCD_KEY="/coreos.com/network"
FLANNEL_OPTIONS="-iface=ens32" #此处写网卡

以下两句只有master执行
etcdctl set /coreos.com/network/config ‘{"Network":"10.0.0.0/16","SubnetMin":"10.0.1.0","SubnetMax":"10.0.20.0"}‘
etcdctl get /coreos.com/network/config

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

./mk-docker-opts.sh -i
cat /run/flannel/subnet.env
cat /run/docker_opts.env
source /run/flannel/subnet.env

vim /run/flannel/subnet.env
把--ip-masq=false 改成 --ip-masq=true

vi /usr/lib/systemd/system/docker.service加入
EnvironmentFile=/run/flannel/subnet.env
两个参数:--bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}
ExecStart=/usr/bin/dockerd --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}

systemctl daemon-reload
systemctl restart docker
etcdctl ls /coreos.com/network/subnets
etcdctl get /coreos.com/network/subnets/10.0.8.0-24

flannel安装成功后 查看下docker 是否在flannel所在网段内。

创建 docker run -itd bbox1 busybox 测试ping 1、从容器到跨主机 2、从主机到容器 3、容器跨主机容器
容器内互相不能ping通,原因访问策略问题
所有节点执行
iptables -P FORWARD ACCEPT

参考http://blog.csdn.net/liukuan73/article/details/54897594
参考https://www.hi-linux.com/posts/30481.html

原文地址:http://blog.51cto.com/285534/2068964

时间: 2024-10-04 23:17:48

K8S 1.9.0二进制包部署(四)的相关文章

K8S 1.9.0二进制包部署(三)

4.k8s node#############kubelet cp kubelet /usr/bin/chmod 755 /usr/bin/kubeletmkdir -p /app/kubernetes/datamkdir -p /app/kubernetes/confmkdir -p /app/kubernetes/log vi /usr/lib/systemd/system/kubelet.service[Unit]Description=Kubernetes Kubelet ServerD

K8S 1.9.0二进制包部署(五)

6.dashboard v1.8.0在kubernetes目录下有src的压缩包,解压后在cluster/addons/dashboard 下有5个文件dashboard-controller.yaml dashboard-service.yaml dashboard-secret.yaml dashboard-rbac.yaml dashboard-configmap.yaml vim dashboard-controller.yaml修改红色部分添加 - --apiserver-host=h

Kubernetes 集群部署 ——二进制包

ETCD 二进制包地址:请添加链接描述 第一步:部署 master 先准备好两个脚本文件: 1.vim etcd-cert.sh ##定义ca证书: cat > ca-config.json <<EOF { "signing": { "default": { "expiry": "87600h" }, "profiles": { "www": { "expir

Centos7.5安装mysql5.7.24二进制包方式部署(keepalived+主从复制)

一.环境准备: 操作系统:CentOS Linux release 7.5.1804 (Core) mysql版本:mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz主库:172.16.8.247从库:172.16.8.249主机名:172.16.8.247 qas-zabbix-node01172.16.8.249 qas-zabbix-node02172.16.8.248 vip 二.mysql5.7安装及主从复制配置 主库:172.16.8.247从库:1

Centos7.5安装mysql5.7.24二进制包方式部署(主从复制)

一.环境准备: 操作系统:CentOS Linux release 7.5.1804 (Core) mysql版本:mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz主库:172.16.8.247从库:172.16.8.249主机名:172.16.8.247 qas-zabbix-node01172.16.8.249 qas-zabbix-node02 二.mysql5.7安装 主库:172.16.8.247从库:172.16.8.249数据安装参考:一.Cen

k8s1.13.0二进制部署-master节点(三)

部署apiserver 创建生成CSR的JSON配置文件 [[email protected] ssl]# vim kubernetes-csr.json { "CN": "kubernetes", "hosts": [ "127.0.0.1", "192.168.0.123", "192.168.0.124", "192.168.0.130", "10.0

二进制方式部署kubernetes 1.16.0

环境 操作系统:CentOS Linux release 7.7.1908 (Core) Kernel version:3.10.0-1062.1.1.el7.x86_64 工作系统:win10 on Ubuntu 19.04 ETCD 部署IP: 192.168.30.50 ETCD 版本: v3.4.1 kube-apiserver,kube-scheduler,kube-controller-manager 部署IP: 192.168.30.52 kubelet部署IP:192.168.3

k8s实践19:kubernetes二进制部署集群v1.12升级v1.15

1.升级前的版本 [[email protected] ~]# kubectl version Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.4", GitCommit:"5ca598b4ba5abb89bb773071ce452e33fb66339d", GitTreeState:"clean", BuildDa

Nginx部署文档(二进制包安装)

Nginx部署文档(二进制包安装) 创建时间:2016-06-27 修改时间:2017-03-04 修改时间:2017-03-06 文档目的2 基础知识2 常用命令2 系统环境2 操作步骤3 1. 安装依赖3 2. 安装nginx3 3. 启动nginx5 3. 关闭防火墙6 4. 修改生产环境配置6 常见问题7 问题一:报错"cp: `conf/koi-win' and `/usr/local/nginx/conf/koi-win' are the same file"7 问题二:[