fix: add local registry cache for rebuilds
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
---
|
||||
k3s_registry_mirror_enabled: true
|
||||
k3s_registry_mirror_host: 10.27.27.239
|
||||
k3s_registry_mirrors:
|
||||
docker.io:
|
||||
port: 5000
|
||||
ghcr.io:
|
||||
port: 5001
|
||||
quay.io:
|
||||
port: 5002
|
||||
registry.k8s.io:
|
||||
port: 5003
|
||||
oci.external-secrets.io:
|
||||
port: 5004
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: Ensure k3s config directory exists
|
||||
file:
|
||||
path: /etc/rancher/k3s
|
||||
state: directory
|
||||
mode: "0755"
|
||||
when: k3s_registry_mirror_enabled | bool
|
||||
|
||||
- name: Configure k3s registry mirrors
|
||||
template:
|
||||
src: registries.yaml.j2
|
||||
dest: /etc/rancher/k3s/registries.yaml
|
||||
mode: "0644"
|
||||
when: k3s_registry_mirror_enabled | bool
|
||||
|
||||
- name: Remove k3s registry mirror config when disabled
|
||||
file:
|
||||
path: /etc/rancher/k3s/registries.yaml
|
||||
state: absent
|
||||
when: not (k3s_registry_mirror_enabled | bool)
|
||||
@@ -0,0 +1,6 @@
|
||||
mirrors:
|
||||
{% for registry, mirror in k3s_registry_mirrors.items() %}
|
||||
"{{ registry }}":
|
||||
endpoint:
|
||||
- "http://{{ k3s_registry_mirror_host }}:{{ mirror.port }}"
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user