“kubectl wait” waits forever Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!kibana in the kebernets cluster doesn't workWait for canal pod before scheduling pods on new nodeWhy does kubernetes produce multiple errors when CPU usage is high?Finding the name of a new pod with kubectlList of Kubernetes status conditions for jobs?spark driver pod stuck in Waiting: PodInitializing state in KubernetesCan you auto destroy a kubernetes pod deployment?How to check when “kubectl delete” failed with “timeout waiting for … to be synced”Kubernetes Job Status checkDoesn't Kubernetes honor HPA configuration when we execute “kubectl scale deploy”?
Book with legacy programming code on a space ship that the main character hacks to escape
Will I lose my paid in full property
How to not starve gigantic beasts
Multiple fireplaces in an apartment building?
Could moose/elk survive in the Amazon forest?
Suing a Police Officer Instead of the Police Department
c++ diamond problem - How to call base method only once
Function to calculate red-edgeNDVI in Google Earth Engine
Are all CP/M-80 implementations binary compatible?
Error: Syntax error. Missing ')' for CASE Statement
Where did Arya get these scars?
Visa-free travel to the US using refugee travel document from Spain?
What's the difference between using dependency injection with a container and using a service locator?
My admission is revoked after accepting the admission offer
A Paper Record is What I Hamper
How long after the last departure shall the airport stay open for an emergency return?
Mistake in years of experience in resume?
Trumpet valves, lengths, and pitch
Is accepting an invalid credit card number a security issue?
What is the least dense liquid under normal conditions?
How can I wire a 9-position switch so that each position turns on one more LED than the one before?
Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?
Do I need to protect SFP ports and optics from dust/contaminants? If so, how?
What is the ongoing value of the Kanban board to the developers as opposed to management
“kubectl wait” waits forever
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!kibana in the kebernets cluster doesn't workWait for canal pod before scheduling pods on new nodeWhy does kubernetes produce multiple errors when CPU usage is high?Finding the name of a new pod with kubectlList of Kubernetes status conditions for jobs?spark driver pod stuck in Waiting: PodInitializing state in KubernetesCan you auto destroy a kubernetes pod deployment?How to check when “kubectl delete” failed with “timeout waiting for … to be synced”Kubernetes Job Status checkDoesn't Kubernetes honor HPA configuration when we execute “kubectl scale deploy”?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm trying to write a little shell script that is checking the log output of a long running Kubernetes Pod when the Pod is done.
The script shall wait for status "Completed" but the following command does not exit when the status is switching from "Running" to "Completed":
$ kubectl wait --for=condition=Completed --timeout=24h pod/longrunningpodname
^C
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
longrunningpodname 0/1 Completed 0 18h
I would also expect the command to return immediately if the Pod is already in the status. But that doesn't happen.
Is kubectl wait not the command I'm looking for?
kubernetes kubectl
add a comment |
I'm trying to write a little shell script that is checking the log output of a long running Kubernetes Pod when the Pod is done.
The script shall wait for status "Completed" but the following command does not exit when the status is switching from "Running" to "Completed":
$ kubectl wait --for=condition=Completed --timeout=24h pod/longrunningpodname
^C
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
longrunningpodname 0/1 Completed 0 18h
I would also expect the command to return immediately if the Pod is already in the status. But that doesn't happen.
Is kubectl wait not the command I'm looking for?
kubernetes kubectl
add a comment |
I'm trying to write a little shell script that is checking the log output of a long running Kubernetes Pod when the Pod is done.
The script shall wait for status "Completed" but the following command does not exit when the status is switching from "Running" to "Completed":
$ kubectl wait --for=condition=Completed --timeout=24h pod/longrunningpodname
^C
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
longrunningpodname 0/1 Completed 0 18h
I would also expect the command to return immediately if the Pod is already in the status. But that doesn't happen.
Is kubectl wait not the command I'm looking for?
kubernetes kubectl
I'm trying to write a little shell script that is checking the log output of a long running Kubernetes Pod when the Pod is done.
The script shall wait for status "Completed" but the following command does not exit when the status is switching from "Running" to "Completed":
$ kubectl wait --for=condition=Completed --timeout=24h pod/longrunningpodname
^C
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
longrunningpodname 0/1 Completed 0 18h
I would also expect the command to return immediately if the Pod is already in the status. But that doesn't happen.
Is kubectl wait not the command I'm looking for?
kubernetes kubectl
kubernetes kubectl
asked Mar 22 at 15:54
SimonSimon
82
82
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The use of bare pods is not the best approach to run commands that must finish. Consider using a Job Controller:
A Job creates one or more Pods and ensures that a specified number of
them successfully terminate. As pods successfully complete, the Job
tracks the successful completions.
Then, you can wait for the job condition:kubectl wait --for=condition=complete --timeout=24h job/longrunningjobname
1
Okay, this works: I've changed the yaml config from pod to job and have to use --for=condition=complete instead of --for=condition=completed. That did the trick. Thank you!
– Simon
Mar 23 at 10:30
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%2f55303430%2fkubectl-wait-waits-forever%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
The use of bare pods is not the best approach to run commands that must finish. Consider using a Job Controller:
A Job creates one or more Pods and ensures that a specified number of
them successfully terminate. As pods successfully complete, the Job
tracks the successful completions.
Then, you can wait for the job condition:kubectl wait --for=condition=complete --timeout=24h job/longrunningjobname
1
Okay, this works: I've changed the yaml config from pod to job and have to use --for=condition=complete instead of --for=condition=completed. That did the trick. Thank you!
– Simon
Mar 23 at 10:30
add a comment |
The use of bare pods is not the best approach to run commands that must finish. Consider using a Job Controller:
A Job creates one or more Pods and ensures that a specified number of
them successfully terminate. As pods successfully complete, the Job
tracks the successful completions.
Then, you can wait for the job condition:kubectl wait --for=condition=complete --timeout=24h job/longrunningjobname
1
Okay, this works: I've changed the yaml config from pod to job and have to use --for=condition=complete instead of --for=condition=completed. That did the trick. Thank you!
– Simon
Mar 23 at 10:30
add a comment |
The use of bare pods is not the best approach to run commands that must finish. Consider using a Job Controller:
A Job creates one or more Pods and ensures that a specified number of
them successfully terminate. As pods successfully complete, the Job
tracks the successful completions.
Then, you can wait for the job condition:kubectl wait --for=condition=complete --timeout=24h job/longrunningjobname
The use of bare pods is not the best approach to run commands that must finish. Consider using a Job Controller:
A Job creates one or more Pods and ensures that a specified number of
them successfully terminate. As pods successfully complete, the Job
tracks the successful completions.
Then, you can wait for the job condition:kubectl wait --for=condition=complete --timeout=24h job/longrunningjobname
edited Mar 22 at 17:00
answered Mar 22 at 16:55
Eduardo BaitelloEduardo Baitello
1,059522
1,059522
1
Okay, this works: I've changed the yaml config from pod to job and have to use --for=condition=complete instead of --for=condition=completed. That did the trick. Thank you!
– Simon
Mar 23 at 10:30
add a comment |
1
Okay, this works: I've changed the yaml config from pod to job and have to use --for=condition=complete instead of --for=condition=completed. That did the trick. Thank you!
– Simon
Mar 23 at 10:30
1
1
Okay, this works: I've changed the yaml config from pod to job and have to use --for=condition=complete instead of --for=condition=completed. That did the trick. Thank you!
– Simon
Mar 23 at 10:30
Okay, this works: I've changed the yaml config from pod to job and have to use --for=condition=complete instead of --for=condition=completed. That did the trick. Thank you!
– Simon
Mar 23 at 10:30
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%2f55303430%2fkubectl-wait-waits-forever%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