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;








3















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:



  1. An updated pod is ready to replace an old one

  2. A request is sent to the old pod by k8s, telling it that it is about to be updated

  3. Old pod gets polled about update readiness

  4. Old pod gets its affairs in order (e.g. stop receiving new tasks, finishes existing tasks)

  5. Old pod says it is ready

  6. Old pod gets replaced









share|improve this question




























    3















    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:



    1. An updated pod is ready to replace an old one

    2. A request is sent to the old pod by k8s, telling it that it is about to be updated

    3. Old pod gets polled about update readiness

    4. Old pod gets its affairs in order (e.g. stop receiving new tasks, finishes existing tasks)

    5. Old pod says it is ready

    6. Old pod gets replaced









    share|improve this question
























      3












      3








      3








      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:



      1. An updated pod is ready to replace an old one

      2. A request is sent to the old pod by k8s, telling it that it is about to be updated

      3. Old pod gets polled about update readiness

      4. Old pod gets its affairs in order (e.g. stop receiving new tasks, finishes existing tasks)

      5. Old pod says it is ready

      6. Old pod gets replaced









      share|improve this question














      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:



      1. An updated pod is ready to replace an old one

      2. A request is sent to the old pod by k8s, telling it that it is about to be updated

      3. Old pod gets polled about update readiness

      4. Old pod gets its affairs in order (e.g. stop receiving new tasks, finishes existing tasks)

      5. Old pod says it is ready

      6. Old pod gets replaced






      kubernetes






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 8:55









      Kosmas PapadatosKosmas Papadatos

      6472824




      6472824






















          1 Answer
          1






          active

          oldest

          votes


















          6














          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"]





          share|improve this answer























          • 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











          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
          );



          );













          draft saved

          draft discarded


















          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









          6














          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"]





          share|improve this answer























          • 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















          6














          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"]





          share|improve this answer























          • 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













          6












          6








          6







          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"]





          share|improve this answer













          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"]






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 24 at 9:06









          syllabixsyllabix

          1,373812




          1,373812












          • 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

















          • 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
















          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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

          밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

          1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴