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

Adding lifecycle hooks to deis-controller api #3

Merged
merged 7 commits into from
Nov 13, 2017

Conversation

Cryptophobia
Copy link
Member

Adding the lifecycle hooks feature to the deis-controller api. This allows users to attach lifecycle postStart and preStop hook commands to kubernetes api via the deis api.

Example of a preStop hook that would gracefully shutdown Resque worker processes:
https://gist.github.com/Cryptophobia/447ecea7858d26141359b22161e70ee2

Example of the POST to deis.$hostname/v2/apps/testing-again/config:

JSON Body:

 "lifecycle_pre_stop": {
        "worker": "echo 'Running the postStop script' && chmod +x bin/kube-resque-pre-stop.sh 
&& ./bin/kube-resque-pre-stop.sh;"
    }

For long running preStop hooks the terminationGracePeriodSeconds needs to be increased for the worker pods:

deis config:set KUBERNETES_POD_TERMINATION_GRACE_PERIOD_SECONDS=900 -a testing-worker

The tests are not written yet.
Code in deis-cli has not been written yet.

@Cryptophobia
Copy link
Member Author

This PR is related to this upstream PR:

deis/controller#1311

@Cryptophobia Cryptophobia requested a review from tmedford October 11, 2017 23:05
@Cryptophobia Cryptophobia merged commit 7698eb9 into master Nov 13, 2017
duanhongyi added a commit to duanhongyi/controller that referenced this pull request Jan 3, 2021
…o-1.11.23

chore(deps): bump django from 1.11.22 to 1.11.23 in /rootfs
Cryptophobia added a commit that referenced this pull request Feb 13, 2022
…2.2.27

chore(deps): bump django from 2.2.25 to 2.2.27 in /rootfs
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 this pull request may close these issues.

3 participants