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

Validate no replicationController overlap. #2210

Closed
erictune opened this issue Nov 6, 2014 · 35 comments
Closed

Validate no replicationController overlap. #2210

erictune opened this issue Nov 6, 2014 · 35 comments
Labels
area/controller-manager area/usability lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/apps Categorizes an issue or PR as relevant to SIG Apps.

Comments

@erictune
Copy link
Member

erictune commented Nov 6, 2014

What happens when you make two replication controllers with the same selector, and different number of replicas? Do they battle it out, killing and starting pods.

Consider a validation that makes sure that selectors are disjoint.

@bgrant0607 assures me that this is possible, and that the label/selector semantics are carefully crafted to make just this sort of check possible.

@ddysher
Copy link
Contributor

ddysher commented Nov 14, 2014

Hmm, fierce fighting. I'll take a look.

@ddysher ddysher self-assigned this Nov 14, 2014
@roberthbailey roberthbailey added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Dec 10, 2014
@bgrant0607 bgrant0607 added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Feb 28, 2015
@bgrant0607 bgrant0607 added this to the v1.0 milestone Feb 28, 2015
@bgrant0607
Copy link
Member

cc @davidopp

@bprashanth
Copy link
Contributor

Since I'm working on refactoring replication controller to use generic etcd, is this something we want for v1?

@bgrant0607
Copy link
Member

At least a best-effort check would be nice, but if it's hard we should punt it to post-1.0. It can't be done in validation, unfortunately. See #2395 and #2457. @lavalamp had thoughts about how/where it should be done. I could live without the background checking for 1.0.

@jayunit100
Copy link
Member

related #11990 to clarify the current state of things

@mikedanese
Copy link
Member

fyi #35298

@0xmichalis
Copy link
Contributor

I think overlapping controllers is an obsolete topic with the introduction of owner references in 1.6.

@enisoc
Copy link
Member

enisoc commented Mar 21, 2017

My understanding is that ControllerRef was about protecting the system if the user creates overlapping controllers, but we still don't want the user to do that. If that's the case, we may still want to consider some mechanism for discouraging it.

@ddysher
Copy link
Contributor

ddysher commented May 2, 2017

@enisoc seems kubectl still only uses selector to find matching pods, result in confusing outputs

$ kubectl describe rs replicaset-2
Name:           replicaset-2      
Namespace:      default
Selector:       environment=prod
Labels:         environment=prod
Annotations:    <none>
Replicas:       2 current / 2 desired
Pods Status:    3 Running / 0 Waiting / 0 Succeeded / 0 Failed
Pod Template:
  Labels:       environment=prod
  Containers:
   created-from-replicaset:
    Image:              nginx
    Port:               
    Environment:        <none>
    Mounts:             <none>
  Volumes:              <none>
Events:
  FirstSeen     LastSeen        Count   From                    SubObjectPath   Type            Reason                  Message
  ---------     --------        -----   ----                    -------------   --------        ------                  -------
  5m            5m              1       replicaset-controller                   Normal          SuccessfulCreate        Created pod: replicaset-2-39szb
  5m            5m              1       replicaset-controller                   Normal          SuccessfulCreate        Created pod: replicaset-2-470jr

It reports three running pods (another one being managed via another controller with the same selector), should we add more option while listing?

options := metav1.ListOptions{LabelSelector: selector.String()}

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 23, 2017
@bgrant0607
Copy link
Member

ownerReferences is the solution to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller-manager area/usability lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/apps Categorizes an issue or PR as relevant to SIG Apps.
Projects
None yet
Development

Successfully merging a pull request may close this issue.