Commit 6ae68531 by tingweiwang

fix edgecore

1 parent dc67e840
...@@ -15,27 +15,29 @@ ...@@ -15,27 +15,29 @@
#- name: 拷贝生成kubeedge cloud 证书脚本 #- name: 拷贝生成kubeedge cloud 证书脚本
# copy: src=certgen.sh dest={{ KUBEEDGE_BASE }} # copy: src=certgen.sh dest={{ KUBEEDGE_BASE }}
- name: 分发并渲染证书脚本 - name: 分发并渲染证书脚本
template: src=certgen.sh.j2 dest={{ KUBEEDGE_BASE }}/certgen.sh mode=777 template: src=certgen.sh.j2 dest=/etc/kubeedge/certgen.sh mode=777
- name: 执行生成证书脚本 - name: 执行生成证书脚本
shell: sh {{ KUBEEDGE_BASE }}/certgen.sh stream shell: sh /etc/kubeedge/certgen.sh stream
- name: 设置cloud iptables - name: 设置cloud iptables
shell: iptables -t nat -A OUTPUT -p tcp --dport 10350 -j DNAT --to {{ MASTER_IP }}:10003 shell: iptables -t nat -A OUTPUT -p tcp --dport 10350 -j DNAT --to {{ MASTER_IP }}:10003
- name: 在k8s中创建设备模块以及设备CRD yaml文件 - name: 在k8s中创建设备模块以及设备CRD yaml文件
shell: kubectl apply -f /root/kubeedge/kubeedge/roles/cloud/files/device_crds_yaml/devices/ && kubectl apply -f /root/kubeedge/kubeedge/roles/cloud/files/device_crds_yaml/reliablesyncs/ shell: kubectl apply -f /root/kubeedge/roles/cloud/files/device_crds_yaml/devices/ && kubectl apply -f /root/kubeedge/roles/cloud/files/device_crds_yaml/reliablesyncs/
- name: 分发渲染配置cloud 配置文件 - name: 分发渲染配置cloud 配置文件
template: src=cloudcore.yaml.j2 dest={{ KUBEEDGE_BASE }}/config/cloudcore.yaml template: src=cloudcore.yaml.j2 dest=/etc/kubeedge/config/cloudcore.yaml
notify: restart cloudcore notify: restart cloudcore
- name: 分发cloud二进制文件 - name: 分发cloud二进制文件
copy: src=cloud/cloudcore dest={{ KUBEEDGE_BASE }}/bin/cloudcore mode=777 copy: src=cloud/cloudcore dest=/etc/kubeedge/bin/cloudcore mode=777
- name: 分发渲染cloud service服务文件 - name: 分发渲染cloud service服务文件
template: src=cloudcore.service.j2 dest=/lib/systemd/system/cloudcore.service mode=777 template: src=cloudcore.service.j2 dest=/lib/systemd/system/cloudcore.service mode=777
- name: 生效service
shell: systemctl daemon-reload
- name: 设置开启启动cloud service - name: 设置开启启动cloud service
service: name=cloudcore enabled=yes service: name=cloudcore enabled=yes
...@@ -4,7 +4,7 @@ Description=cloudcore.service ...@@ -4,7 +4,7 @@ Description=cloudcore.service
[Service] [Service]
Type=simple Type=simple
Restart=always Restart=always
ExecStart={{ KUBEEDGE_BASE }}/bin/cloudcore ExecStart=/etc/kubeedge/bin/cloudcore
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
--- ---
- name: restart edgecore - name: restart edgecore
service: name=edgecore state=restarted service: name=edgecore state=restarted
- name: restart mosquitto
service: name=mosquitto state=restarted
--- ---
- name: test - name: 分发deb包到node节点的tmp目录
template: src=edgecore.yaml.j2 dest=/root/edgecore.yaml copy: src=mosquitto/{{ item }} dest=/tmp/
with_items:
- libev4_1%3a4.22-1_amd64.deb
- libuv1_1.8.0-1_amd64.deb
- libwebsockets7_1.7.1-1_amd64.deb
- mosquitto_1.6.10-0mosquitto1~xenial1_amd64.deb
- name: 安装mqtt服务
shell: dpkg -i {{ item }}
with_items:
- /tmp/libev4_1%3a4.22-1_amd64.deb
- /tmp/libuv1_1.8.0-1_amd64.deb
- /tmp/libwebsockets7_1.7.1-1_amd64.deb
- /tmp/mosquitto_1.6.10-0mosquitto1~xenial1_amd64.deb
- name: 分发mosquitto port配置文件
template: src=moquuitto_port.conf.j2 dest=/etc/mosquitto/conf.d/port.conf
notify: restart mosquitto
- name: 启动mosquitto服务
service: name=mosquitto state=started enabled=yes
- name: 创建edge端配置目录
file: name={{ item }} state=directory
with_items:
- /etc/kubeedge//config/
- /etc/kubeedge/bin/
- name: 分发edgecore 二进制文件
copy: src=edgecore dest=/etc/kubeedge/bin/edgecore mode=777
- name: 分发渲染edgecore配置文件
template: src=edgecore.yaml.j2 dest=/etc/kubeedge/config/edgecore.yaml
notify: restart edgecore
- name: 渲染分发edge core service开启启动文件
template: src=edgecore.service.j2 dest=/lib/systemd/system/edgecore.service mode=777
- name: 启动edgecore服务
service: name=edgecore state=started enabled=yes
...@@ -4,7 +4,7 @@ Description=cloudcore.service ...@@ -4,7 +4,7 @@ Description=cloudcore.service
[Service] [Service]
Type=simple Type=simple
Restart=always Restart=always
ExecStart={{KUBEEDGE_BASE}}/edgecore #kubeedge安装目录,默认是/etc/kubeedge ExecStart=/etc/kubeedge/bin/edgecore #kubeedge安装目录,默认是/etc/kubeedge
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
MASTER_IP: 192.1681.137.201 MASTER_IP: 192.168.137.201
CLOUD_TOKEN: 08ce39b001305c78fcc96c3dceb65d9ab0b1ca8ff7fa2793f956b1c17af62fd7.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTUyODM0NjV9.b4HXawgbUCGr0FW-hvvWFEhK-O_CzxhPpQWrL80TcS4 CLOUD_TOKEN: f9041f024c967f98c338502446aecc3afb2f285724cd40a57ce75248d600d373.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTU1MTI4NjR9.M5tNrge_NeR8iV3qI4DyBbJ6MGogXaQurOwRMXzG4NU
SANDBOX_IMAGE: kubeedge/pause:3.1 SANDBOX_IMAGE: kubeedge/pause:3.1
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!