Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装新node后推送所有镜像,防止某些镜像不存在 #650

Merged
merged 2 commits into from
Jul 26, 2019

Conversation

gj19910723
Copy link
Contributor

为了防止addone中推送的镜像在新的node中不存在,从而导致pod无法启动,推送所有镜像

@gjmzj
Copy link
Collaborator

gjmzj commented Jul 26, 2019

很有用的一个fix;感谢PR
最好需要稍微修改一下脚本

@@ -13,3 +13,14 @@
- { role: flannel, when: "CLUSTER_NETWORK == 'flannel'" }
- { role: kube-router, when: "CLUSTER_NETWORK == 'kube-router'" }
- { role: kube-ovn, when: "CLUSTER_NETWORK == 'kube-ovn'" }
post_tasks:
- name: 推送所有离线镜像包
copy: src={{ base_dir }}/down/ dest=/opt/kube/images/
Copy link
Collaborator

@gjmzj gjmzj Jul 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里把 down目录下都复制过去,东西太多了,里面还有离线系统包 packages,会导致执行时间长;
建议只复制需要的tar包即可:coredns*.tar dashboard*.tar heapster*.tar metrics*.tar traefik*.tar,参考如下

  - name: create images directory
    file: dest=/opt/kube/images state=directory
  - name: copy offline images
    copy: src={{ item }} dest=/opt/kube/images/
    with_fileglob:
      - "{{ base_dir }}/down/coredns*.tar"
      - "{{ base_dir }}/down/dashboard*.tar"
      - "{{ base_dir }}/down/heapster*.tar"
      - "{{ base_dir }}/down/metrics*.tar"
      - "{{ base_dir }}/down/traefik*.tar"
    ignore_errors: true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样改的确传输文件的大小和执行时间都能少很多

@@ -13,3 +13,14 @@
- { role: flannel, when: "CLUSTER_NETWORK == 'flannel'" }
- { role: kube-router, when: "CLUSTER_NETWORK == 'kube-router'" }
- { role: kube-ovn, when: "CLUSTER_NETWORK == 'kube-ovn'" }
post_tasks:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

post_tasks 建议改成 tasks
post_tasks: 不管前面部分成功或者失败,都会被执行,这应该不是我们想要的

@gjmzj gjmzj merged commit 1e66e7e into easzlab:dev2 Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants