Bug 1689839 - Re-enable Service API federation failed.
Summary: Re-enable Service API federation failed.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Federation
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 4.1.0
Assignee: Ivan Font
QA Contact: Qin Ping
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-18 09:25 UTC by Qin Ping
Modified: 2019-05-17 15:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-17 15:30:36 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Qin Ping 2019-03-18 09:25:27 UTC
Description of problem:
Disable API federation failed with the same API name used in enable API federation


Version-Release number of selected component (if applicable):
kubefed2 version: version.Info{Version:"0.0.6", GitCommit:"de6a0a909418f5ddf2d04d232b0ca55aa9cffb49", GitTreeState:"clean", BuildDate:"2019-03-14T00:43:37Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

Federation v2 controller-manager version: version.Info{Version:"0.0.6", GitCommit:"de6a0a909418f5ddf2d04d232b0ca55aa9cffb49", GitTreeState:"clean", BuildDate:"2019-03-14T00:43:37Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.0.0-0.nightly-2019-03-15-063749   True        False         3h32m   Cluster version is 4.0.0-0.nightly-2019-03-15-063749



How reproducible:
100%

Steps to Reproduce:
1. Install federationv2 control plane under default namespace.
2. Create cluster federation with cmd: ./kubefed2 join cluster1 --host-cluster-context=admin ----cluster-context=admin --federation-namespace=default --registry-namespace=default --limited-scope --add-to-registry
3. Enable Namespace API federation with cmd: ./kubefed2 enable Namespace --host-cluster-context=admin --federation-namespace=default
4. Enable Service API federation with cmd: ./kubefed2 enable Service --host-cluster-context=admin --federation-namespace=default
5. Disable Service API federation with cmd: ./kubefed2 disable services --host-cluster-context=admin --federation-namespace=default
6. Re-enable Service API federation with cmd: ./kubefed2 enable Service --host-cluster-context=admin --federation-namespace=default

Actual results:
F0318 17:23:34.751346    3657 enable.go:109] error: Error creating CRD "federatedservices.types.federation.k8s.io": customresourcedefinitions.apiextensions.k8s.io "federatedservices.types.federation.k8s.io" already exists

Expected results:
Enable Service API federation successfully.


Additional info:
From the control plane logs, we can see federation controller for service is stop and start successfully.

I0318 09:19:44.939207       1 controller.go:133] Running reconcile FederatedTypeConfig for "default/services"
I0318 09:19:44.939251       1 controller.go:299] Stopping controller for "services"
I0318 09:19:44.939287       1 controller.go:117] Running reconcile FederatedTypeConfig for "default/services"
I0318 09:19:44.939495       1 federated_informer.go:298] Stopping federated informer.
I0318 09:19:44.939504       1 federated_informer.go:302] ... Closing cluster informer channel.
I0318 09:19:44.939512       1 federated_informer.go:305] ... Closing informer channel for "cluster1".
I0318 09:19:44.949343       1 controller.go:117] Running reconcile FederatedTypeConfig for "default/services"
I0318 09:19:44.949600       1 controller.go:133] Running reconcile FederatedTypeConfig for "default/services"
I0318 09:19:44.954431       1 controller.go:117] Running reconcile FederatedTypeConfig for "default/services"
I0318 09:19:44.954522       1 controller.go:133] Running reconcile FederatedTypeConfig for "default/services"

Comment 1 Maru Newby 2019-03-19 03:36:03 UTC
This was fixed in upstream master by https://github.com/kubernetes-sigs/federation-v2/pull/628

Comment 2 Paul Morie 2019-03-19 19:05:09 UTC
This will be fixed once the operator repo is bumped to 0.0.7

Comment 3 Paul Morie 2019-03-29 00:10:18 UTC
Should be fixed in 0.0.7 CSV

Comment 5 Qin Ping 2019-04-01 05:44:33 UTC
Verification failed with:
$ oc get clusterversion
NAME      VERSION                        AVAILABLE   PROGRESSING   SINCE     STATUS
version   4.0.0-0.ci-2019-03-31-223338   True        False         91m       Cluster version is 4.0.0-0.ci-2019-03-31-223338

Federation v2 controller-manager version: version.Info{Version:"v0.0.7", GitCommit:"3e251608ca5357080b95a0bedc45759652f17d29", GitTreeState:"clean", BuildDate:"2019-03-22T22:30:26Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}

kubefed2 version: version.Info{Version:"v0.0.7", GitCommit:"83b778b6d92a7929efb7687d3d3d64bf0b3ad3bc", GitTreeState:"clean", BuildDate:"2019-03-19T18:40:46Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}

Re-enable Service Federation:
kubefed2 enable Service
customresourcedefinition.apiextensions.k8s.io/federatedservices.types.federation.k8s.io updated
F0401 13:42:01.913213    5180 enable.go:112] error: Error creating FederatedTypeConfig "services": federatedtypeconfigs.core.federation.k8s.io "services" already exists

Comment 6 Maru Newby 2019-04-03 04:32:56 UTC
The bug in enabling federation failing due to the crd existing has been fixed.  The new error being reported is relatively benign - the federated type config existing is an indication that the type has been enabled - but I've filed an upstream issue to ensure a better UX:

https://github.com/kubernetes-sigs/federation-v2/issues/720

I've also filed a related bug to ensure that enable/disable are easier to understand:

https://github.com/kubernetes-sigs/federation-v2/issues/721

Comment 7 Ivan Font 2019-04-11 01:33:12 UTC
Upstream PR for fix: https://github.com/kubernetes-sigs/federation-v2/pull/744

Comment 9 Ivan Font 2019-05-13 19:04:12 UTC
Fixed in version 0.0.10.

Comment 10 Qin Ping 2019-05-14 09:59:10 UTC
Verified with:

Federation v2 controller-manager version: version.Info{Version:"v0.0.10", GitCommit:"71d233ede685707df554ef653e06bf7f0229415c", GitTreeState:"clean", BuildDate:"2019-05-06T22:54:46Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}

kubefedctl version: version.Info{Version:"v0.0.10-dirty", GitCommit:"71d233ede685707df554ef653e06bf7f0229415c", GitTreeState:"dirty", BuildDate:"2019-05-06T22:30:31Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}


Note You need to log in before you can comment on or make changes to this bug.