Skip to content

[storage] Add an SQL storage driver - #5371

Merged
bacongobbler merged 4 commits into
helm:masterfrom
PayFit:feat/add-sql-storage-driver
May 9, 2019
Merged

bacongobbler merged 4 commits into
helm:masterfrom
PayFit:feat/add-sql-storage-driver

Conversation

@elafarge

@elafarge elafarge commented Feb 27, 2019 •

Copy link
Copy Markdown

What this PR does / why we need it:

This commits adds the possibility to back Tiller (or the future
Tiller-less Helm CLI) with any SQL database (only postgres has been
tested so far) to store release information.

The main motivation for this commit was to use a storage backend that
would allow releases larger that 1MB in size (ConfigMap or Secret
drivers don't, because of limits on value size in the underlying etcd
key-value store).

Signed-off-by: Étienne Lafarge [email protected]

Co-authored-by: Elliot Maincourt [email protected] (@emaincourt)
Co-authored-by: Paul Borensztein [email protected] (@commit-master)

Special notes for the reviewer(s):

  • It goes without saying that we'll be glad to maintain and update this part of the codebase - in particular - to comply with the new Tiller-less Helm 3 ;-)
  • Also, we'll be glad to write an any backend -> postgres migration script if this backend gets promoted to GA at some point.
  • Only postgresql has been tested so far. However, we've tried to make our code SQL dialect-agnostic (using sqlx and avoiding postgres specific SQL statements). We'll be happy to test other databases if required by the community.
  • We're currently testing this feature on our pre-production environment (to provide our developers with a "staging-on-demand" feature) and will switch our production infrastructure on it if this PR gets merged

If applicable:

  • this PR contains documentation
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility --> not applicable for now, we'll be glad to write a migration script and add it to the helm CLI if needed

closes #1413
closes #1996
closes #4215

@helm-bot helm-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 27, 2019
Comment thread docs/install.md Resolved
Comment thread docs/install.md Resolved
Comment thread docs/sql-storage.md Resolved
Comment thread docs/sql-storage.md Resolved
Comment thread docs/sql-storage.md Resolved
Comment thread docs/sql-storage.md Resolved
Comment thread docs/sql-storage.md Resolved
Comment thread pkg/storage/driver/sql.go Resolved
Comment thread cmd/tiller/tiller.go Resolved
@helm-bot helm-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 2, 2019
@elafarge

elafarge commented Mar 2, 2019

Copy link
Copy Markdown
Author

Thanks a lot for the quick review @bacongobbler .

All the requested changes have been implemented so far but one.
We'll think about it over the weekend and come back to you on that matter early next week.

Have a great weekend !

@technosophos technosophos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am really excited to see this! I have long wanted to write a driver like this, but have just never had the time/need to do it. I left a security-related comment that I think needs a change (or maybe just an explanation that the SQL driver does something I don't know about). Otherwise, I am good.

Also, thanks for setting a high precedent on how a SQL driver should be tested!

Comment thread pkg/storage/driver/sql.go Resolved
Comment thread pkg/storage/driver/sql.go Resolved
Comment thread pkg/storage/driver/sql.go Resolved
@helm-bot helm-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 4, 2019
@elafarge

Copy link
Copy Markdown
Author

(FYI, I just rebased the branch against master, fixed conflicts, and force-pushed)

@elafarge

elafarge commented May 2, 2019

Copy link
Copy Markdown
Author

Hi @technosophos @bacongobbler ,

Could you take a look at this PR when you get the chance. All required updates have been made. We'll be glad to change/add/remove/discuss anything you feel is relevant in a timely manner so that this can make it to 2.14.0 ;-)

Have a great day !

@technosophos technosophos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I'll leave it to @bacongobbler to merge when it fits the release schedule.

@bacongobbler

Copy link
Copy Markdown
Member

I completely forgot that we made the call to bring this into the 2.14 release. I'll cut rc.2 with this PR. Thanks @elafarge!

@bacongobbler
bacongobbler merged commit a93ebe1 into helm:master May 9, 2019
@bacongobbler bacongobbler added needs-pick Indicates that a PR needs to be cherry-picked into the next release candidate. picked Indicates that a PR has been cherry-picked into the next release candidate. and removed needs-pick Indicates that a PR needs to be cherry-picked into the next release candidate. labels May 9, 2019
@bacongobbler

Copy link
Copy Markdown
Member

cherry-picked into 2.14.

@bacongobbler

Copy link
Copy Markdown
Member

Just a heads up, but the SQL driver tests failed after merging this into master: https://circleci.com/gh/helm/helm/8204

@elafarge would you mind looking into this to fix up the breaking tests?

@bacongobbler

Copy link
Copy Markdown
Member

Looks like it's due to the underlying gRPC layer being populated. See attached.

image

@bacongobbler

Copy link
Copy Markdown
Member

I've pulled it out of the 2.14 release branch for the time being so we can continue to test the release candidate. @elafarge, when you have time to look into this, please reach out to me and we can see what we can do about getting this in for 2.14. Thanks!

@bacongobbler bacongobbler removed the picked Indicates that a PR has been cherry-picked into the next release candidate. label May 9, 2019
@bacongobbler

Copy link
Copy Markdown
Member

Found the fix; see #5706.

@elafarge

Copy link
Copy Markdown
Author

Hi @bacongobbler . Sorry, for the late reply, I was off for the week. Glad to hear you found the fix.

Thanks a lot for the merge !! 🎉

@elafarge
elafarge deleted the feat/add-sql-storage-driver branch May 21, 2019 11:34
@vicaya

vicaya commented Dec 23, 2019

Copy link
Copy Markdown

Does the sql storage driver work with helm v3?

If not, any plans to port this (and other storage drivers) to v3.

@hickeyma hickeyma added the Needs v3 backport Label PRs for v4/main, which are still applicable to v3 so need a separate backport PR label Jan 6, 2020
@hickeyma

hickeyma commented Jan 6, 2020

Copy link
Copy Markdown
Contributor

This would ned to be ported to v3. @elafarge Is this something you would be interested in doing?

@elafarge

Copy link
Copy Markdown
Author

@hickeyma sorry, I just stumbled upon your question when cleaning up my Github notifications. I'll surely take a peek at this (maybe with @emaincourt if he's interested 👼 ) this week.

@emaincourt

Copy link
Copy Markdown
Contributor

@elafarge I might actually have time to handle it. Will take a look at the v3 codebase this week 🧚‍♀️

@hickeyma

Copy link
Copy Markdown
Contributor

Thanks for getting back @elafarge @emaincourt. That would be great if you can port it. Reach out if you need any help. FYI, Helm v3 branch is now master. Push a new PR with a reference this PR.

@emaincourt

Copy link
Copy Markdown
Contributor

@hickeyma @elafarge PR here: #7635

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

10 participants