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

add a clusterquota reconciliation controller #9658

Merged
merged 2 commits into from
Jul 7, 2016

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Jun 30, 2016

This adds the controller to do the priming, handle namespaces coming and going, and replenishment.

It's still short tests, but an algorithmic check is welcome.

@Kargakis


&kapi.DeleteOptions{},
&kapi.ListOptions{},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why ListOptions is twice here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also shouldn't kapi objects be registered upstream?

@deads2k deads2k force-pushed the cq-07-controller branch from f1cac3f to 7981eaa Compare July 1, 2016 17:14
@deads2k deads2k changed the title [WIP] add a clusterquota reconciliation controller add a clusterquota reconciliation controller Jul 1, 2016
@deads2k
Copy link
Contributor Author

deads2k commented Jul 1, 2016

Updated, test added, ready for review. [test]

@deads2k
Copy link
Contributor Author

deads2k commented Jul 1, 2016

@jwforres @spadgett This should give you enough to see the appliedclusterresourcequotas resource inside of the namespace and get its status. There's no restriction happening yet, but it does do tracking.

@deads2k deads2k force-pushed the cq-07-controller branch from 7981eaa to 3b1595f Compare July 1, 2016 17:28
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 3, 2016
@deads2k deads2k force-pushed the cq-07-controller branch from 3b1595f to 7a75270 Compare July 5, 2016 12:24
@deads2k
Copy link
Contributor Author

deads2k commented Jul 5, 2016

#9701 re[test]

@deads2k
Copy link
Contributor Author

deads2k commented Jul 5, 2016

@liggitt ptal

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 5, 2016
@deads2k deads2k mentioned this pull request Jul 5, 2016
4 tasks
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 5, 2016
@deads2k deads2k force-pushed the cq-07-controller branch from 7a75270 to 477cf34 Compare July 6, 2016 12:28
@@ -48,6 +49,13 @@ func (c *clusterResourceQuotas) Create(resourceQuota *quotaapi.ClusterResourceQu
return
}

// Update updates an existing deploymentConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix or remove

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 6, 2016
kapi.Kind("ReplicationController"),
kapi.Kind("PersistentVolumeClaim"),
kapi.Kind("Secret"),
kapi.Kind("ConfigMap"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these all we can replenish? Image strems? Deployment configs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are these all we can replenish? Image strems? Deployment configs?

for now, there's an item on the card: https://trello.com/c/qJUVjQnj/713-13-multi-project-quota

Copy link
Member

Choose a reason for hiding this comment

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

I will add a utility method upstream to pull this list so we can pull from a common set?

Copy link
Member

Choose a reason for hiding this comment

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

Opened tracking issue: kubernetes/kubernetes#28601

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add a utility method upstream to pull this list so we can pull from a common set?

It's more structurally flawed. The choice should be based on GroupResource and that needs to built based on an intersection with enabled resources. It doesn't actually have to be limited to this server's hosting, since it could observe changes in federated servers.

In addition, we need to extend our InformerFactory to transparently handle generic listener requests to properly feed this beast.

We should probably restructure the replenishment controller to work as a listener/notifier and upstream the bucketter I built here to be able to handle partial updates.

I haven't prioritized the list of TODOs, but its a significant endeavor.

@0xmichalis
Copy link
Contributor

I left some comments but @derekwaynecarr or @liggitt should have a look as well

@deads2k deads2k force-pushed the cq-07-controller branch from 477cf34 to b840c68 Compare July 6, 2016 17:21
}

// MappingChangeListener is notified of changes to the mapping. It must not block.
type MappingChangeListener interface {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The listener is new, the rest of this is a straight move. Don't fear.

@deads2k
Copy link
Contributor Author

deads2k commented Jul 7, 2016

@derekwaynecarr @liggitt bump

m.lock.RUnlock()

if !selectorMatches(selector, selectorExists, quota) {
return false, false, true
Copy link
Contributor

Choose a reason for hiding this comment

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

how do we know the namespace matches? don't we need to evaluate labelsMatch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how do we know the namespace matches? don't we need to evaluate labelsMatch?

added

@deads2k deads2k force-pushed the cq-07-controller branch from b840c68 to cca0e89 Compare July 7, 2016 12:01
@deads2k
Copy link
Contributor Author

deads2k commented Jul 7, 2016

Comments addressed. Did you make it all the way through? This upstream has permission to [merge].

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to cca0e89

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/5881/)

@openshift-bot
Copy link
Contributor

openshift-bot commented Jul 7, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/5881/) (Image: devenv-rhel7_4543)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to cca0e89

@openshift-bot openshift-bot merged commit 1cb1dac into openshift:master Jul 7, 2016
delete(e.dirtyWork, key)

if len(work) != 0 {
e.inProgress[key] = true
Copy link
Contributor

@liggitt liggitt Jul 7, 2016

Choose a reason for hiding this comment

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

need to set this unconditionally, otherwise any work enqueued before Done() is called will be put into work instead of dirtyWork, and lost when Done() is called and we do e.work[key] = e.dirtyWork[key]

@derekwaynecarr
Copy link
Member

Great work, this LGTM.

@deads2k deads2k deleted the cq-07-controller branch September 6, 2016 17:17
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.

5 participants