From 066ec9a967902c1f23ee530c54efbd370199917d Mon Sep 17 00:00:00 2001 From: djpbessems Date: Wed, 12 Jun 2024 22:10:16 +1000 Subject: [PATCH] chore: Remove redundant kustomize patch --- .../workloadcluster/tasks/clusterapi.yml | 2 +- .../kustomization.cluster-template.j2 | 62 ++++++++++--------- ...l.j2 => kustomization.longhorn-storage.j2} | 0 3 files changed, 35 insertions(+), 29 deletions(-) rename ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/{kustomization.nodepool.j2 => kustomization.longhorn-storage.j2} (100%) 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 52a842c..be2517f 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 @@ -172,7 +172,7 @@ - name: Generate nodepool kustomization manifest ansible.builtin.template: - src: kustomization.nodepool.j2 + src: kustomization.longhorn-storage.j2 dest: "{{ capi_clustermanifest.path }}/kustomization.yaml" vars: _template: 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 46f8e4f..5eca343 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 @@ -4,34 +4,6 @@ resources: - cluster-template.yaml patches: -- patch: |- - apiVersion: v1 - kind: Secret - metadata: - name: csi-vsphere-config - namespace: '${NAMESPACE}' - stringData: - data: | - apiVersion: v1 - kind: Secret - metadata: - name: csi-vsphere-config - namespace: kube-system - stringData: - csi-vsphere.conf: |+ - [Global] - insecure-flag = true - thumbprint = "${VSPHERE_TLS_THUMBPRINT}" - cluster-id = "${NAMESPACE}/${CLUSTER_NAME}" - - [VirtualCenter "${VSPHERE_SERVER}"] - user = "${VSPHERE_USERNAME}" - password = "${VSPHERE_PASSWORD}" - datacenters = "${VSPHERE_DATACENTER}" - - [Network] - public-network = "${VSPHERE_NETWORK}" - type: Opaque - patch: |- apiVersion: controlplane.cluster.x-k8s.io/v1beta1 kind: KubeadmControlPlane @@ -95,6 +67,7 @@ patches: spec: template: spec: + diskGiB: 60 network: devices: - dhcp4: false @@ -114,6 +87,7 @@ patches: spec: template: spec: + diskGiB: 60 network: devices: - dhcp4: false @@ -125,6 +99,25 @@ patches: - {{ _template.network.dnsserver }} networkName: '${VSPHERE_NETWORK}' +- target: + group: addons.cluster.x-k8s.io + version: v1beta1 + kind: ClusterResourceSet + name: \${CLUSTER_NAME}-crs-0 + patch: |- + - op: replace + path: /spec/resources + value: + - kind: Secret + name: cloud-controller-manager + - kind: Secret + name: cloud-provider-vsphere-credentials + - kind: ConfigMap + name: cpi-manifests + - op: add + path: /spec/strategy + value: Reconcile + - target: group: controlplane.cluster.x-k8s.io version: v1beta1 @@ -198,6 +191,8 @@ patches: - op: replace path: /metadata/name value: ${CLUSTER_NAME}-master + - op: remove + path: /spec/template/spec/thumbprint - target: group: controlplane.cluster.x-k8s.io version: v1beta1 @@ -237,6 +232,8 @@ patches: - op: replace path: /spec/template/spec/memoryMiB value: {{ _template.nodesize.memory }} + - op: remove + path: /spec/template/spec/thumbprint - target: group: cluster.x-k8s.io version: v1beta1 @@ -258,3 +255,12 @@ patches: - op: replace path: /metadata/name value: ${CLUSTER_NAME}-worker + +- target: + group: infrastructure.cluster.x-k8s.io + version: v1beta1 + kind: VSphereCluster + name: .* + patch: |- + - op: remove + path: /spec/thumbprint diff --git a/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.nodepool.j2 b/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.longhorn-storage.j2 similarity index 100% rename from ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.nodepool.j2 rename to ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.longhorn-storage.j2