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

[Federation] Update namespace support to use the sync controller #47890

Merged
merged 4 commits into from
Jul 14, 2017

Conversation

marun
Copy link
Contributor

@marun marun commented Jun 22, 2017

This PR moves namespaces to use the sync controller.

cc: @kubernetes/sig-federation-pr-reviews

@marun marun added release-note-none Denotes a PR that doesn't merit a release note. sig/federation labels Jun 22, 2017
@k8s-ci-robot k8s-ci-robot added sig/federation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 22, 2017
@k8s-github-robot k8s-github-robot assigned colhom and ghost Jun 22, 2017
@k8s-github-robot k8s-github-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jun 22, 2017
@marun
Copy link
Contributor Author

marun commented Jun 22, 2017

@nikhiljindal The deletion check in the crud integration test is failing. I think the finalizer is being removed in the federated namespace, but removal in member clusters is failing with the following error:

E0621 22:03:04.526227   10013 controller.go:355] Failed to delete namespace "test-namespace-4vgtb": failed to execute updates for obj test-namespace-4vgtb: Operation cannot be fulfilled on namespaces "test-namespace-4vgtb": The system is ensuring all content is removed from this namespace.  Upon completion, this namespace will automatically be purged by the system.

How is the finalizer intended to be removed from member clusters? Is there a controller that does this, and maybe it's not running on the member clusters configured for the integration tests?

@nikhiljindal
Copy link
Contributor

The finalizer should not be propagated to resources in underlying clusters.

Note that namespaces is special in that NamespaceSpec has its own finalizers as well: https://github.com/kubernetes/kubernetes/blob/master/pkg/api/v1/types.go#L3601 (we added finalizer support to namespaces first before adding the generic field in ObjectMeta for all resources).

@marun
Copy link
Contributor Author

marun commented Jun 22, 2017

@nikhiljindal The kubernetes finalizer is the one I was talking about. I'm assuming a controller in a member cluster is responsible for removing it?

Edit: Looks like the NamespaceController will need to be running.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 22, 2017
@nikhiljindal
Copy link
Contributor

Yes i was talking about our federation finalizers. We do not propagate them to underlying clusters.

You are right, NamespaceController running in all clusters remove the kubernetes finalizer. Its used to ensure that all resources in a namespace are deleted when the namespace is deleted.

@marun marun changed the title WIP [Federation] Update namespace support to use the sync controller [Federation] Update namespace support to use the sync controller Jun 23, 2017
@marun
Copy link
Contributor Author

marun commented Jun 23, 2017

A namespace controller is now running for each member cluster in the federation fixture.

I'm reusing the namespace controller fixture from test/e2e_node/services for now. I'm assuming this should be extracted for reuse? Is it just me, or is e2e_node more in keeping with integration testing than e2e?

cc: @kubernetes/sig-node-pr-reviews @kubernetes/sig-testing-misc

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Jun 23, 2017
@marun marun force-pushed the fed-namespace-sync branch 2 times, most recently from 3300e40 to bb9f4f8 Compare June 23, 2017 01:00
@marun
Copy link
Contributor Author

marun commented Jun 23, 2017

@emaildanwilson I noticed while working on this that the negative selector integration test takes 30s. I think I was the one suggesting a long timeout was a good idea, but on second thought I think it makes sense to break the selector tests into their own test so the CRUD tests can be run faster while working on the sync controller and the adapters.

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 23, 2017
@marun
Copy link
Contributor Author

marun commented Jun 23, 2017

/test pull-kubernetes-unit

Flakey integration test? Yuck!

@marun
Copy link
Contributor Author

marun commented Jun 23, 2017

wth. git rebase fail!

@k8s-github-robot k8s-github-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/new-api labels Jun 23, 2017
@perotinus
Copy link
Contributor

Overall, this LGTM.

@emaildanwilson
Copy link
Contributor

@marun yes, that sounds annoying to deal with. I'll get it moved out into a separate test.

@marun
Copy link
Contributor Author

marun commented Jul 5, 2017

rebased

@marun
Copy link
Contributor Author

marun commented Jul 5, 2017

/test pull-kubernetes-e2e-gce-etcd3

@marun
Copy link
Contributor Author

marun commented Jul 6, 2017

@perotinus bump

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2017
@marun
Copy link
Contributor Author

marun commented Jul 12, 2017

rebased

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 12, 2017
APIFixture *FederationAPIFixture
DesiredClusterCount int
Clusters []*MemberCluster
namespaceControllers []*services.NamespaceController
Copy link
Contributor

Choose a reason for hiding this comment

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

This appears to have been moved into the MemberCluster struct instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@csbell
Copy link
Contributor

csbell commented Jul 13, 2017

/lgtm
/approve no-issue

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 13, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: csbell, marun

Associated issue requirement bypassed by: csbell

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 13, 2017
@marun
Copy link
Contributor Author

marun commented Jul 13, 2017

/test pull-kubernetes-federation-e2e-gce

1 similar comment
@csbell
Copy link
Contributor

csbell commented Jul 13, 2017

/test pull-kubernetes-federation-e2e-gce

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 47999, 47890)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants