s0x IT Services Cloud Kustomize Transformer Configurations for Cluster API v1alpha3

Kustomize Transformer Configurations for Cluster API v1alpha3

Kustomize Transformer Configurations for Cluster API v1alpha3 post thumbnail image

A few days ago I wrote an article on configuring kustomize transformers for use with Cluster API (CAPI), in which I explored how users could configure the kustomize transformers—the parts of kustomize that actually modify objects—to be a bit more CAPI-aware. By doing so, using kustomize with CAPI manifests becomes much easier. Since that post, the CAPI team released v1alpha3. In working with v1alpha3, I realized my kustomize transformer configurations were incorrect. In this post, I will share CAPI v1alpha3 configurations for kustomize transformers.

In the previous post, I referenced changes to both namereference.yaml (to configure the nameReference transformer) and commonlabels.yaml (to configure the commonLabels transformer). CAPI v1alpha3 has changed the default way labels are used with MachineDeployments, so for v1alpha3 you may be able to get away with only changes to namereference.yaml. (If you know you are going to want/need additional labels on your MachineDeployment, then plan on changes to commonlabels.yaml as well.)

Here are the CAPI v1alpha3 changes needed to namereference.yaml:

- kind: Cluster group: cluster.x-k8s.io version: v1alpha3 fieldSpecs: - path: spec/clusterName kind: MachineDeployment - path: spec/template/spec/clusterName kind: MachineDeployment - kind: AWSCluster group: infrastructure.cluster.x-k8s.io version: v1alpha3 fieldSpecs: - path: spec/infrastructureRef/name kind: Cluster - kind: KubeadmControlPlane group: controlplane.cluster.x-k8s.io version: v1alpha3 fieldSpecs: - path: spec/controlPlaneRef/name kind: Cluster - kind: AWSMachine group: infrastructure.cluster.x-k8s.io version: v1alpha3 fieldSpecs: - path: spec/infrastructureRef/name kind: Machine - kind: KubeadmConfig group: bootstrap.cluster.x-k8s.io version: v1alpha3 fieldSpecs: - path: spec/bootstrap/configRef/name kind: Machine - kind: AWSMachineTemplate group: infrastructure.cluster.x-k8s.io version: v1alpha3 fieldSpecs: - path: spec/template/spec/infrastructureRef/name kind: MachineDeployment - path: spec/infrastructureTemplate/name kind: KubeadmControlPlane - kind: KubeadmConfigTemplate group: bootstrap.cluster.x-k8s.io version: v1alpha3 fieldSpecs: - path: spec/template/spec/bootstrap/configRef/name kind: MachineDeployment

You also need to include this line in your kustomization.yaml (to bring in the transformer configuration):

configurations:
- /path/to/customized/namereference.yaml

If you do need to edit commonlabels.yaml, the changes for CAPI v1alpha3 are the same as described in the previous article. You’ll then need to add an entry to your configurations: line, as noted above.

I hope this helps! Find me on Twitter or on the Kubernetes Slack instance if you have any questions, comments, or corrections.

Related Post

Microsoft warns users not to install Windows 10’s May updateMicrosoft warns users not to install Windows 10’s May update

<div class="teaser-image"> <a href="/it-infrastructure/8592/microsoft-warns-users-not-to-install-windows-10s-may-update"><img src="http://s0x.org/wp-content/uploads/2020/05/microsoft-warns-users-not-to-install-windows-10s-may-update-1.jpg" /></a> </div> <span class="field field-name-field-article-type field-type-taxonomy-term-reference field-label-hidden"> <span class="field-item even"><a href="/news">News</a></span> </span><div class="field field-name-field-published-date field-type-datetime field-label-hidden"> <div class="field-items"> <div class="field-item even"><span class="date-display-single">28 May, 2020</span></div> </div></div><span