Skip to content

giantswarm/cluster-api-app

Repository files navigation

CircleCI

cluster-api-app

This is a meta app that provides deployment packaging for Cluster API components.

Prerequisites

To get all the make targets running

  • kubectl in version >= v1.27.0 is required
  • yq is required

How it works

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:

  1. hack/fetch-manifest.sh: Fetches the Cluster API components for the version specified in helm/cluster-api/values.yaml.
  2. kubectl kustomize config/helm --output helm/cluster-api/templates: Generates kustomized Helm templates from upstream Cluster API components.
  3. hack/move-generated-crds.sh: Moves all the CRDs into the helm/cluster-api/files directory. They are later used in the CRD install job.
  4. hack/generate-crd-version-patches.sh: Extracts the upstream Cluster API CRDs into kustomize patches in helm/cluster-api/files.
  5. 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 global ciliumNetworkPolicy.enabled condition:
      {{- if .Values.ciliumNetworkPolicy.enabled }}
      [...]
      {{- end }}

Upgrading Cluster API

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.