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

Distribute CRDs using helm chart #1244

Merged
merged 10 commits into from
Mar 8, 2022
Merged

Distribute CRDs using helm chart #1244

merged 10 commits into from
Mar 8, 2022

Conversation

viveksinghggits
Copy link
Contributor

@viveksinghggits viveksinghggits commented Feb 11, 2022

Change Overview

CRDs for now were being deployed using controller, we
should make sure CRDs are being distributed by helm
chart preferrably but if we are consuming kanister not
as sub chart in that case they can set an env var
in the kanister pod to make sure CRDs are being created.

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

Test Plan

Helm install manifests

helm install kanister helm/kanister-operator/ -n kanister --dry-run > default.yaml

the manifest can be found here.

with createCRDs: true

helm install kanister helm/kanister-operator/ -n kanister --set controller.createCRDs=true  --dry-run > createcrds.yaml

the generated manifest can be found here

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

CRDs for now were being deployed using controller, we
should make sure CRDs are being distributed by helm
chart preferrably but if we are consuming kanister not
as sub chart in that case they can set an env var
in the kanister pod to make sure CRDs are being created.
Copy link
Contributor

@ihcsim ihcsim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. I am sort of hesitant to let Helm manage CRDs because by default, Helm can't upgrade nor delete CRDs in future chart versions. We are not gaining much other than the "one chart" installation experience, and now users become responsible for upgrading the CRDs.

I wonder if we should default createCRDs to true to continue let the controller manage the CRDs, with false being the 'break glass' approach. (Also see also comment below on upgrading existing Helm releases.) WDYT?

helm/kanister-operator/values.yaml Outdated Show resolved Hide resolved
@pavannd1 pavannd1 requested review from miquella and removed request for vkamra and PrasadG193 February 14, 2022 23:56
pkg/customresource/embed.go Outdated Show resolved Hide resolved
helm/kanister-operator/values.yaml Outdated Show resolved Hide resolved
- rename helm field `createCRDs` to `updateCRDs`
- refactor order of embedded files
Copy link
Contributor

@miquella miquella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

pkg/customresource/customresource.go Outdated Show resolved Hide resolved
pkg/kancontroller/kancontroller.go Outdated Show resolved Hide resolved
pkg/kancontroller/kancontroller.go Outdated Show resolved Hide resolved
When we didn't have this `updateCRDs` flag in values.yaml
controller was responsible to create/update the CRDs. To
make sure that we follow the same default path we are changing
the default value of `updateCRDs` to `true`, so that kanister
controller will be responsible to manager crds. If thats
not required/possible, this flag can be set to false.
@viveksinghggits
Copy link
Contributor Author

I will let @pavannd1 have a look and then kueue this.

@mergify mergify bot merged commit fe00227 into master Mar 8, 2022
@mergify mergify bot deleted the crd-refactor branch March 8, 2022 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants