add containerd config_path
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
This commit is contained in:
parent
f8d6b54dbb
commit
447da7bed8
2 changed files with 31 additions and 0 deletions
|
@ -56,6 +56,15 @@
|
||||||
- containerd-shim-runc-v2
|
- containerd-shim-runc-v2
|
||||||
- ctr
|
- ctr
|
||||||
|
|
||||||
|
- name: containerd | Create certs.d directories
|
||||||
|
file:
|
||||||
|
path: "{{ containerd_cfg_dir }}/{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
with_items:
|
||||||
|
- certs.d
|
||||||
|
run_once: true
|
||||||
|
|
||||||
- name: containerd | Generate systemd service for containerd
|
- name: containerd | Generate systemd service for containerd
|
||||||
template:
|
template:
|
||||||
src: containerd.service.j2
|
src: containerd.service.j2
|
||||||
|
@ -111,6 +120,27 @@
|
||||||
mode: 0640
|
mode: 0640
|
||||||
notify: restart containerd
|
notify: restart containerd
|
||||||
|
|
||||||
|
- name: containerd | Create registry directories
|
||||||
|
file:
|
||||||
|
path: "{{ containerd_cfg_dir }}/certs.d/{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
with_items: "{{ containerd_insecure_registries }}"
|
||||||
|
run_once: true
|
||||||
|
|
||||||
|
- name: containerd | Write hosts.toml file
|
||||||
|
blockinfile:
|
||||||
|
path: "{{ containerd_cfg_dir }}/certs.d/{{ item }}/hosts.toml"
|
||||||
|
owner: "root"
|
||||||
|
mode: 0640
|
||||||
|
create: true
|
||||||
|
block: |
|
||||||
|
server = "https://{{ item }}"
|
||||||
|
[host."https://{{ item }}"]
|
||||||
|
capabilities = ["pull", "resolve", "push"]
|
||||||
|
skip_verify = true
|
||||||
|
with_items: "{{ containerd_insecure_registries }}"
|
||||||
|
|
||||||
# you can sometimes end up in a state where everything is installed
|
# you can sometimes end up in a state where everything is installed
|
||||||
# but containerd was not started / enabled
|
# but containerd was not started / enabled
|
||||||
- name: containerd | Flush handlers
|
- name: containerd | Flush handlers
|
||||||
|
|
|
@ -47,6 +47,7 @@ oom_score = {{ containerd_oom_score }}
|
||||||
runtime_type = "io.containerd.runsc.v1"
|
runtime_type = "io.containerd.runsc.v1"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
[plugins."io.containerd.grpc.v1.cri".registry]
|
[plugins."io.containerd.grpc.v1.cri".registry]
|
||||||
|
config_path = "{{ containerd_cfg_dir }}/certs.d"
|
||||||
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
|
||||||
{% for registry, addr in containerd_registries.items() %}
|
{% for registry, addr in containerd_registries.items() %}
|
||||||
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ registry }}"]
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ registry }}"]
|
||||||
|
|
Loading…
Reference in a new issue