Skip to content

Commit

Permalink
chore: upgrade existing kustomizations to v5
Browse files Browse the repository at this point in the history
After upgrading the version of kustomize we use we need to upgrade our
kustomization.yaml files to v5 format.

Signed-off-by: Richard Case <[email protected]>
  • Loading branch information
richardcase committed Oct 18, 2024
1 parent b812b70 commit 44f630b
Show file tree
Hide file tree
Showing 30 changed files with 256 additions and 210 deletions.
6 changes: 2 additions & 4 deletions hack/gen-test-flavors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ mkdir -p "${generated_dir}"

# Ignore non kustomized
find "${src_dir}"* -maxdepth 1 -type d \
-print0 | xargs -0 -I {} basename {} | grep -vx -E '(patches|addons|cni|csi|ccm|base)' | xargs -t -I {} ${kustomize} build --load-restrictor LoadRestrictionsNone --reorder none ${src_dir}{} -o ${generated_dir}/cluster-template-{}.yaml

-print0 | xargs -0 -I {} basename {} | grep -vx -E '(patches|addons|cni|csi|ccm|base)' | xargs -t -I {} ${kustomize} build --load-restrictor LoadRestrictionsNone ${src_dir}{} -o ${generated_dir}/cluster-template-{}.yaml

## move the default template to the default file expected by clusterctl in case of withoutclusterclass
if [ "${sub_dir_path}" == "withoutclusterclass" ]
then
if [ "${sub_dir_path}" == "withoutclusterclass" ]; then
mv "${generated_dir}/cluster-template-default.yaml" "${generated_dir}/cluster-template.yaml"
fi
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
resources:
- ../topology/cluster-template.yaml
- ../topology/cluster-template.yaml
patches:
- path: ./byo-infra-variables.yaml
target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
- path: ./limited-az-variable.yaml
target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
- path: ./byo-infra-variables.yaml
target:
group: cluster.x-k8s.io
kind: Cluster
version: v1beta1
- path: ./limited-az-variable.yaml
target:
group: cluster.x-k8s.io
kind: Cluster
version: v1beta1
configMapGenerator:
- name: cloud-controller-manager-addon
files:
- ../../..//withoutclusterclass/kustomize_sources/addons/ccm/data/aws-ccm-external.yaml
- name: aws-ebs-csi-driver-addon
files:
- ../../../withoutclusterclass/kustomize_sources/addons/csi/data/aws-ebs-csi-external.yaml
- files:
- ../../..//withoutclusterclass/kustomize_sources/addons/ccm/data/aws-ccm-external.yaml
name: cloud-controller-manager-addon
- files:
- ../../../withoutclusterclass/kustomize_sources/addons/csi/data/aws-ebs-csi-external.yaml
name: aws-ebs-csi-driver-addon
generatorOptions:
annotations:
note: generated
disableNameSuffixHash: true
labels:
type: generated
annotations:
note: generated


apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
resources:
- cluster-template.yaml
- role.yaml
- cluster-template.yaml
- role.yaml
configMapGenerator:
- name: cloud-controller-manager-addon
files:
- ../../../withoutclusterclass/kustomize_sources/addons/ccm/data/aws-ccm-external.yaml
- name: aws-ebs-csi-driver-addon
files:
- ../../../withoutclusterclass/kustomize_sources/addons/csi/data/aws-ebs-csi-external.yaml
- files:
- ../../../withoutclusterclass/kustomize_sources/addons/ccm/data/aws-ccm-external.yaml
name: cloud-controller-manager-addon
- files:
- ../../../withoutclusterclass/kustomize_sources/addons/csi/data/aws-ebs-csi-external.yaml
name: aws-ebs-csi-driver-addon
generatorOptions:
annotations:
note: generated
disableNameSuffixHash: true
labels:
type: generated
annotations:
note: generated
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
resources:
- ../topology/cluster-template.yaml
- ../topology/cluster-template.yaml
patches:
- path: ./self-hosted-variable.yaml
target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
- path: ./limited-az-variable.yaml
target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
- path: ./self-hosted-variable.yaml
target:
group: cluster.x-k8s.io
kind: Cluster
version: v1beta1
- path: ./limited-az-variable.yaml
target:
group: cluster.x-k8s.io
kind: Cluster
version: v1beta1
configMapGenerator:
- name: cloud-controller-manager-addon
files:
- ../../..//withoutclusterclass/kustomize_sources/addons/ccm/data/aws-ccm-external.yaml
- name: aws-ebs-csi-driver-addon
files:
- ../../../withoutclusterclass/kustomize_sources/addons/csi/data/aws-ebs-csi-external.yaml
- files:
- ../../..//withoutclusterclass/kustomize_sources/addons/ccm/data/aws-ccm-external.yaml
name: cloud-controller-manager-addon
- files:
- ../../../withoutclusterclass/kustomize_sources/addons/csi/data/aws-ebs-csi-external.yaml
name: aws-ebs-csi-driver-addon
generatorOptions:
annotations:
note: generated
disableNameSuffixHash: true
labels:
type: generated
annotations:
note: generated
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
resources:
- cluster-template.yaml
- cluster-template.yaml
configMapGenerator:
- name: cloud-controller-manager-addon
files:
- ../../..//withoutclusterclass/kustomize_sources/addons/ccm/data/aws-ccm-external.yaml
- name: aws-ebs-csi-driver-addon
files:
- ../../../withoutclusterclass/kustomize_sources/addons/csi/data/aws-ebs-csi-external.yaml
- files:
- ../../..//withoutclusterclass/kustomize_sources/addons/ccm/data/aws-ccm-external.yaml
name: cloud-controller-manager-addon
- files:
- ../../../withoutclusterclass/kustomize_sources/addons/csi/data/aws-ebs-csi-external.yaml
name: aws-ebs-csi-driver-addon
generatorOptions:
annotations:
note: generated
disableNameSuffixHash: true
labels:
type: generated
annotations:
note: generated

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster-template.yaml
- cluster-template.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
resources:
- ../intree-cloud-provider
patchesStrategicMerge:
- patches/csimigration-off.yaml
- ../intree-cloud-provider
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- path: patches/csimigration-off.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# default template enables external ccm and csi
resources:
- ../base
- machine-deployment.yaml
- ../addons/cni/resources/cni-resource-set.yaml
- ../addons/ccm/resources/ccm-resource-set.yaml
- ../addons/csi/resources/csi-resource-set.yaml
patchesStrategicMerge:
- ../addons/cni/patches/cluster-cni.yaml
- ../addons/ccm/patches/external-cloud-provider.yaml
- ../addons/csi/patches/external-csi-provider.yaml
- ../base
- machine-deployment.yaml
- ../addons/cni/resources/cni-resource-set.yaml
- ../addons/ccm/resources/ccm-resource-set.yaml
- ../addons/csi/resources/csi-resource-set.yaml
configMapGenerator:
- name: cloud-controller-manager-addon
files:
- ../addons/ccm/data/aws-ccm-external.yaml
- name: aws-ebs-csi-driver-addon
files:
- ../addons/csi/data/aws-ebs-csi-external.yaml
- files:
- ../addons/ccm/data/aws-ccm-external.yaml
name: cloud-controller-manager-addon
- files:
- ../addons/csi/data/aws-ebs-csi-external.yaml
name: aws-ebs-csi-driver-addon
generatorOptions:
annotations:
note: generated
disableNameSuffixHash: true
labels:
type: generated
annotations:
note: generated

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- path: ../addons/cni/patches/cluster-cni.yaml
- path: ../addons/ccm/patches/external-cloud-provider.yaml
- path: ../addons/csi/patches/external-csi-provider.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
resources:
- ../base
- machine-deployment.yaml
- ../addons/cni/resources/cni-resource-set.yaml
- ../addons/ccm/resources/ccm-resource-set.yaml
- csi-resource-set.yaml
patchesStrategicMerge:
- ../addons/cni/patches/cluster-cni.yaml
- ../addons/ccm/patches/external-cloud-provider.yaml
- patches/efs-support.yaml
- patches/limit-az.yaml
- ../base
- machine-deployment.yaml
- ../addons/cni/resources/cni-resource-set.yaml
- ../addons/ccm/resources/ccm-resource-set.yaml
- csi-resource-set.yaml
configMapGenerator:
- name: cloud-controller-manager-addon
files:
- ../addons/ccm/data/aws-ccm-external.yaml
- name: aws-efs-csi-driver-addon
files:
- aws-efs-csi-external.yaml
- files:
- ../addons/ccm/data/aws-ccm-external.yaml
name: cloud-controller-manager-addon
- files:
- aws-efs-csi-external.yaml
name: aws-efs-csi-driver-addon
generatorOptions:
annotations:
note: generated
disableNameSuffixHash: true
labels:
type: generated
annotations:
note: generated

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- path: ../addons/cni/patches/cluster-cni.yaml
- path: ../addons/ccm/patches/external-cloud-provider.yaml
- path: patches/efs-support.yaml
- path: patches/limit-az.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# internal ccm and external csi installed
resources:
- ../intree-cloud-provider
- ../addons/csi/resources/csi-resource-set.yaml
patchesStrategicMerge:
- ../addons/csi/patches/external-csi-provider.yaml
- ../intree-cloud-provider
- ../addons/csi/resources/csi-resource-set.yaml
configMapGenerator:
- name: aws-ebs-csi-driver-addon
files:
- ../addons/csi/data/aws-ebs-csi-external.yaml
- files:
- ../addons/csi/data/aws-ebs-csi-external.yaml
name: aws-ebs-csi-driver-addon
generatorOptions:
annotations:
note: generated
disableNameSuffixHash: true
labels:
type: generated
annotations:
note: generated
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- path: ../addons/csi/patches/external-csi-provider.yaml
Empty file.
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
resources:
- ../default
- gpu-resource-set.yaml
patchesStrategicMerge:
- patches/gpu-label.yaml
- patches/gpu-instance-type.yaml
- ../default
- gpu-resource-set.yaml
configMapGenerator:
- name: nvidia-clusterpolicy-crd
files:
- clusterpolicy-crd.yaml
- name: nvidia-gpu-operator-components
files:
- gpu-operator-components.yaml
- files:
- clusterpolicy-crd.yaml
name: nvidia-clusterpolicy-crd
- files:
- gpu-operator-components.yaml
name: nvidia-gpu-operator-components
generatorOptions:
annotations:
note: generated
disableNameSuffixHash: true
labels:
type: generated
annotations:
note: generated
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- path: patches/gpu-label.yaml
- path: patches/gpu-instance-type.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
resources:
- ../default
patchesStrategicMerge:
- patches/control-plane-ami.yaml
- patches/control-plane-ignition.yaml
- patches/s3bucket.yaml
- patches/worker-ami.yaml
- patches/worker-ignition.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- path: patches/control-plane-ami.yaml
- path: patches/control-plane-ignition.yaml
- path: patches/s3bucket.yaml
- path: patches/worker-ami.yaml
- path: patches/worker-ignition.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
resources:
- ../remote-management-cluster
patchesStrategicMerge:
- patches/internal-elb.yaml
- patches/az-select.yaml

- ../remote-management-cluster
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- path: patches/internal-elb.yaml
- path: patches/az-select.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
resources:
- ../base
- machine-deployment.yaml
- ../addons/cni/resources/cni-resource-set.yaml
patchesStrategicMerge:
- ../addons/cni/patches/cluster-cni.yaml
- ../base
- machine-deployment.yaml
- ../addons/cni/resources/cni-resource-set.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- path: ../addons/cni/patches/cluster-cni.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
resources:
- ../limit-az
- mhc.yaml
- ../limit-az
- mhc.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Loading

0 comments on commit 44f630b

Please sign in to comment.