Skip to content

Commit

Permalink
ClusterClaim upgrade
Browse files Browse the repository at this point in the history
1. ClusterClaim upgraded to v1alpha2, with removeing the Name of it
2. meta.name in ClusterClaim can only be created as id.k8s.io or
clusterset.k8s.io
3. Deprecate ClusterClaim version v1alpha1

Signed-off-by: zbangqi <[email protected]>
  • Loading branch information
zbangqi committed Jun 14, 2022
1 parent b6fbf14 commit 8916036
Show file tree
Hide file tree
Showing 53 changed files with 700 additions and 454 deletions.
14 changes: 11 additions & 3 deletions docs/multicluster/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,29 @@ used by Antrea Multi-cluster are in the API group `multicluster.crd.antrea.io`,
two CRDs from [mcs-api](https://github.com/kubernetes-sigs/mcs-api) are in group `multicluster.x-k8s.io`
which is defined by Kubernetes upstream [KEP-1645](https://github.com/kubernetes/enhancements/tree/master/keps/sig-multicluster/1645-multi-cluster-services-api).

## CRDs in `multicluster.crd.antrea.io`
## Currently-supported

### CRDs in `multicluster.crd.antrea.io`

| CRD | CRD version | Introduced in | Deprecated in / Planned Deprecation | Planned Removal |
| ------------------------ | ----------- | ------------- | ----------------------------------- | --------------- |
| `ClusterClaims` | v1alpha1 | v1.5.0 | N/A | N/A |
| `ClusterClaims` | v1alpha2 | v1.8.0 | N/A | N/A |
| `ClusterSets` | v1alpha1 | v1.5.0 | N/A | N/A |
| `MemberClusterAnnounces` | v1alpha1 | v1.5.0 | N/A | N/A |
| `ResourceExports` | v1alpha1 | v1.5.0 | N/A | N/A |
| `ResourceImports` | v1alpha1 | v1.5.0 | N/A | N/A |
| `Gateway` | v1alpha1 | v1.7.0 | N/A | N/A |
| `ClusterInfoImport` | v1alpha1 | v1.7.0 | N/A | N/A |

## CRDs in `multicluster.x-k8s.io`
### CRDs in `multicluster.x-k8s.io`

| CRD | CRD version | Introduced in | Deprecated in / Planned Deprecation | Planned Removal |
| ---------------- | ----------- | ------------- | ----------------------------------- | --------------- |
| `ServiceExports` | v1alpha1 | v1.5.0 | N/A | N/A |
| `ServiceImports` | v1alpha1 | v1.5.0 | N/A | N/A |

## Previously-supported CRDs

| CRD | API group | CRD version | Introduced in | Deprecated in | Removed in |
| ------------------------ | ---------------------------- | ----------- | ------------- | ------------- | ---------- |
| `ClusterClaims` | `multicluster.crd.antrea.io` | v1alpha1 | v1.5.0 | v1.8.0 | v1.8.0 |
22 changes: 7 additions & 15 deletions docs/multicluster/user-guide.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,18 @@ with the following YAML manifest (you can also refer to
[multicluster_membercluster_template.yaml](../../multicluster/config/samples/clusterset_init/multicluster_membercluster_template.yaml)):

```yaml
apiVersion: multicluster.crd.antrea.io/v1alpha1
apiVersion: multicluster.crd.antrea.io/v1alpha2
kind: ClusterClaim
metadata:
name: id.k8s.io
namespace: kube-system
name: id.k8s.io
value: test-cluster-east
---
apiVersion: multicluster.crd.antrea.io/v1alpha1
apiVersion: multicluster.crd.antrea.io/v1alpha2
kind: ClusterClaim
metadata:
name: clusterset.k8s.io
namespace: kube-system
name: clusterset.k8s.io
value: test-clusterset
---
apiVersion: multicluster.crd.antrea.io/v1alpha1
Expand Down Expand Up @@ -224,15 +222,13 @@ kind: ClusterClaim
metadata:
name: id.k8s.io
namespace: kube-system
name: id.k8s.io
value: test-cluster-west
---
apiVersion: multicluster.crd.antrea.io/v1alpha1
apiVersion: multicluster.crd.antrea.io/v1alpha2
kind: ClusterClaim
metadata:
name: clusterset.k8s.io
namespace: kube-system
name: clusterset.k8s.io
value: test-clusterset
---
apiVersion: multicluster.crd.antrea.io/v1alpha1
Expand All @@ -255,20 +251,18 @@ spec:
[multicluster_clusterset_template.yaml](../../multicluster/config/samples/clusterset_init/multicluster_clusterset_template.yaml)):

```yaml
apiVersion: multicluster.crd.antrea.io/v1alpha1
apiVersion: multicluster.crd.antrea.io/v1alpha2
kind: ClusterClaim
metadata:
name: id.k8s.io
namespace: antrea-multicluster
name: id.k8s.io
value: test-cluster-north
---
apiVersion: multicluster.crd.antrea.io/v1alpha1
apiVersion: multicluster.crd.antrea.io/v1alpha2
kind: ClusterClaim
metadata:
name: clusterset.k8s.io
namespace: antrea-multicluster
name: clusterset.k8s.io
value: test-clusterset
---
apiVersion: multicluster.crd.antrea.io/v1alpha1
Expand Down Expand Up @@ -303,20 +297,18 @@ Then create the `ClusterClaim` and `ClusterSet` CRs in cluster
Multi-cluster Controller runs):

```yaml
apiVersion: multicluster.crd.antrea.io/v1alpha1
apiVersion: multicluster.crd.antrea.io/v1alpha2
kind: ClusterClaim
metadata:
name: id.k8s.io
namespace: kube-system
name: id.k8s.io
value: test-cluster-north
---
apiVersion: multicluster.crd.antrea.io/v1alpha1
apiVersion: multicluster.crd.antrea.io/v1alpha2
kind: ClusterClaim
metadata:
name: clusterset.k8s.io
namespace: kube-system
name: clusterset.k8s.io
value: test-clusterset
---
apiVersion: multicluster.crd.antrea.io/v1alpha1
Expand Down
22 changes: 9 additions & 13 deletions multicluster/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ multigroup: true
projectName: multicluster
repo: antrea.io/antrea/multicluster
resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: crd.antrea.io
group: multicluster
kind: ClusterClaim
path: antrea.io/antrea/multicluster/apis/multicluster/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
Expand Down Expand Up @@ -96,4 +83,13 @@ resources:
kind: Gateway
path: antrea.io/antrea/multicluster/apis/multicluster/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: crd.antrea.io
group: multicluster
kind: ClusterClaim
path: antrea.io/antrea/multicluster/apis/multicluster/v1alpha2
version: v1alpha2
version: "3"
145 changes: 0 additions & 145 deletions multicluster/apis/multicluster/v1alpha1/webhook_suite_test.go

This file was deleted.

57 changes: 0 additions & 57 deletions multicluster/apis/multicluster/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1
package v1alpha2

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -29,13 +29,13 @@ const (

// +genclient
//+kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion

// ClusterClaim is the Schema for the clusterclaims API
type ClusterClaim struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Name of the ClusterClaim.
Name string `json:"name,omitempty"` // TODO: Remove the name as it is already part of ObjectMeta and its confusing to have two names
// Value of the ClusterClaim.
Value string `json:"value,omitempty"`
}
Expand Down
Loading

0 comments on commit 8916036

Please sign in to comment.