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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tools/02.addnode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,22 @@
- { role: flannel, when: "CLUSTER_NETWORK == 'flannel'" }
- { role: kube-router, when: "CLUSTER_NETWORK == 'kube-router'" }
- { role: kube-ovn, when: "CLUSTER_NETWORK == 'kube-ovn'" }
tasks:
- name: 创建文件夹/opt/kube/images
file: dest=/opt/kube/images state=directory
- name: 推送07.cluster-addon.yml中的镜像包
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"
- 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'"