Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(helm): upgrade CRDs instead of installing missing CRDs #6403

Merged
merged 3 commits into from
Mar 30, 2023

Conversation

jakubdyszkiewicz
Copy link
Contributor

Fix #6201

Helm by default does not manage CRDs aside from installing them on the first Helm install.
That's why a long time ago we created a Helm pre-upgrade job that installs missing CRDs.
This solution worked so far because CRDs for the old policies did not have "content" in them.
With new policies, the CRDs have a definition of all the fields. In Kuma 2.1.0 we changed an enum in MeshTrafficPermission from ALLOW to Allow.

However, our job did not upgrade CRDs it only installed them if they were missing.
This PR changes the job to reapply CRDs and not only create them.

  • I changed the job name from install-missing-crds to install-crds, to avoid confusion.
  • I removed --only-missing arg to reapply all crds
  • I added --no-config because the job was failing with Error: Failed to create a directory "/home/nonroot/.kumactl": mkdir /home/nonroot/.kumactl: read-only file system
  • I added set -e to scripts because the job was silently failing.
  • I added WithHelmChartPath in Upgrade in E2E. Without it, we didn't even upgrade, because of the initial WithHelmChartPath(Config.HelmChartName) opt-in install
  • I changed the version we upgrade from to install the old MeshTrafficPermission. I piggybacked on the existing E2E test because upgrade HELM tests are pretty heavy.

Checklist prior to review

  • Link to relevant issue as well as docs and UI issues --
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as a image registry) and it will work on Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Tests (Unit test, E2E tests, manual test on universal and k8s) --
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? --
  • Do you need to explicitly set a > Changelog: entry here or add a ci/ label to run fewer/more tests?

@jakubdyszkiewicz jakubdyszkiewicz requested review from a team, Automaat and bartsmykla and removed request for a team March 30, 2023 12:13
Signed-off-by: Jakub Dyszkiewicz <[email protected]>
Signed-off-by: Jakub Dyszkiewicz <[email protected]>
@jakubdyszkiewicz
Copy link
Contributor Author

@Mergifyio backport release-2.1

@mergify
Copy link
Contributor

mergify bot commented Mar 30, 2023

backport release-2.1

✅ Backports have been created

@jakubdyszkiewicz jakubdyszkiewicz merged commit 7b00372 into kumahq:master Mar 30, 2023
@jakubdyszkiewicz jakubdyszkiewicz deleted the fix/update-crds branch March 30, 2023 14:11
mergify bot pushed a commit that referenced this pull request Mar 30, 2023
Signed-off-by: Jakub Dyszkiewicz <[email protected]>
(cherry picked from commit 7b00372)
jakubdyszkiewicz pushed a commit that referenced this pull request Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrading with helm from 2.0.1 to 2.1.1 doesn’t work because the CRDs do not get updated
3 participants