-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. 这里把 down目录下都复制过去,东西太多了,里面还有离线系统包 packages,会导致执行时间长;
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这样改的确传输文件的大小和执行时间都能少很多 |
||
- name: 导入所有离线镜像 | ||
shell: ls /opt/kube/images/*.tar |while read n;do {{ bin_dir }}/docker load -i $n ;done | ||
ignore_errors: true | ||
when: "CONTAINER_RUNTIME == 'docker'" | ||
- name: 导入所有离线镜像 | ||
shell: ls /opt/kube/images/*.tar |while read n;do {{ bin_dir }}/ctr -n=k8s.io images import $n ;done | ||
ignore_errors: true | ||
when: "CONTAINER_RUNTIME == 'containerd'" |
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: 不管前面部分成功或者失败,都会被执行,这应该不是我们想要的