Add debugging;Fix readiness check;Create kubeadm registry project
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:
parent
0fd4cbb92f
commit
08a543e27f
@ -18,18 +18,25 @@
|
|||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: "{{ item.value.helm.parse_logic }}"
|
cmd: "{{ item.value.helm.parse_logic }}"
|
||||||
chdir: /opt/metacluster/helm-charts/{{ item.key }}
|
chdir: /opt/metacluster/helm-charts/{{ item.key }}
|
||||||
register: containerimages
|
register: chartimages
|
||||||
when: item.value.helm is defined
|
when: item.value.helm is defined
|
||||||
loop: "{{ lookup('ansible.builtin.dict', components) }}"
|
loop: "{{ lookup('ansible.builtin.dict', components) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.key }}"
|
label: "{{ item.key }}"
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
var: chartimages
|
||||||
|
- debug:
|
||||||
|
var: kubeadmimages
|
||||||
|
- debug:
|
||||||
|
var: parsedmanifests
|
||||||
|
|
||||||
- name: Store container images in dicts
|
- name: Store container images in dicts
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
containerimages_{{ item.source }}: "{{ item.results }}"
|
containerimages_{{ item.source }}: "{{ item.results }}"
|
||||||
loop:
|
loop:
|
||||||
- source: charts
|
- source: charts
|
||||||
results: "{{ containerimages | json_query('results[*].stdout_lines') | select() | flatten | list }}"
|
results: "{{ chartimages | json_query('results[*].stdout_lines') | select() | flatten | list }}"
|
||||||
- source: kubeadm
|
- source: kubeadm
|
||||||
results: "{{ kubeadmimages | json_query('results[*].stdout_lines') | select() | flatten | list }}"
|
results: "{{ kubeadmimages | json_query('results[*].stdout_lines') | select() | flatten | list }}"
|
||||||
- source: manifests
|
- source: manifests
|
||||||
@ -37,6 +44,13 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.source }}"
|
label: "{{ item.source }}"
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
var: containerimages_charts
|
||||||
|
- debug:
|
||||||
|
var: containerimages_kubeadm
|
||||||
|
- debug:
|
||||||
|
var: containerimages_manifests
|
||||||
|
|
||||||
- name: Pull and store containerimages
|
- name: Pull and store containerimages
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: >-
|
cmd: >-
|
||||||
|
@ -1,19 +1,26 @@
|
|||||||
- name: Install longhorn chart
|
- block:
|
||||||
kubernetes.core.helm:
|
- name: Install longhorn chart
|
||||||
name: longhorn
|
kubernetes.core.helm:
|
||||||
chart_ref: /opt/metacluster/helm-charts/longhorn
|
name: longhorn
|
||||||
release_namespace: longhorn-system
|
chart_ref: /opt/metacluster/helm-charts/longhorn
|
||||||
create_namespace: yes
|
release_namespace: longhorn-system
|
||||||
wait: no
|
create_namespace: yes
|
||||||
kubeconfig: "{{ kubeconfig.path }}"
|
wait: no
|
||||||
values: "{{ components.longhorn.chart_values }}"
|
kubeconfig: "{{ kubeconfig.path }}"
|
||||||
|
values: "{{ components.longhorn.chart_values }}"
|
||||||
|
|
||||||
- name: Ensure longhorn API availability
|
- name: Ensure longhorn API availability
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: https://storage.{{ vapp['metacluster.fqdn'] }}/v1
|
url: https://storage.{{ vapp['metacluster.fqdn'] }}/v1
|
||||||
method: GET
|
method: GET
|
||||||
register: api_readycheck
|
register: api_readycheck
|
||||||
until:
|
until:
|
||||||
- api_readycheck is not failed
|
- api_readycheck is not failed
|
||||||
retries: 5
|
retries: 5
|
||||||
delay: 30
|
delay: 30
|
||||||
|
|
||||||
|
module_defaults:
|
||||||
|
ansible.builtin.uri:
|
||||||
|
validate_certs: no
|
||||||
|
status_code: [200, 201]
|
||||||
|
body_format: json
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
clusterConfiguration:
|
||||||
|
imageRepository: registry.<fqdn>/library
|
||||||
|
|
||||||
files:
|
files:
|
||||||
- [...]
|
- [...]
|
||||||
- encoding: base64
|
- encoding: base64
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
- block:
|
||||||
|
|
||||||
|
- name: Create dedicated kubeadm project within container registry
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: https://registry.{{ vapp['metacluster.fqdn'] }}/api/v2.0/projects
|
||||||
|
method: POST
|
||||||
|
headers:
|
||||||
|
Authorization: "Basic {{ ('admin:' + vapp['metacluster.password']) | b64encode }}"
|
||||||
|
body:
|
||||||
|
project_name: kubeadm
|
||||||
|
public: true
|
||||||
|
storage_limit: 0
|
||||||
|
metadata:
|
||||||
|
enable_content_trust: 'false'
|
||||||
|
enable_content_trust_cosign: 'false'
|
||||||
|
auto_scan: 'true'
|
||||||
|
severity: none
|
||||||
|
prevent_vul: 'false'
|
||||||
|
public: 'true'
|
||||||
|
reuse_sys_cve_allowlist: 'true'
|
||||||
|
|
||||||
|
- name: Lookup kubeadm container images
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
kubeadm_images: "{{ lookup('ansible.builtin.file', '/opt/metacluster/cluster-api/imagelist').splitlines() }}"
|
||||||
|
|
||||||
|
# - name: Copy all stored rancher container images to dedicated project
|
||||||
|
# ansible.builtin.uri:
|
||||||
|
# url: https://registry.{{ vapp['metacluster.fqdn'] }}/api/v2.0/projects/kubeadm/repositories/{{ ( item | regex_findall('([^:/]+)') )[-2] }}/artifacts?from={{ item | replace('/', '%2F') | replace(':', '%3A') }}
|
||||||
|
# method: POST
|
||||||
|
# headers:
|
||||||
|
# Authorization: "Basic {{ ('admin:' + vapp['metacluster.password']) | b64encode }}"
|
||||||
|
# body:
|
||||||
|
# from: "{{ item }}"
|
||||||
|
# loop: "{{ kubeadm_images }}"
|
||||||
|
|
||||||
|
module_defaults:
|
||||||
|
ansible.builtin.uri:
|
||||||
|
validate_certs: no
|
||||||
|
status_code: [200, 201, 409]
|
||||||
|
body_format: json
|
Loading…
Reference in New Issue
Block a user