From f68189e3b72762a56a50bcbba889552a993cc783 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Sun, 4 Dec 2022 11:22:17 +0100 Subject: [PATCH] Include IPAM in-cluster provider --- ansible/roles/assets/tasks/manifests.yml | 5 +++++ .../roles/workloadcluster/tasks/clusterapi.yml | 9 ++++++++- .../files/ansible_payload/templates/clusterctl.j2 | 3 +++ ansible/vars/metacluster.yml | 5 +++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ansible/roles/assets/tasks/manifests.yml b/ansible/roles/assets/tasks/manifests.yml index b809c78..5202f75 100644 --- a/ansible/roles/assets/tasks/manifests.yml +++ b/ansible/roles/assets/tasks/manifests.yml @@ -47,6 +47,11 @@ # Finally, workload clusters will need a CNI plugin - url: https://raw.githubusercontent.com/projectcalico/calico/{{ components.clusterapi.workload.version.calico }}/manifests/calico.yaml dest: cni-calico/{{ components.clusterapi.workload.version.calico }}/calico.yaml + # IPAM in-cluster provider (w/ metadata.yaml) + - url: https://github.com/telekom/cluster-api-ipam-provider-in-cluster/releases/download/{{ components.clusterapi.management.version.ipam_incluster }}/ipam-components.yaml + dest: ipam-incluster/{{ components.clusterapi.management.version.ipam_incluster }}/ipam-components.yaml + - url: https://github.com/telekom/cluster-api-ipam-provider-in-cluster/releases/download/{{ components.clusterapi.management.version.ipam_incluster }}/metadata.yaml + dest: ipam-incluster/{{ components.clusterapi.management.version.ipam_incluster }}/metadata.yaml loop_control: label: "{{ item.url | basename }}" retries: 5 diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml index 456ad31..8801f8b 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml @@ -8,6 +8,7 @@ base: "{{ components.clusterapi.management.version.base }}" cert_manager: "{{ components.clusterapi.management.version.cert_manager }}" infrastructure_vsphere: "{{ components.clusterapi.management.version.infrastructure_vsphere }}" + ipam_incluster: "{{ components.clusterapi.management.version.ipam_incluster }}" hv: fqdn: "{{ vapp['hv.fqdn'] }}" tlsthumbprint: "{{ tls_thumbprint.stdout }}" @@ -26,5 +27,11 @@ - name: Initialize Cluster API management cluster ansible.builtin.shell: - cmd: clusterctl init -v5 -i vsphere:{{ components.clusterapi.management.version.infrastructure_vsphere }} --config ./clusterctl.yaml --kubeconfig {{ kubeconfig.path }} + cmd: >- + clusterctl init \ + -v5 \ + --infrastructure vsphere:{{ components.clusterapi.management.version.infrastructure_vsphere }} \ + --ipam in-cluster:{{ components.clusterapi.management.version.ipam_incluster }} + --config ./clusterctl.yaml \ + --kubeconfig {{ kubeconfig.path }} chdir: /opt/metacluster/cluster-api diff --git a/ansible/roles/firstboot/files/ansible_payload/templates/clusterctl.j2 b/ansible/roles/firstboot/files/ansible_payload/templates/clusterctl.j2 index 201a361..9f603c7 100644 --- a/ansible/roles/firstboot/files/ansible_payload/templates/clusterctl.j2 +++ b/ansible/roles/firstboot/files/ansible_payload/templates/clusterctl.j2 @@ -11,6 +11,9 @@ providers: - name: "vsphere" 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" + type: "IPAMProvider" cert-manager: url: "/opt/metacluster/cluster-api/cert-manager/{{ _template.version.cert_manager }}/cert-manager.yaml" diff --git a/ansible/vars/metacluster.yml b/ansible/vars/metacluster.yml index 2d5dbe1..643d720 100644 --- a/ansible/vars/metacluster.yml +++ b/ansible/vars/metacluster.yml @@ -87,6 +87,7 @@ components: # Must match the version referenced at `components.cert-manager.helm.version` cert_manager: v1.10.1 infrastructure_vsphere: v1.5.0 + ipam_incluster: v0.1.0-alpha.1 workload: version: calico: v3.24.5 @@ -147,6 +148,10 @@ components: harborAdminPassword: "{{ vapp['guestinfo.rootpw'] }}" notary: enabled: false + persistence: + persistentVolumeClaim: + registry: + size: 25Gi longhorn: helm: