diff --git a/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/clusterapi.yml b/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/clusterapi.yml index 75830cb..575fe15 100644 --- a/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/clusterapi.yml +++ b/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/clusterapi.yml @@ -61,6 +61,9 @@ network: fqdn: "{{ vapp['metacluster.fqdn'] }}" dnsserver: "{{ vapp['guestinfo.dnsserver'] }}" + nodesize: + cpu: "{{ config.clusterapi.size_matrix[ vapp['workloadcluster.nodesize'] ].cpu }}" + memory: "{{ config.clusterapi.size_matrix[ vapp['workloadcluster.nodesize'] ].memory }}" rootca: "{{ stepca_cm_certs.resources[0].data['root_ca.crt'] }}" runcmds: - update-ca-certificates diff --git a/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.cluster-template.j2 b/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.cluster-template.j2 index d7734bb..f273815 100644 --- a/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.cluster-template.j2 +++ b/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.cluster-template.j2 @@ -221,6 +221,18 @@ patchesJson6902: path: /spec/controlPlaneRef/name value: ${CLUSTER_NAME}-master + - target: + group: infrastructure.cluster.x-k8s.io + version: v1beta1 + kind: VSphereMachineTemplate + name: \${CLUSTER_NAME}-worker + patch: |- + - op: replace + path: /spec/template/spec/numCPUs + value: {{ _template.nodesize.cpu }} + - op: replace + path: /spec/template/spec/memoryMiB + value: {{ _template.nodesize.memory }} - target: group: cluster.x-k8s.io version: v1beta1 diff --git a/ansible/roles/firstboot/files/ansible_payload/common/vars/defaults.yml b/ansible/roles/firstboot/files/ansible_payload/common/vars/defaults.yml index c3b1df9..3d2b32c 100644 --- a/ansible/roles/firstboot/files/ansible_payload/common/vars/defaults.yml +++ b/ansible/roles/firstboot/files/ansible_payload/common/vars/defaults.yml @@ -8,3 +8,16 @@ playbook: # This default value is updated during the playbook, based on an I/O intensive operation storage_benchmark: 30 + +config: + clusterapi: + size_matrix: + small: + cpu: 2 + memory: 6144 + medium: + cpu: 4 + memory: 8192 + large: + cpu: 8 + memory: 16384 diff --git a/scripts/Update-OvfConfiguration.bootstrap.yml b/scripts/Update-OvfConfiguration.bootstrap.yml index 635dfea..8089d71 100644 --- a/scripts/Update-OvfConfiguration.bootstrap.yml +++ b/scripts/Update-OvfConfiguration.bootstrap.yml @@ -163,12 +163,13 @@ PropertyCategories: UserConfigurable: true - Key: workloadcluster.nodesize - Type: string["small", "medium"] + Type: string["small", "medium", "large"] Label: Workload-cluster node size* Description: | - All worker-nodes for the workload-cluster will be provisioned with number of cpu-cores and memory as specified: + All worker and worker-storage nodes for the workload-cluster will be provisioned with number of cpu-cores and memory as specified: - SMALL: 2 vCPU/6GB RAM - MEDIUM: 4 vCPU/8GB RAM + - LARGE: 8 vCPU/16GB RAM DefaultValue: 'small' Configurations: - cp1w1ws0