-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Conversation
很有用的一个fix;感谢PR |
tools/02.addnode.yml
Outdated
@@ -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/ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样改的确传输文件的大小和执行时间都能少很多
tools/02.addnode.yml
Outdated
@@ -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: |
There was a problem hiding this comment.
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: 不管前面部分成功或者失败,都会被执行,这应该不是我们想要的
为了防止addone中推送的镜像在新的node中不存在,从而导致pod无法启动,推送所有镜像