Commit dc67e840 by tingweiwang

fix cloud bug

1 parent 75cefbe1
---
- hosts: edge
remote_user: root
roles:
- edge
---
- name: restaer cloudcore
- name: restart cloudcore
service: name=cloudcore state=restarted
---
- name: restart edgecore
service: name=edgecore state=restarted
---
- name: 节点创建kubeedge以及k8s所需证书目录,配置目录
file: name={{ item }} state=directory
with_items:
- /etc/kubeedge/ca/
- /etc/kubeedge/certs/
- /etc/kubeedge/config/
- /etc/kubeedge/bin/
- /etc/kubernetes/pki/
- name: 将k8s ca证书软链接到k8s证书目录/etc/kubernetes/pki/
file: src=/opt/kubernetes/ssl/ca.pem dest=/etc/kubernetes/pki/ca.crt state=link
- name: 将k8s ca证书软链接到k8s证书目录/etc/kubernetes/pki/
file: src=/opt/kubernetes/ssl/ca-key.pem dest=/etc/kubernetes/pki/ca.key state=link
#- name: 拷贝生成kubeedge cloud 证书脚本
# copy: src=certgen.sh dest={{ KUBEEDGE_BASE }}
- name: 分发并渲染证书脚本
template: src=certgen.sh.j2 dest={{ KUBEEDGE_BASE }}/certgen.sh mode=777
- name: 执行生成证书脚本
shell: sh {{ KUBEEDGE_BASE }}/certgen.sh stream
- name: 设置cloud iptables
shell: iptables -t nat -A OUTPUT -p tcp --dport 10350 -j DNAT --to {{ MASTER_IP }}:10003
- 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/
- name: 分发渲染配置cloud 配置文件
template: src=cloudcore.yaml.j2 dest={{ KUBEEDGE_BASE }}/config/cloudcore.yaml
notify: restart cloudcore
- name: 分发cloud二进制文件
copy: src=cloud/cloudcore dest={{ KUBEEDGE_BASE }}/bin/cloudcore mode=777
- name: 分发渲染cloud service服务文件
template: src=cloudcore.service.j2 dest=/lib/systemd/system/cloudcore.service mode=777
- name: 设置开启启动cloud service
service: name=cloudcore enabled=yes
- name: test
template: src=edgecore.yaml.j2 dest=/root/edgecore.yaml
......@@ -29,9 +29,9 @@ modules:
devicePluginEnabled: false
dockerAddress: unix:///var/run/docker.sock
gpuPluginEnabled: false
hostnameOverride: ansible_nodename #内部变量,自动获取host为node节点的主机名
interfaceName: ansible_default_ipv4['interface'] #内部变量,自动获取host为node节点的内网网卡地址
nodeIP: ansible_default_ipv4['address'] #内部变量,自动获取host为node节点的内网IP地址
hostnameOverride: {{ ansible_nodename }} #内部变量,自动获取host为node节点的主机名
interfaceName: {{ ansible_default_ipv4['interface'] }} #内部变量,自动获取host为node节点的内网网卡地址
nodeIP: {{ ansible_default_ipv4['address'] }} #内部变量,自动获取host为node节点的内网IP地址
podSandboxImage: {{ SANDBOX_IMAGE}} #edge节点的pause镜像, 默认amd64是 kubeedge/pause:3.1,arm的需要查找
remoteImageEndpoint: unix:///var/run/dockershim.sock
remoteRuntimeEndpoint: unix:///var/run/dockershim.sock
......
NODE_NAME: {{ansible_all_ipv4_addresses}}
MASTER_IP: 192.1681.137.201
CLOUD_TOKEN: 08ce39b001305c78fcc96c3dceb65d9ab0b1ca8ff7fa2793f956b1c17af62fd7.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTUyODM0NjV9.b4HXawgbUCGr0FW-hvvWFEhK-O_CzxhPpQWrL80TcS4
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!