Skip to content

Commit

Permalink
API change: controlplane v1beta2 (#1467)
Browse files Browse the repository at this point in the history
* Upgrade ExternalEntity to v1alpha2 and controlplane API to v1beta2 (#1405)

* Upgrade ExternalEntity to v1alpha2 and update GroupMember struct

* Add more UT

* Add backward-comp UT testcases and address comments

* Address more comments

* Update controlplane.v1alpha1 to controlplane.v1alpha2

* Remove External Entity v1alpha1 support

* Fix yaml errors for v1alpha1 ExternalEntities

* Add upgrade tests into actions for controlplane v1beta2 branch

* Deprecate GroupMemberPod (#1416)

- Remove GroupMemberPod entirely
- Update AddressGroup and AppliedToGroup conversions
- Always add PodRef for GroupMember

* Make controlplane NetworkPolicy cluster scoped (#1445)

The namespace and name of the controlplane NetworkPolicy were copied
from the namespace and name of its original NetworkPolicy. If a Antrea
NetworkPolicy and a K8s NetworkPolicy have the same namespace and name,
they would override each other when converting to controlplane
NetworkPolicy. Besides, similar to appliedToGroup and addressGroup, the
controlplane NetworkPolicy should be cluster scoped.

This patch makes the controlplane NetworkPolicy cluster scoped and
changes to use the UID of the original NetworkPolicy as its name to
ensure uniqueness.

Co-authored-by: Quan Tian <qtian@vmware.com>
  • Loading branch information
Dyanngg and tnqn committed Nov 2, 2020
1 parent 3c4899e commit ae45cc8
Show file tree
Hide file tree
Showing 122 changed files with 12,526 additions and 2,718 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ jobs:
- name: Run e2e tests
run: |
mkdir log
mkdir test-e2e-encap-np-coverage
mkdir test-e2e-encap-np-coverage
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-np-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --np --coverage
- name: Tar coverage files
run: tar -czf test-e2e-encap-np-coverage.tar.gz test-e2e-encap-np-coverage
Expand Down
46 changes: 34 additions & 12 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ spec:
singular: externalentity
scope: Namespaced
versions:
- name: v1alpha1
- name: v1alpha2
schema:
openAPIV3Schema:
properties:
Expand All @@ -216,25 +216,31 @@ spec:
type: string
name:
type: string
ports:
items:
properties:
name:
type: string
port:
x-kubernetes-int-or-string: true
protocol:
type: string
type: object
type: array
type: object
type: array
externalNode:
type: string
ports:
items:
properties:
name:
type: string
port:
x-kubernetes-int-or-string: true
protocol:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
- name: v1alpha1
schema:
openAPIV3Schema:
type: object
served: false
storage: false
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -932,6 +938,7 @@ rules:
resourceNames:
- v1alpha1.stats.antrea.tanzu.vmware.com
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta2.controlplane.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -1374,6 +1381,21 @@ spec:
version: v1beta1
versionPriority: 100
---
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
labels:
app: antrea
name: v1beta2.controlplane.antrea.tanzu.vmware.com
spec:
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
namespace: kube-system
version: v1beta2
versionPriority: 100
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down
46 changes: 34 additions & 12 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ spec:
singular: externalentity
scope: Namespaced
versions:
- name: v1alpha1
- name: v1alpha2
schema:
openAPIV3Schema:
properties:
Expand All @@ -216,25 +216,31 @@ spec:
type: string
name:
type: string
ports:
items:
properties:
name:
type: string
port:
x-kubernetes-int-or-string: true
protocol:
type: string
type: object
type: array
type: object
type: array
externalNode:
type: string
ports:
items:
properties:
name:
type: string
port:
x-kubernetes-int-or-string: true
protocol:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
- name: v1alpha1
schema:
openAPIV3Schema:
type: object
served: false
storage: false
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -932,6 +938,7 @@ rules:
resourceNames:
- v1alpha1.stats.antrea.tanzu.vmware.com
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta2.controlplane.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -1374,6 +1381,21 @@ spec:
version: v1beta1
versionPriority: 100
---
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
labels:
app: antrea
name: v1beta2.controlplane.antrea.tanzu.vmware.com
spec:
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
namespace: kube-system
version: v1beta2
versionPriority: 100
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down
46 changes: 34 additions & 12 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ spec:
singular: externalentity
scope: Namespaced
versions:
- name: v1alpha1
- name: v1alpha2
schema:
openAPIV3Schema:
properties:
Expand All @@ -216,25 +216,31 @@ spec:
type: string
name:
type: string
ports:
items:
properties:
name:
type: string
port:
x-kubernetes-int-or-string: true
protocol:
type: string
type: object
type: array
type: object
type: array
externalNode:
type: string
ports:
items:
properties:
name:
type: string
port:
x-kubernetes-int-or-string: true
protocol:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
- name: v1alpha1
schema:
openAPIV3Schema:
type: object
served: false
storage: false
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -932,6 +938,7 @@ rules:
resourceNames:
- v1alpha1.stats.antrea.tanzu.vmware.com
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta2.controlplane.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -1374,6 +1381,21 @@ spec:
version: v1beta1
versionPriority: 100
---
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
labels:
app: antrea
name: v1beta2.controlplane.antrea.tanzu.vmware.com
spec:
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
namespace: kube-system
version: v1beta2
versionPriority: 100
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down
46 changes: 34 additions & 12 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ spec:
singular: externalentity
scope: Namespaced
versions:
- name: v1alpha1
- name: v1alpha2
schema:
openAPIV3Schema:
properties:
Expand All @@ -216,25 +216,31 @@ spec:
type: string
name:
type: string
ports:
items:
properties:
name:
type: string
port:
x-kubernetes-int-or-string: true
protocol:
type: string
type: object
type: array
type: object
type: array
externalNode:
type: string
ports:
items:
properties:
name:
type: string
port:
x-kubernetes-int-or-string: true
protocol:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
- name: v1alpha1
schema:
openAPIV3Schema:
type: object
served: false
storage: false
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -932,6 +938,7 @@ rules:
resourceNames:
- v1alpha1.stats.antrea.tanzu.vmware.com
- v1beta1.system.antrea.tanzu.vmware.com
- v1beta2.controlplane.antrea.tanzu.vmware.com
- v1beta1.controlplane.antrea.tanzu.vmware.com
- v1beta1.networking.antrea.tanzu.vmware.com
resources:
Expand Down Expand Up @@ -1388,6 +1395,21 @@ spec:
version: v1beta1
versionPriority: 100
---
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
labels:
app: antrea
name: v1beta2.controlplane.antrea.tanzu.vmware.com
spec:
group: controlplane.antrea.tanzu.vmware.com
groupPriorityMinimum: 100
service:
name: antrea
namespace: kube-system
version: v1beta2
versionPriority: 100
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down
Loading

0 comments on commit ae45cc8

Please sign in to comment.