Kubernetes Rolling Updates: Respect pod readiness before updatingGet internal IP of pod that is being killed in Kubernetes?Restart pods when configmap updates in Kubernetes?Kubernetes Horizontal Pod Autoscaler on GKE - “failed to get CPU utilization”kubernetes deployment wait between pods on rolling updateDo Kubernetes pods still receive requests after receiving SIGTERM?How to list Kubernetes recently deleted pods?In kubernetes what is the difference between a pod and a deployment?How to tell kubernetes not to recreate a pod?Spring Boot app + Kubernetes liveness/readiness checksKubernetes deployment: Don't terminate pod until new pod has been in Running state for 2 minutes
What is the difference between nullifying your vote and not going to vote at all?
Were pen cap holes designed to prevent death by suffocation if swallowed?
What does it mean when you think without speaking?
Do you play the upbeat when beginning to play a series of notes, and then after?
What caused the tendency for conservatives to not support climate change reform?
A Mathematical Discussion: Fill in the Blank
Smart people send dumb people to a new planet on a space craft that crashes into a body of water
Infinitely many hats
Is this light switch installation safe and legal?
How many chess players are over 2500 Elo?
What are these (utility?) boxes at the side of the house?
How feasible is the Delta-Glider?
Could IPv6 make NAT / port numbers redundant?
If a massive object like Jupiter flew past the Earth how close would it need to come to pull people off of the surface?
What are the problems in teaching guitar via Skype?
Scaffoldings in New York
Windows 10 Programs start without visual Interface
What F1 in name of seeds/varieties means?
Is it ok to put a subplot to a story that is never meant to contribute to the development of the main plot?
Grammar of "Nec huic publico, ut opinantur, malo turba tantum et imprudens uulgus ingemuit"
Why does the UK have more political parties than the US?
Can a non-EU citizen travel within schengen zone freely without passport?
What was this black-and-white film set in the Arctic or Antarctic where the monster/alien gets fried in the end?
What does uniform continuity mean exactly?
Kubernetes Rolling Updates: Respect pod readiness before updating
Get internal IP of pod that is being killed in Kubernetes?Restart pods when configmap updates in Kubernetes?Kubernetes Horizontal Pod Autoscaler on GKE - “failed to get CPU utilization”kubernetes deployment wait between pods on rolling updateDo Kubernetes pods still receive requests after receiving SIGTERM?How to list Kubernetes recently deleted pods?In kubernetes what is the difference between a pod and a deployment?How to tell kubernetes not to recreate a pod?Spring Boot app + Kubernetes liveness/readiness checksKubernetes deployment: Don't terminate pod until new pod has been in Running state for 2 minutes
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
My deployment's pods are doing work that should not be interrupted. Is it possible that K8s is polling an endpoint about update readiness, or inform my pod that it is about to go down so it can get its affairs in order and then declare itself ready for an update?
Ideal process:
- An updated pod is ready to replace an old one
- A request is sent to the old pod by k8s, telling it that it is about to be updated
- Old pod gets polled about update readiness
- Old pod gets its affairs in order (e.g. stop receiving new tasks, finishes existing tasks)
- Old pod says it is ready
- Old pod gets replaced
kubernetes
add a comment |
My deployment's pods are doing work that should not be interrupted. Is it possible that K8s is polling an endpoint about update readiness, or inform my pod that it is about to go down so it can get its affairs in order and then declare itself ready for an update?
Ideal process:
- An updated pod is ready to replace an old one
- A request is sent to the old pod by k8s, telling it that it is about to be updated
- Old pod gets polled about update readiness
- Old pod gets its affairs in order (e.g. stop receiving new tasks, finishes existing tasks)
- Old pod says it is ready
- Old pod gets replaced
kubernetes
add a comment |
My deployment's pods are doing work that should not be interrupted. Is it possible that K8s is polling an endpoint about update readiness, or inform my pod that it is about to go down so it can get its affairs in order and then declare itself ready for an update?
Ideal process:
- An updated pod is ready to replace an old one
- A request is sent to the old pod by k8s, telling it that it is about to be updated
- Old pod gets polled about update readiness
- Old pod gets its affairs in order (e.g. stop receiving new tasks, finishes existing tasks)
- Old pod says it is ready
- Old pod gets replaced
kubernetes
My deployment's pods are doing work that should not be interrupted. Is it possible that K8s is polling an endpoint about update readiness, or inform my pod that it is about to go down so it can get its affairs in order and then declare itself ready for an update?
Ideal process:
- An updated pod is ready to replace an old one
- A request is sent to the old pod by k8s, telling it that it is about to be updated
- Old pod gets polled about update readiness
- Old pod gets its affairs in order (e.g. stop receiving new tasks, finishes existing tasks)
- Old pod says it is ready
- Old pod gets replaced
kubernetes
kubernetes
asked Mar 24 at 8:55
Kosmas PapadatosKosmas Papadatos
6472824
6472824
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You could perhaps look into using container lifecycle hooks - specifically prestop in this case.
apiVersion: v1
kind: Pod
metadata:
name: your-pod
spec:
containers:
- name: your-awesome-image
image: image-name
lifecycle:
postStart:
exec:
command: ["/bin/sh", "my-app", "-start"]
preStop:
exec:
# specifically by adding the cmd you want your image to run here
command: ["/bin/sh","my-app","-stop"]
WowPreStop
is blocking! Exactly what I need! Thank you!
– Kosmas Papadatos
Mar 24 at 9:11
no problem - another really cool feature from the Kubernetes team.
– syllabix
Mar 24 at 9:20
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55322121%2fkubernetes-rolling-updates-respect-pod-readiness-before-updating%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You could perhaps look into using container lifecycle hooks - specifically prestop in this case.
apiVersion: v1
kind: Pod
metadata:
name: your-pod
spec:
containers:
- name: your-awesome-image
image: image-name
lifecycle:
postStart:
exec:
command: ["/bin/sh", "my-app", "-start"]
preStop:
exec:
# specifically by adding the cmd you want your image to run here
command: ["/bin/sh","my-app","-stop"]
WowPreStop
is blocking! Exactly what I need! Thank you!
– Kosmas Papadatos
Mar 24 at 9:11
no problem - another really cool feature from the Kubernetes team.
– syllabix
Mar 24 at 9:20
add a comment |
You could perhaps look into using container lifecycle hooks - specifically prestop in this case.
apiVersion: v1
kind: Pod
metadata:
name: your-pod
spec:
containers:
- name: your-awesome-image
image: image-name
lifecycle:
postStart:
exec:
command: ["/bin/sh", "my-app", "-start"]
preStop:
exec:
# specifically by adding the cmd you want your image to run here
command: ["/bin/sh","my-app","-stop"]
WowPreStop
is blocking! Exactly what I need! Thank you!
– Kosmas Papadatos
Mar 24 at 9:11
no problem - another really cool feature from the Kubernetes team.
– syllabix
Mar 24 at 9:20
add a comment |
You could perhaps look into using container lifecycle hooks - specifically prestop in this case.
apiVersion: v1
kind: Pod
metadata:
name: your-pod
spec:
containers:
- name: your-awesome-image
image: image-name
lifecycle:
postStart:
exec:
command: ["/bin/sh", "my-app", "-start"]
preStop:
exec:
# specifically by adding the cmd you want your image to run here
command: ["/bin/sh","my-app","-stop"]
You could perhaps look into using container lifecycle hooks - specifically prestop in this case.
apiVersion: v1
kind: Pod
metadata:
name: your-pod
spec:
containers:
- name: your-awesome-image
image: image-name
lifecycle:
postStart:
exec:
command: ["/bin/sh", "my-app", "-start"]
preStop:
exec:
# specifically by adding the cmd you want your image to run here
command: ["/bin/sh","my-app","-stop"]
answered Mar 24 at 9:06
syllabixsyllabix
1,373812
1,373812
WowPreStop
is blocking! Exactly what I need! Thank you!
– Kosmas Papadatos
Mar 24 at 9:11
no problem - another really cool feature from the Kubernetes team.
– syllabix
Mar 24 at 9:20
add a comment |
WowPreStop
is blocking! Exactly what I need! Thank you!
– Kosmas Papadatos
Mar 24 at 9:11
no problem - another really cool feature from the Kubernetes team.
– syllabix
Mar 24 at 9:20
Wow
PreStop
is blocking! Exactly what I need! Thank you!– Kosmas Papadatos
Mar 24 at 9:11
Wow
PreStop
is blocking! Exactly what I need! Thank you!– Kosmas Papadatos
Mar 24 at 9:11
no problem - another really cool feature from the Kubernetes team.
– syllabix
Mar 24 at 9:20
no problem - another really cool feature from the Kubernetes team.
– syllabix
Mar 24 at 9:20
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55322121%2fkubernetes-rolling-updates-respect-pod-readiness-before-updating%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown