Rebase node templates;Switch to linked clones;Rename dictionary;Add debugging
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2022-11-08 08:54:33 +01:00
parent 5985615868
commit 8926b72344
4 changed files with 49 additions and 30 deletions

View File

@ -37,6 +37,17 @@
loop_control:
index_var: index
- name: Create snapshot on deployed VM's
community.vmware.vmware_guest_snapshot:
folder: "{{ vcenter_info.folder }}"
name: "{{ (item | basename | split('.'))[:-1] | join('.') }}"
state: present
snapshot_name: "{{ ansible_date_time..iso8601_basic_short }}-base"
loop: "{{ ova_deploy.results }}"
loop_control:
index_var: index
label: "{{ item.item }}"
- name: Mark deployed VM's as templates
community.vmware.vmware_guest:
name: "{{ item.instance.hw_name }}"

View File

@ -4,11 +4,11 @@
state: directory
loop:
- /opt/metacluster/helm-charts
- /opt/metacluster/manifests/bootstrap-kubeadm/{{ components.clusterapi.manifest.version.base }}
- /opt/metacluster/manifests/cert-manager/{{ components.clusterapi.manifest.version.cert_manager }}
- /opt/metacluster/manifests/cluster-api/{{ components.clusterapi.manifest.version.base }}
- /opt/metacluster/manifests/control-plane-kubeadm/{{ components.clusterapi.manifest.version.base }}
- /opt/metacluster/manifests/infrastructure-vsphere/{{ components.clusterapi.manifest.version.infrastructure_vsphere }}
- /opt/metacluster/manifests/bootstrap-kubeadm/{{ components.clusterapi.management.version.base }}
- /opt/metacluster/manifests/cert-manager/{{ components.clusterapi.management.version.cert_manager }}
- /opt/metacluster/manifests/cluster-api/{{ components.clusterapi.management.version.base }}
- /opt/metacluster/manifests/control-plane-kubeadm/{{ components.clusterapi.management.version.base }}
- /opt/metacluster/manifests/infrastructure-vsphere/{{ components.clusterapi.management.version.infrastructure_vsphere }}
- /opt/metacluster/container-images
- name: Add helm repositories
@ -37,6 +37,10 @@
loop_control:
label: "{{ item.key }}"
- debug:
msg: |
{{ { 'components': (chart_values + { 'clusterapi': components.clusterapi } ) } | to_nice_yaml(indent=2, width=4096) }}
- name: Write dict to vars_file
ansible.builtin.copy:
dest: /opt/firstboot/ansible/vars/metacluster.yml
@ -52,26 +56,26 @@
loop:
# This list is based on `clusterctl config repositories`
# Note: Each manifest also needs a metadata.yaml file stored in the respective folder
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.manifest.version.base }}/bootstrap-components.yaml
dest: bootstrap-kubeadm/{{ components.clusterapi.manifest.version.base }}/bootstrap-components.yaml
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.manifest.version.base }}/core-components.yaml
dest: cluster-api/{{ components.clusterapi.manifest.version.base }}/core-components.yaml
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.manifest.version.base }}/control-plane-components.yaml
dest: control-plane-kubeadm/{{ components.clusterapi.manifest.version.base }}/control-plane-components.yaml
- url: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{{ components.clusterapi.manifest.version.infrastructure_vsphere }}/infrastructure-components.yaml
dest: infrastructure-vsphere/{{ components.clusterapi.manifest.version.infrastructure_vsphere }}/infrastructure-components.yaml
- url: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{{ components.clusterapi.manifest.version.infrastructure_vsphere }}/metadata.yaml
dest: infrastructure-vsphere/{{ components.clusterapi.manifest.version.infrastructure_vsphere }}/metadata.yaml
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.management.version.base }}/bootstrap-components.yaml
dest: bootstrap-kubeadm/{{ components.clusterapi.management.version.base }}/bootstrap-components.yaml
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.management.version.base }}/core-components.yaml
dest: cluster-api/{{ components.clusterapi.management.version.base }}/core-components.yaml
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.management.version.base }}/control-plane-components.yaml
dest: control-plane-kubeadm/{{ components.clusterapi.management.version.base }}/control-plane-components.yaml
- url: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{{ components.clusterapi.management.version.infrastructure_vsphere }}/infrastructure-components.yaml
dest: infrastructure-vsphere/{{ components.clusterapi.management.version.infrastructure_vsphere }}/infrastructure-components.yaml
- url: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{{ components.clusterapi.management.version.infrastructure_vsphere }}/metadata.yaml
dest: infrastructure-vsphere/{{ components.clusterapi.management.version.infrastructure_vsphere }}/metadata.yaml
# This downloads the same metadata.yaml file to three separate folders
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.manifest.version.base }}/metadata.yaml
dest: bootstrap-kubeadm/{{ components.clusterapi.manifest.version.base }}/metadata.yaml
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.manifest.version.base }}/metadata.yaml
dest: cluster-api/{{ components.clusterapi.manifest.version.base }}/metadata.yaml
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.manifest.version.base }}/metadata.yaml
dest: control-plane-kubeadm/{{ components.clusterapi.manifest.version.base }}/metadata.yaml
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.management.version.base }}/metadata.yaml
dest: bootstrap-kubeadm/{{ components.clusterapi.management.version.base }}/metadata.yaml
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.management.version.base }}/metadata.yaml
dest: cluster-api/{{ components.clusterapi.management.version.base }}/metadata.yaml
- url: https://github.com/kubernetes-sigs/cluster-api/releases/download/{{ components.clusterapi.management.version.base }}/metadata.yaml
dest: control-plane-kubeadm/{{ components.clusterapi.management.version.base }}/metadata.yaml
# Additionally, cert-manager is a prerequisite
- url: https://github.com/cert-manager/cert-manager/releases/download/{{ components.clusterapi.manifest.version.cert_manager }}/cert-manager.yaml
dest: cert-manager/{{ components.clusterapi.manifest.version.cert_manager }}/cert-manager.yaml
- url: https://github.com/cert-manager/cert-manager/releases/download/{{ components.clusterapi.management.version.cert_manager }}/cert-manager.yaml
dest: cert-manager/{{ components.clusterapi.management.version.cert_manager }}/cert-manager.yaml
loop_control:
label: "{{ item.url | basename }}"
@ -94,9 +98,9 @@
vars:
_template:
version:
base: "{{ components.clusterapi.manifest.version.base }}"
cert_manager: "{{ components.clusterapi.manifest.version.cert_manager }}"
infrastructure_vsphere: "{{ components.clusterapi.manifest.version.infrastructure_vsphere }}"
base: "{{ components.clusterapi.management.version.base }}"
cert_manager: "{{ components.clusterapi.management.version.cert_manager }}"
infrastructure_vsphere: "{{ components.clusterapi.management.version.infrastructure_vsphere }}"
- name: Parse helm charts for container images
ansible.builtin.shell:

View File

@ -77,13 +77,16 @@ components:
# installCRDs: true
clusterapi:
manifest:
management:
version:
# Must match the version referenced at `dependencies.static_binaries[.filename==clusterctl].url`
base: v1.2.4
# Must match the version referenced at `components.cert-manager.helm.version`
cert_manager: v1.9.1
infrastructure_vsphere: v1.3.5
workload:
version:
k8s: v1.23.5
gitea:
helm:

View File

@ -1,7 +1,8 @@
downstream:
node_templates:
prefix: NodeTmpl_
prefix: ClusterAPITemplate_
images:
- url: https://stable.release.flatcar-linux.net/amd64-usr/3227.2.0/flatcar_production_vmware_ova.ova
name: flatcar.ova
# Refer to `https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/v1.3.5/README.md#kubernetes-versions-with-published-ovas` for a list of supported node templates
- url: https://storage.googleapis.com/capv-images/release/v1.23.5/ubuntu-2004-kube-v1.23.5.ova
name: ubuntu-2004-kube-v1.23.5.ova