Define registry mirrors dynamically;Fix path;Fix Ansible config
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -39,10 +39,26 @@
|
||||
loop_control:
|
||||
label: "{{ item | basename }}"
|
||||
|
||||
- name: Get all stored container images (=artifacts)
|
||||
ansible.builtin.uri:
|
||||
url: https://registry.{{ vapp['metacluster.fqdn'] }}/api/v2.0/search?q=library
|
||||
method: GET
|
||||
register: registry_artifacts
|
||||
|
||||
- name: Get source registries of all artifacts
|
||||
ansible.builtin.set_fact:
|
||||
source_registries: "{{ (source_registries | default([]) + [(item | split('/'))[1]]) | unique | sort }}"
|
||||
loop: "{{ registry_artifacts.json.repository | json_query('[*].repository_name') }}"
|
||||
|
||||
- name: Configure K3s node for private registry
|
||||
ansible.builtin.template:
|
||||
dest: /etc/rancher/k3s/registries.yaml
|
||||
src: registries.j2
|
||||
vars:
|
||||
_template:
|
||||
data: "{{ source_registries }}"
|
||||
hv:
|
||||
fqdn: "{{ vapp['metacluster.fqdn'] }}"
|
||||
|
||||
- name: Restart kubelet (k3s) to pick up configured registries
|
||||
ansible.builtin.systemd:
|
||||
|
@ -31,7 +31,7 @@
|
||||
clusterctl init \
|
||||
-v5 \
|
||||
--infrastructure vsphere:{{ components.clusterapi.management.version.infrastructure_vsphere }} \
|
||||
--ipam in-cluster:{{ components.clusterapi.management.version.ipam_incluster }}
|
||||
--ipam in-cluster:{{ components.clusterapi.management.version.ipam_incluster }} \
|
||||
--config ./clusterctl.yaml \
|
||||
--kubeconfig {{ kubeconfig.path }}
|
||||
chdir: /opt/metacluster/cluster-api
|
||||
|
@ -12,7 +12,7 @@ providers:
|
||||
url: "/opt/metacluster/cluster-api/infrastructure-vsphere/{{ _template.version.infrastructure_vsphere }}/infrastructure-components.yaml"
|
||||
type: "InfrastructureProvider"
|
||||
- name: "in-cluster"
|
||||
url: "/opt/metacluster/cluster-api/ipam-incluster/{{ _template.version.ipam_incluster }}/ipam-components.yaml"
|
||||
url: "/opt/metacluster/cluster-api/ipam-in-cluster/{{ _template.version.ipam_incluster }}/ipam-components.yaml"
|
||||
type: "IPAMProvider"
|
||||
|
||||
cert-manager:
|
||||
|
@ -1,31 +1,8 @@
|
||||
mirrors:
|
||||
cr.step.cm:
|
||||
{% for value in _template.data %}
|
||||
{{ value }}:
|
||||
endpoint:
|
||||
- https://registry.{{ vapp['metacluster.fqdn'] }}
|
||||
- https://registry.{{ _template.hv.fqdn }}
|
||||
rewrite:
|
||||
"(.*)": "library/cr.step.sm/$1"
|
||||
docker.io:
|
||||
endpoint:
|
||||
- https://registry.{{ vapp['metacluster.fqdn'] }}
|
||||
rewrite:
|
||||
"(.*)": "library/docker.io/$1"
|
||||
gcr.io:
|
||||
endpoint:
|
||||
- https://registry.{{ vapp['metacluster.fqdn'] }}
|
||||
rewrite:
|
||||
"(.*)": "library/gcr.io/$1"
|
||||
ghcr.io:
|
||||
endpoint:
|
||||
- https://registry.{{ vapp['metacluster.fqdn'] }}
|
||||
rewrite:
|
||||
"(.*)": "library/ghcr.io/$1"
|
||||
k8s.gcr.io:
|
||||
endpoint:
|
||||
- https://registry.{{ vapp['metacluster.fqdn'] }}
|
||||
rewrite:
|
||||
"(.*)": "library/k8s.gcr.io/$1"
|
||||
quay.io:
|
||||
endpoint:
|
||||
- https://registry.{{ vapp['metacluster.fqdn'] }}
|
||||
rewrite:
|
||||
"(.*)": "library/quay.io/$1"
|
||||
"(.*)": "library/{{ value }}/$1"
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user