Skip to content

Commit

Permalink
Improve README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Gacko authored Dec 21, 2023
1 parent 664900e commit 0edbe5b
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,31 @@ This is a meta App that provides deployment packaging for Cluster API core, boot

## Prerequisites

To get all the `make targets` run
To get all the `make` targets run

* `kustomize` ([source](https://github.com/kubernetes-sigs/kustomize/releases)) in version `>= v5.0` is needed
* `yq` ([source](https://github.com/mikefarah/yq/)) is needed
* `kustomize` ([source](https://github.com/kubernetes-sigs/kustomize)) in version `>= v5.0` is required
* `yq` ([source](https://github.com/mikefarah/yq)) is required

## How it works

The `make` target `generate` transfer the upstream released `cluster-api-components.yaml` into a Giant Swarm specific `HelmChart`.
Beside the transformation into a `HelmChart` there are few other changes needed to make all the `cluster-api` components fit well into our stack.
The `make` target `generate` transfers the upstream released `cluster-api-components.yaml` into a Giant Swarm specific Helm chart. Beside the transformation into a Helm chart there are some other changes required to make all the `cluster-api` components fit well into our stack.

To make all the changes transparent and reproducible, `kustomize` is used to apply (mostly) all changes.
To make all the changes transparent and reproducible, `kustomize` is used to apply patches.

Following notable commands/scripts are triggered in `make generate`:

1. [`hack/fetch-manifest.sh`](hack/fetch-manifest.sh)</br>
Fetch the release manifest with the version specified in `helm/cluster-api/values.yaml`. Since we use our own fork of CAPI which does not replicate upstream GitHub releases, the YAML manifest is part of the Docker image as means to easily fetch the manifest which exactly matches the desired commit/tag.
1. `make delete-generated-helm-charts`</br>
Cleans folder `helm/cluster-api/templates` to not get any orphaned objects in the app.
1. `kustomize build config/helm -o helm/cluster-api/templates`</br>
Apply all the defined `kustomize` changes (defined in `kustomization.yaml`)
1. [`hack/move-generated-crds.sh`](hack/move-generated-crds.sh)</br>
Used to move all the `CRDs` into the directory `helm/cluster-api/files`. All files within this directory are later used in `Job/cluster-api-crd-install`.
1. [`hack/generate-crd-version-patches.sh`](hack/generate-crd-version-patches.sh)</br>
Extracts the upstream `cluster-api` CRDs into `kustomize` patches under `helm/cluster-api/files`.
With that it's easier (in PRs) to review CRD changes as our own vintage controllers also reconcile on CAPI CRs.
The `kustomized` CRDs got applied within `Job/cluster-api-crd-install` by running `kubectl apply` with the `--kustomize` flag ([xref](https://github.com/giantswarm/cluster-api-app/blob/4f672f7a0dd79a63fc4e66bfb659f9aeefba2b02/helm/cluster-api/templates/crd-install/crd-job.yaml#L48)).
1. [`hack/fetch-manifest.sh`](hack/fetch-manifest.sh)\
Fetches the release manifest with the version specified in `helm/cluster-api/values.yaml`. Since we use our own fork of CAPI that does not replicate upstream GitHub releases, the YAML manifest is part of the Docker image to easily retrieve the manifest that corresponds exactly to the desired commit/tag.
1. `make delete-generated-helm-charts`\
Cleans the `helm/cluster-api/templates` folder to omit any orphaned objects in the app.
1. `kustomize build config/helm -o helm/cluster-api/templates`\
Applies all the defined `kustomize` changes defined in `kustomization.yaml`.
1. [`hack/move-generated-crds.sh`](hack/move-generated-crds.sh)\
Moves all the CRDs into the `helm/cluster-api/files` directory. All files within this directory are later used in `job/cluster-api-crd-install`.
1. [`hack/generate-crd-version-patches.sh`](hack/generate-crd-version-patches.sh)\
Extracts the upstream `cluster-api` CRDs into `kustomize` patches in `helm/cluster-api/files`.
With that it's easier to review CRD changes in PRs as our own Vintage controllers also reconcile CAPI CRs.
The `kustomize`d CRDs get applied within `job/cluster-api-crd-install` by running `kubectl apply` with the `--kustomize` flag ([code](https://github.com/giantswarm/cluster-api-app/blob/master/helm/cluster-api/templates/crd-install/crd-job.yaml#L48)).
1. [`hack/wrap-with-conditional.sh`](hack/wrap-with-conditional.sh) wraps
* all the occurrence of the `cluster.x-k8s.io/watch-filter` label selector into a `helm` condition, e.g.:

Expand Down

0 comments on commit 0edbe5b

Please sign in to comment.