This is a meta app that provides deployment packaging for Cluster API components.
To get all the make
targets running
The make generate
target transfers the upstream Cluster API components into a Giant Swarm specific Helm chart. Besides there are some other changes required to make them fit into our stack.
To make all the changes transparent and reproducible, kubectl kustomize
is used to apply patches.
The following notable commands & scripts are triggered in make generate
:
hack/fetch-manifest.sh
: Fetches the Cluster API components for the version specified inhelm/cluster-api/values.yaml
.kubectl kustomize config/helm --output helm/cluster-api/templates
: Generates kustomized Helm templates from upstream Cluster API components.hack/move-generated-crds.sh
: Moves all the CRDs into thehelm/cluster-api/files
directory. They are later used in the CRD install job.hack/generate-crd-version-patches.sh
: Extracts the upstream Cluster API CRDs intokustomize
patches inhelm/cluster-api/files
.hack/wrap-with-conditional.sh
- Wraps all occurrences of the
cluster.x-k8s.io/watch-filter
object selector into a condition:{{- if .Values.watchfilter }} objectSelector: matchLabels: cluster.x-k8s.io/watch-filter: '{{ .Values.watchFilter }}' {{- end }}
- Wraps all the
*_ciliumnetworkpolicy_*.yaml
manifests into the globalciliumNetworkPolicy.enabled
condition:{{- if .Values.ciliumNetworkPolicy.enabled }} [...] {{- end }}
- Wraps all occurrences of the
See the README.md
of our Cluster API fork for testing and releasing changes.
It is important to run make generate
so that the templates, CRDs and patches are regenerated using the new version of Cluster API.
NOTE: When new webhooks are added upstream, we need to manually add them to the relevant patches.