Skip to content

Commit

Permalink
Use vendir to generate chart (#104)
Browse files Browse the repository at this point in the history
* WIP

* Generate cilium chart using our fork and vendir

* Apply more changes from our fork

* More changes from our fork

* Target fork main branch

* Remove sha hashes from images in values file

* Added instructions on how to upgrade the app
  • Loading branch information
fiunchinho authored Nov 6, 2023
1 parent 0dc6a5e commit 52625ae
Show file tree
Hide file tree
Showing 17 changed files with 3,868 additions and 196 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Generate cilium chart using our fork and `vendir`.

## [0.16.0] - 2023-10-25

### Changed
Expand Down
11 changes: 2 additions & 9 deletions Makefile.gen.app.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,9 @@ lint-chart: check-env ## Runs ct against the default chart.

update-chart: check-env ## Sync chart with upstream repo.
@echo "====> $@"
rm -rf ./helm/$(APPLICATION)
vendir sync
$(MAKE) update-deps

update-deps: check-env $(DEPS) ## Update Helm dependencies.
cd $(APPLICATION) && helm dependency update

$(DEPS): check-env ## Update main Chart.yaml with new local dep versions.
dep_name=$(shell basename $@) && \
new_version=`$(YQ) .version $(APPLICATION)/charts/$$dep_name/Chart.yaml` && \
$(YQ) -i e "with(.dependencies[]; select(.name == \"$$dep_name\") | .version = \"$$new_version\")" $(APPLICATION)/Chart.yaml
sed -i 's/@sha256:[a-f0-9]\+//g' ./helm/$(APPLICATION)/values.yaml

helm-docs: check-env ## Update $(APPLICATION) README.
$(HELM_DOCS) -c $(APPLICATION) -g $(APPLICATION)
Expand Down
62 changes: 14 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
# cilium chart

Giant Swarm offers a cilium App which can be installed in workload clusters.
Here we define the cilium chart with its templates and default configuration.

**What is this app?**

**Why did we add it?**

**Who can use it?**

## Installing

Expand All @@ -18,50 +11,23 @@ There are several ways to install this app onto a workload cluster.
- [Using our web interface](https://docs.giantswarm.io/ui-api/web/app-platform/#installing-an-app).
- By creating an [App resource](https://docs.giantswarm.io/ui-api/management-api/crd/apps.application.giantswarm.io/) in the management cluster as explained in [Getting started with App Platform](https://docs.giantswarm.io/app-platform/getting-started/).

## Configuring

### values.yaml

**This is an example of a values file you could upload using our web interface.**

```yaml
# values.yaml

```

### Sample App CR and ConfigMap for the management cluster

If you have access to the Kubernetes API on the management cluster, you could create
the App CR and ConfigMap directly.
## Upgrading cilium version

Here is an example that would install the app to
workload cluster `abc12`:

```yaml
# appCR.yaml
The contents of the `helm` folder are being generated by the `make` target called `make update-chart`.

This target uses [`vendir`](https://carvel.dev/vendir/) to fetch the helm chart contained in [the fork of the cilium repository that we maintain](https://github.com/giantswarm/cilium-upstream).
Currently, the main branch on the fork contains upstream branch `v1.13`, with our custom changes on top.
If you want to upgrade this cilium-app to use a newer version of cilium, you need to prepare our fork first.
We need to create a new branch on our fork based off the branch of the version we want to upgrade to. For example, if we want to upgrade to cilium v1.14, we need to create a new branch based off the upstream `v1.14` branch.
Then we need to apply our custom changes on top of that new branch. You can use `cherry-pick` for that, for example
```

```yaml
# user-values-configmap.yaml

git cherry-pick a4b22dee87ba3663f967f6dd6d8e666c849c742d^..25c449534cc325a5798fc7c839b8ac33591b3516
```

See our [full reference on how to configure apps](https://docs.giantswarm.io/app-platform/app-configuration/) for more details.

## Compatibility

This app has been tested to work with the following workload cluster release versions:

- _add release version_

## Limitations

Some apps have restrictions on how they can be deployed.
Not following these limitations will most likely result in a broken deployment.

- _add limitation_

## Credit
Then, we need to update the `vendir` configuration in `vendir.yml` on this repository to use the new branch, and run the make target `APPLICATION=cilium make update-chart`.
With the generated changes, let's create a new pull request so that everyone can review the changes that will be applied to the cilium chart.
If we need further customizations, we can keep adding commits on the new branch, and re-run `make update-chart` to update the generated files.

- {APP HELM REPOSITORY}
Once we are happy with the changes, we can merge the changes in the fork to the fork's `main` branch. After merging, the `main` branch in our fork should contain cilium `v1.14` with our customizations on top.
Then update our pull request to use the fork's `main` branch again, and merge it.
Finally, we just need to create a new release of this cilium-app.
2 changes: 1 addition & 1 deletion helm/cilium/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: cilium
displayName: Cilium
home: https://cilium.io/
version: 0.16.0
version: 1.13.6
appVersion: 1.13.6
kubeVersion: ">= 1.16.0-0"
icon: https://cdn.jsdelivr.net/gh/cilium/[email protected]/Documentation/images/logo-solo.svg
Expand Down
Loading

0 comments on commit 52625ae

Please sign in to comment.