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

Change the RestartPolicy processing logic in ReplicationController and NodeController #6273

Closed
wants to merge 1 commit into from

Conversation

jiangliyang
Copy link

We think ReplicationController should allow pod's RestartPolicy to be OnFailure and Never(it is just allowed to be Always now). We also think NodeController should consider the RestartPolicy when deleting pods.

ReplicationController allows pod RestartPolicy to be Always, OnFailure
and Never. NodeController should consider the RestartPolicy when
deleting pods.

add some tests for replication controller
Testing restart policy
@googlebot
Copy link

Thanks for your pull request.

It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA) at https://cla.developers.google.com/.

If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check the information on your CLA or see this help article on setting the email on your git commits.

Once you've done that, please reply here to let us know. If you signed the CLA as a corporation, please let us know the company's name.

@bgrant0607
Copy link
Member

Thank you for the PR. Unfortunately, we've already discussed this -- multiple times -- and decided that another controller should take responsibility for bounded-duration pods. Please see #1624 and #3058.

@bgrant0607 bgrant0607 self-assigned this Apr 1, 2015
if api.RestartPolicyNever == pod.Spec.RestartPolicy {
continue
} else if api.RestartPolicyOnFailure == pod.Spec.RestartPolicy {
if api.PodSucceeded == pod.Status.Phase {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the rationale behind this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your reply.
Please see this use case:
We create a pod called myPod which is used to process a text file and its RestartPolicy is OnFailure. If the pod's status is PodSucceeded, we think the processing is complete.
Now we assume that a node has been crashed, the NodeController may delete all the pods (include myPod) on this node. When the node reboot, myPod will be run twice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The right way to do this would be to add a job controller API to the system. #1624

There is a GSoC proposal for this. In the meantime, we're trying to make it simpler and more efficient to add a new controller to the system.

@bgrant0607
Copy link
Member

Thank you for the PR. Please follow up on #1624.

@bgrant0607 bgrant0607 closed this Apr 21, 2015
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