mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-16 02:30:03 -03:30
add crio registry mirror support (#6977)
* add crio registry mirror support * mdlint fix
This commit is contained in:
@@ -14,6 +14,19 @@ crio_registries: []
|
||||
# Configure insecure registries.
|
||||
crio_insecure_registries: []
|
||||
|
||||
# Define registiries mirror
|
||||
|
||||
crio_registries_mirrors: []
|
||||
# - prefix: docker.io
|
||||
# insecure: false
|
||||
# blocked: false
|
||||
# location: registry-1.docker.io
|
||||
# mirrors:
|
||||
# - location: 172.20.100.52:5000
|
||||
# insecure: true
|
||||
# - location: mirror.gcr.io
|
||||
# insecure: false
|
||||
|
||||
crio_seccomp_profile: ""
|
||||
crio_selinux: "{{ (preinstall_selinux_state == 'enforcing')|lower }}"
|
||||
crio_signature_policy: "{% if ansible_os_family == 'ClearLinux' %}/usr/share/defaults/crio/policy.json{% endif %}"
|
||||
|
||||
@@ -145,6 +145,20 @@
|
||||
- ansible_distribution == "CentOS"
|
||||
- ansible_distribution_major_version == "7"
|
||||
|
||||
- name: Create directory registries configs
|
||||
file:
|
||||
path: /etc/containers/registries.conf.d
|
||||
state: directory
|
||||
owner: root
|
||||
mode: 0755
|
||||
|
||||
- name: Write registries mirror configs
|
||||
template:
|
||||
src: registry-mirror.conf.j2
|
||||
dest: "/etc/containers/registries.conf.d/{{ item.prefix }}.conf"
|
||||
loop: "{{ crio_registries_mirrors }}"
|
||||
notify: restart crio
|
||||
|
||||
- name: Write cri-o proxy drop-in
|
||||
template:
|
||||
src: http-proxy.conf.j2
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
[[registry]]
|
||||
prefix = "{{ item.prefix }}"
|
||||
insecure = {{ item.insecure | d('false') | string | lower }}
|
||||
blocked = {{ item.blocked | d('false') | string | lower }}
|
||||
location = "{{ item.location | d(item.prefix) }}"
|
||||
{% for mirror in item.mirrors %}
|
||||
|
||||
[[registry.mirror]]
|
||||
location = "{{ mirror.location }}"
|
||||
insecure = {{ mirror.insecure | d ('false') | string | lower }}
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user