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

Rename API group "networking" to "controlplane" #1147

Merged
merged 2 commits into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -637,7 +637,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -768,12 +768,20 @@ rules:
- apiregistration.k8s.io
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -1110,9 +1118,9 @@ kind: APIService
metadata:
labels:
app: antrea
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
Expand Down
18 changes: 13 additions & 5 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -637,7 +637,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -768,12 +768,20 @@ rules:
- apiregistration.k8s.io
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -1110,9 +1118,9 @@ kind: APIService
metadata:
labels:
app: antrea
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
Expand Down
18 changes: 13 additions & 5 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -637,7 +637,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -768,12 +768,20 @@ rules:
- apiregistration.k8s.io
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -1110,9 +1118,9 @@ kind: APIService
metadata:
labels:
app: antrea
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
Expand Down
18 changes: 13 additions & 5 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -637,7 +637,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -768,12 +768,20 @@ rules:
- apiregistration.k8s.io
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -1119,9 +1127,9 @@ kind: APIService
metadata:
labels:
app: antrea
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
Expand Down
18 changes: 13 additions & 5 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -637,7 +637,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down Expand Up @@ -768,12 +768,20 @@ rules:
- apiregistration.k8s.io
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resourceNames:
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
- apiservices
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -1110,9 +1118,9 @@ kind: APIService
metadata:
labels:
app: antrea
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
Expand Down
2 changes: 1 addition & 1 deletion build/yamls/base/agent-rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rules:
- update
- delete
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down
2 changes: 1 addition & 1 deletion build/yamls/base/antctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
name: antctl
rules:
- apiGroups:
- networking.antrea.tanzu.vmware.com
- controlplane.antrea.tanzu.vmware.com
resources:
- networkpolicies
- appliedtogroups
Expand Down
12 changes: 11 additions & 1 deletion build/yamls/base/controller-rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,20 @@ rules:
- apiservices
resourceNames:
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
verbs:
- get
- update
- apiGroups:
- apiregistration.k8s.io
resources:
- apiservices
resourceNames:
# Add the APIServices for the deprecated APIGroups here. antrea-controller
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding the comment!

Copy link
Contributor

Choose a reason for hiding this comment

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

do we have a timeline in terms of releases for how long we plan to attempt deleting old apiservices? ie after X releases we will no longer clean up..

# will try to delete the APIServices if they are registered.
- v1beta1.networking.antrea.tanzu.vmware.com
verbs:
- delete
- apiGroups:
- security.antrea.tanzu.vmware.com
resources:
Expand Down
4 changes: 2 additions & 2 deletions build/yamls/base/controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ metadata:
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
name: v1beta1.networking.antrea.tanzu.vmware.com
name: v1beta1.controlplane.antrea.tanzu.vmware.com
spec:
group: networking.antrea.tanzu.vmware.com
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
version: v1beta1
versionPriority: 100
Expand Down
2 changes: 1 addition & 1 deletion cmd/antrea-agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"github.com/vmware-tanzu/antrea/pkg/agent/proxy"
"github.com/vmware-tanzu/antrea/pkg/agent/querier"
"github.com/vmware-tanzu/antrea/pkg/agent/route"
"github.com/vmware-tanzu/antrea/pkg/apis/networking/v1beta1"
"github.com/vmware-tanzu/antrea/pkg/apis/controlplane/v1beta1"
crdinformers "github.com/vmware-tanzu/antrea/pkg/client/informers/externalversions"
"github.com/vmware-tanzu/antrea/pkg/features"
"github.com/vmware-tanzu/antrea/pkg/k8s"
Expand Down
6 changes: 6 additions & 0 deletions cmd/antrea-controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ func run(o *Options) error {
if err != nil {
return fmt.Errorf("error creating API server: %v", err)
}

err = apiserver.CleanupDeprecatedAPIServices(aggregatorClient)
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't think of it too much but does the order matter here? should we remove deprecated APIServices before installing the new ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Installation happens locally on controller, and new APIServices are already registered when applying the YAML. Before apiserver starts, K8s knows nothing about the new API groups. So, I think it does not matter.

if err != nil {
return fmt.Errorf("failed to clean up the deprecated APIServices: %v", err)
}

// Set up signal capture: the first SIGTERM / SIGINT signal is handled gracefully and will
// cause the stopCh channel to be closed; if another signal is received before the program
// exits, we will force exit.
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ the Kubernetes API and handles authentication.
# Start the proxy in the background
kubectl proxy &
# Access the antrea-controller API path
curl 127.0.0.1:8001/apis/networking.antrea.tanzu.vmware.com
curl 127.0.0.1:8001/apis/controlplane.antrea.tanzu.vmware.com
```

### Directly accessing the antrea-controller API
Expand Down
12 changes: 6 additions & 6 deletions hack/update-codegen-dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $GOPATH/bin/client-gen \
--clientset-name versioned \
--input-base "${ANTREA_PKG}/pkg/apis/" \
--input "clusterinformation/v1beta1" \
--input "networking/v1beta1" \
--input "controlplane/v1beta1" \
--input "system/v1beta1" \
--input "security/v1alpha1" \
--input "core/v1alpha1" \
Expand All @@ -56,8 +56,8 @@ $GOPATH/bin/informer-gen \

$GOPATH/bin/deepcopy-gen \
--input-dirs "${ANTREA_PKG}/pkg/apis/clusterinformation/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/networking" \
--input-dirs "${ANTREA_PKG}/pkg/apis/networking/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/controlplane" \
--input-dirs "${ANTREA_PKG}/pkg/apis/controlplane/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/system/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/security/v1alpha1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/core/v1alpha1" \
Expand All @@ -66,12 +66,12 @@ $GOPATH/bin/deepcopy-gen \
--go-header-file hack/boilerplate/license_header.go.txt

$GOPATH/bin/conversion-gen \
--input-dirs "${ANTREA_PKG}/pkg/apis/networking/v1beta1,${ANTREA_PKG}/pkg/apis/networking/" \
--input-dirs "${ANTREA_PKG}/pkg/apis/controlplane/v1beta1,${ANTREA_PKG}/pkg/apis/controlplane/" \
-O zz_generated.conversion \
--go-header-file hack/boilerplate/license_header.go.txt

$GOPATH/bin/openapi-gen \
--input-dirs "${ANTREA_PKG}/pkg/apis/networking/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/controlplane/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/clusterinformation/v1beta1" \
--input-dirs "${ANTREA_PKG}/pkg/apis/system/v1beta1" \
--input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/util/intstr" \
Expand Down Expand Up @@ -118,7 +118,7 @@ git checkout HEAD -- hack/boilerplate/license_header.raw.txt
go mod vendor
$GOPATH/bin/go-to-protobuf \
--proto-import vendor \
--packages "${ANTREA_PKG}/pkg/apis/networking/v1beta1" \
--packages "${ANTREA_PKG}/pkg/apis/controlplane/v1beta1" \
--go-header-file hack/boilerplate/license_header.go.txt
# Clean up vendor directory.
rm -rf vendor
Expand Down
Loading