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

etcd TLS 部署 flanneld

时间:2019-05-29 14:49:36      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:doc   restart   服务   cert   使用   bug   lan   failure   sign   

1.首先使用cfssl 生成相关证书文件

参考 

https://coreos.com/os/docs/latest/generate-self-signed-certificates.html

 

2.etcd.service文件

[Unit]
Description=Etcd Server
[Service]
Type=notify
#WorkingDirectory=/home/etcd_data
#EnvironmentFile=-/root/etcd-v3.3.9-linux-amd64/etcd.conf
ExecStart=/root/etcd-v3.3.9-linux-amd64/etcd --name infra0         --initial-advertise-peer-urls https://xxx.xxx.xxx.xxx:2380         --listen-peer-urls https://xxx.xxx.xxx.xxx:2380         --listen-client-urls https://xxx.xxx.xxx.xxx:2379,https://127.0.0.1:2379         --advertise-client-urls https://xxx.xxx.xxx.xxx:2379         --initial-cluster infra0=https://xxx.xxx.xxx.xxx:2380,infra1=https://xxx.xxx.xxx.xxx:2380,infra2=https://xxx.xxx.xxx.xxx2380         --initial-cluster-token etcd-cluster-0         --initial-cluster-state new         --data-dir=/home/etcd_data         --debug=true         --client-cert-auth         --trusted-ca-file=/root/etcd_ssl/ca.pem        --cert-file=/root/etcd_ssl/server.pem         --key-file=/root/etcd_ssl/server-key.pem         --peer-client-cert-auth         --peer-trusted-ca-file=/root/etcd_ssl/ca.pem         --peer-cert-file=/root/etcd_ssl/infra0.pem         --peer-key-file=/root/etcd_ssl/infra0-key.pem

Restart=on-failure
RestartSec=5
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target

  

启动etcd服务

 

3. flanneld.service文件

[Unit]
Description=flannel
After=network.target
After=network-online.target
Wants=network-online.target
After=etcd.service
Before=docker.service
[Service]
ExecStart=/opt/flannel/flanneld --ip-masq=true --iface=eno1 --etcd-endpoints=https://xxx.xxx.xxx.xxx:2379,https://xx.xxx.xxx.xxx:2379,https://xx.xxx.xxx.xxx:2379 --etcd-keyfile=/root/etcd_ssl/client-key.pem --etcd-certfile=/root/etcd_ssl/client.pem --etcd-cafile=/root/etcd_ssl/ca.pem
[Install]
WantedBy=multi-user.target
RequiredBy=docker.service

  

4. 编写etcdctl_ssl 文件

ETCDCTL_API=2 ./etcdctl     --endpoints https://10.110.158.181:2379,https://10.110.158.182:2379,https://10.110.158.183:2379 --ca-file /root/etcd_ssl/ca.pem --cert-file  /root/etcd_ssl/client.pem  --key-file /root/etcd_ssl/client-key.pem  $@

  

etcd TLS 部署 flanneld

标签:doc   restart   服务   cert   使用   bug   lan   failure   sign   

原文地址:https://www.cnblogs.com/xuchenCN/p/10943436.html

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