Skip to content

feat: Reduce CRD size #584

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

Merged
merged 6 commits into from
Aug 13, 2024
Merged

feat: Reduce CRD size #584

merged 6 commits into from
Aug 13, 2024

Conversation

sbernauer
Copy link
Member

@sbernauer sbernauer commented Jul 2, 2024

Description

Before 2.4M
After operator-rs bump (to pull in stackabletech/operator-rs#821): 289K
After extraVolumes schema change: 183K 🚀

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes
# Author
- [x] Changes are OpenShift compatible
- [x] CRD changes approved
- [x] CRD documentation for all fields, following the [style guide](https://docs.stackable.tech/home/nightly/contributor/docs-style-guide).
- [x] Helm chart can be installed and deployed operator works
- [ ] Integration tests passed (for non trivial changes)
- [x] Changes need to be "offline" compatible
# Reviewer
- [ ] Code contains useful comments
- [ ] Code contains useful logging statements
- [ ] (Integration-)Test cases added
- [ ] Documentation added or updated. Follows the [style guide](https://docs.stackable.tech/home/nightly/contributor/docs-style-guide).
- [ ] Changelog updated
- [ ] Cargo.toml only contains references to git tags (not specific commits or branches)
# Acceptance
- [ ] Feature Tracker has been updated
- [ ] Proper release label has been added
- [ ] [Roadmap](https://github.com/orgs/stackabletech/projects/25/views/1) has been updated

@sbernauer sbernauer self-assigned this Jul 2, 2024
@sbernauer sbernauer changed the title feat: Reduce CRD size feat: Reduce CRD size by omitting extraVolumes schema Jul 2, 2024
@NickLarsenNZ
Copy link
Member

I'm curious what the CRD docs would look like. Can we link to somewhere for the rest of the schema? Do we generate two schemas, a full (for docs) and limited (to apply to k8s)?

Although the end-user loses validation directly from k8s-api, the operator will not accept an invalid CR. If we want to shift validation left, we can then look at validating webhooks.

And as you also mentioned, hopefully some day we can bring it back in if Kubernetes handles references to sub-schemas.

@NickLarsenNZ
Copy link
Member

Just want to make sure @nightkr sees this, before we continue.
Related PR: stackabletech/operator-rs#821

@sbernauer
Copy link
Member Author

Please vote if you agree with this change 👍 / 👎 , I personally don't see any way around this when we want to have CRD versioning

@nightkr
Copy link
Member

nightkr commented Jul 31, 2024

Ideally I would like to keep it for the latest version even if we prune it for the older..

@sbernauer
Copy link
Member Author

Ideally I would like to keep it for the latest version even if we prune it for the older..

That's an interesting idea, thanks! Lets say we start with v1 (full). Now we bump and have v2 (full) and v1 (without PodTemplate schema). By doing so we would alter the schema of v1 after the fact - does that cause any harm? It sounds dangerous to me, but it might be totally safe. But It might not fit the mental model of the stability of CRD versions 🤔

@sbernauer sbernauer force-pushed the feat/reduce-crd-size branch from dbd376a to e5c2097 Compare August 6, 2024 06:23
@sbernauer
Copy link
Member Author

Given how big the CRD versioning thing already is (months of work already), I think I would prefer to unblock further work by not including the schema for now (we need the size reduction to continue).

Later on we can look into improving the schema, maybe Kubernetes supports sub-schemas at some point or we do something like the suggested "keep it for the latest version even if we prune it for the older".

I hope that works for everyone!

labrenbe
labrenbe previously approved these changes Aug 12, 2024
Copy link
Member

@labrenbe labrenbe left a comment

Choose a reason for hiding this comment

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

lgtm

@sbernauer
Copy link
Member Author

@sbernauer
Copy link
Member Author

@sbernauer sbernauer requested a review from labrenbe August 12, 2024 12:28
@sbernauer sbernauer changed the title feat: Reduce CRD size by omitting extraVolumes schema feat: Reduce CRD size Aug 12, 2024
Copy link
Member

@maltesander maltesander left a comment

Choose a reason for hiding this comment

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

LGTM!

@sbernauer sbernauer added this pull request to the merge queue Aug 13, 2024
Merged via the queue into main with commit 18953df Aug 13, 2024
31 checks passed
@sbernauer sbernauer deleted the feat/reduce-crd-size branch August 13, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants