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

feat: Global hooks #331

Closed
mumoshu opened this issue Sep 12, 2018 · 5 comments · Fixed by #1301
Closed

feat: Global hooks #331

mumoshu opened this issue Sep 12, 2018 · 5 comments · Fixed by #1301

Comments

@mumoshu
Copy link
Collaborator

mumoshu commented Sep 12, 2018

#295 is about hooking into the life cycle of each release in helmfile.yaml. #325 is about making the per-release hook reusable across releases.

In contract, the purpose of this feature is hooking into the life cycles of the helmfile command and each helmfile.yaml. So let's say you wanted to run some command before each helmfile run, a onHelmfileStar hook would make sense.

I don't have specific use-case(s) requires this feature, but as this concept has been seen in a few times in this project, I'd like to use this issue for aggregating more like that.

Relevant issues and comments:

@simbo1905
Copy link

I am currently running my own scripts that do a "pre-" and "post-" helm apply which you can see at those links.

I would like to use glob patterns so that an simply run a bunch of helmfiles within subfolders without my own custom script. I cannot do that until there are some lifecycle hooks mentioned in this ticket where I can run my pre- and post- helm apply scripts.

The two use cases I currently have for these hooks are:

  1. running our own secret decryption tooling
  2. managing tags within an openshift container registry

@simbo1905
Copy link

another use case that just popped up is to have a "post helmfile hook" script that sends out a notification that a particular microservice has been updated (e.g., post an message into a slack channel)

@davidecg
Copy link

davidecg commented Feb 8, 2019

We have to run a couple of commands to authenticate to aws and set the kubeconfig; this global hook would be perfect for that.

@simbo1905
Copy link

simbo1905 commented Feb 8, 2019

Now we have a helmfile that releases many secrets (shared by many apps) and we have to run a post script to ensure apps pick up the changes after all the secrets are refreshed.

At the moment we always wrap running helmfile in a script that looks for pre- and post- global hooks in the same folder as the hemlfile.

@simbo1905
Copy link

simbo1905 commented Apr 11, 2019

we have moved half our apps onto helmfile in production. we use a subfolder per application with a separate helmfile. we run pre- and post- helmfile hooks. we also run a post everything hook

these do things like check for whether any secrets have changed requiring us to bounce deployments. they also do chatroom announcements. this tells us the status of deployments when we have changed or environments config repos and we are running helmfile apply across the whole repo to sync any changes.

currently, we have to use a custom script for this as helmfile doesn't have the hooks we need as per this ticket. we run these hooks starting at this line which is quite a lot of boilerplate code. we would rather simply everything by using helmfile.d and define additional hooks in the helmfile.yaml, ones that run before and after each helmfile, and ones that run before and after starting to process the entire folder.

if we got all hooks we actually need we could remove our boilerplate script that allows us to manage multiple apps in multiple environments all driven by git webhooks and helmfile.

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 a pull request may close this issue.

3 participants