-
Notifications
You must be signed in to change notification settings - Fork 171
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
Add helm_remote
extension
#19
Conversation
We currently also do some hacks as you have mentioned above. This would be super helpful thanks for turning it into a plugin! Would it be possible to also add an Some nice examples |
helm_remote/Tiltfile
Outdated
# avoid a namespace not found error | ||
namespace_create(namespace) # do this early so it manages to register before we attempt to install into it | ||
|
||
local('rm -rf helm_deps/%s' % repo_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires that helm_deps
is git ignored right? Do you think we could download these into a temp directory location? or explicitly state these should be ignored.
This changes the current working directory which feels a little odd.
We currently do
local('if [ ! -d ./tmp/1.40.2/rabbitmq-ha ]; then helm fetch stable/rabbitmq-ha --untar --untardir ./tmp/1.40.2 --version 1.40.2; fi', quiet=QUIET)
rabbitMQYaml = helm('./tmp/1.40.2/rabbitmq-ha',
This allows us to cache and version lock the helm charts, but I have never loved that ./tmp
was .gitignored
but it was part of our setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good thought about the .gitignore file. This definitely doesn't require that directory to be ignored, but I think it's probably a good idea to create a readme file for this sub-folder which suggests ignoring it.
As far as where the temp dir is located/what it's called. I'm 100% open to suggestions. I could also add an additional function for configuring the temp/cache location? Even so, I'm open to input on what a sane default might be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with it being documented and has sane defaults.
What about the versioning? Do you think your current method signature would support versioning? (this is something we would love to see and would love to switch to a proper plugin instead of our custom stuff)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drubin as I'm adding the ability to configure the temp/cache location, I'm seeing that your comment was maybe intended to refer to .tiltignore
rather than .gitignore
? In that case, yes, you're 100% correct that this dir would need to be ignored in order to prevent infinite recursive triggers to reprocess the tiltfile. So far I haven't been able to find a way around that, yet. Seems like tilt needs a native unwatch_file()
function for situations like this, or to allow runtime ignoring of dynamic filenames.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added tilt-dev/tilt#3404
@drubin Check out the latest commit Markdown-processed version of readme here |
…dditional function parameters. * version -- specify the version of the chart to install * username -- authenticate with a private helm repository * password -- authenticate with a private helm repository
@@ -0,0 +1,42 @@ | |||
# Helm Remote |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rendered version of this file can be viewed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm @kogi the CRD installation seems to reliably fail for me. Here are my repro steps:
load('helm-remote.tilt', 'helm_remote')
helm_remote('memcached', repo_url='https://charts.bitnami.com/bitnami')
tilt up
- Observe that CRD installation fails with
error: the path "./.helm/memcached/latest/memcached/crds" does not exist
- Manually trigger the
memcached-crds-install
resource - Observe that CRD installation fails with
error: the path "./.helm/memcached/latest/memcached/crds" does not exist
Snapshot available here
Is that expected?
@jazzdan nope, that's definitely not intended behavior. I'll dig in and see what's going on. Thanks! |
…keep their CRDs in a non-standard location
@jazzdan the latest commit should fix this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks a lot for contributing @kogi
* Add readme. Add ability to configure helm chart cache location. Add additional function parameters. * version -- specify the version of the chart to install * username -- authenticate with a private helm repository * password -- authenticate with a private helm repository * Fix script for helm charts that may not have any CRDs or charts that keep their CRDs in a non-standard location
|
||
# TODO: ===================================== | ||
# if it ever becomes possible for loaded files to also load their own extensions | ||
# this method can be replaced by `load('ext://namespace', 'namespace_create') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victorwuky
The currently recommended way of installing remote helm files is:
But this has a few shortcomings when running
tilt down
:--create-namespace
flag is not uninstalled (even when usingtilt down --delete-namespaces
Another option is:
This has the advantage of solving bullet #1 above, but still has other shortcomings
helm()
has no support for--create-namespace
)tilt down --delete-namespaces
helm()
This extension solves all of the above. (see comments in code for a few technical caveats)