From ff490d090dda74fdc2079fb363de3047d2028d9a Mon Sep 17 00:00:00 2001 From: hjiajing Date: Fri, 8 Mar 2024 15:57:56 +0800 Subject: [PATCH] Increase the minimum supported Kubernetes version to v1.19 Since Kubernetes v1.19, some APIs are deprecated. Add deprecated comment to those APIs and update documents. Reference: https://kubernetes.io/docs/reference/using-api/deprecation-guide/ Signed-off-by: hjiajing --- README.md | 2 +- build/charts/antrea/crds/clustergroup.yaml | 2 ++ .../antrea/crds/clusternetworkpolicy.yaml | 2 ++ build/charts/antrea/crds/externalentity.yaml | 3 +++ build/charts/antrea/crds/externalippool.yaml | 2 ++ build/charts/antrea/crds/group.yaml | 2 ++ build/charts/antrea/crds/networkpolicy.yaml | 2 ++ build/charts/antrea/crds/tier.yaml | 2 ++ build/charts/antrea/crds/traceflow.yaml | 2 ++ build/yamls/antrea-aks.yml | 17 +++++++++++++++++ build/yamls/antrea-crds.yml | 17 +++++++++++++++++ build/yamls/antrea-eks.yml | 17 +++++++++++++++++ build/yamls/antrea-gke.yml | 17 +++++++++++++++++ build/yamls/antrea-ipsec.yml | 17 +++++++++++++++++ build/yamls/antrea.yml | 17 +++++++++++++++++ pkg/apiserver/handlers/webhook/convert_crd.go | 1 + 16 files changed, 121 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a01286bfbe..15885178c2e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Network Policies in a very efficient manner. ## Prerequisites -Antrea has been tested with Kubernetes clusters running version 1.16 or later. +Antrea has been tested with Kubernetes clusters running version 1.19 or later. * `NodeIPAMController` must be enabled in the Kubernetes cluster.\ When deploying a cluster with kubeadm the `--pod-network-cidr ` diff --git a/build/charts/antrea/crds/clustergroup.yaml b/build/charts/antrea/crds/clustergroup.yaml index 4ff7eaf5b9d..5d307e4fa8f 100644 --- a/build/charts/antrea/crds/clustergroup.yaml +++ b/build/charts/antrea/crds/clustergroup.yaml @@ -10,6 +10,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 ClusterGroup is deprecated; use crd.antrea.io/v1beta1 ClusterGroup" schema: openAPIV3Schema: type: object diff --git a/build/charts/antrea/crds/clusternetworkpolicy.yaml b/build/charts/antrea/crds/clusternetworkpolicy.yaml index a6e2cca2530..4880fed7b89 100644 --- a/build/charts/antrea/crds/clusternetworkpolicy.yaml +++ b/build/charts/antrea/crds/clusternetworkpolicy.yaml @@ -10,6 +10,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ClusterNetworkPolicy is deprecated; use crd.antrea.io/v1beta1 ClusterNetworkPolicy" additionalPrinterColumns: - name: Tier type: string diff --git a/build/charts/antrea/crds/externalentity.yaml b/build/charts/antrea/crds/externalentity.yaml index bfa251ebe57..9d9452ee1f7 100644 --- a/build/charts/antrea/crds/externalentity.yaml +++ b/build/charts/antrea/crds/externalentity.yaml @@ -44,6 +44,9 @@ spec: externalNode: type: string - name: v1alpha1 + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ExternalEntity is deprecated; use crd.antrea.io/v1alpha2 + ExternalEntity" served: false storage: false schema: diff --git a/build/charts/antrea/crds/externalippool.yaml b/build/charts/antrea/crds/externalippool.yaml index ac17a519c1b..91ae909b0d6 100644 --- a/build/charts/antrea/crds/externalippool.yaml +++ b/build/charts/antrea/crds/externalippool.yaml @@ -10,6 +10,8 @@ spec: - name: v1alpha2 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha2 ExternalIPPool is deprecated; use crd.antrea.io/v1beta1 ExternalIPPool" schema: openAPIV3Schema: type: object diff --git a/build/charts/antrea/crds/group.yaml b/build/charts/antrea/crds/group.yaml index a39783a7b57..e9dd998a243 100644 --- a/build/charts/antrea/crds/group.yaml +++ b/build/charts/antrea/crds/group.yaml @@ -8,6 +8,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 Group is deprecated; use crd.antrea.io/v1beta1 Group" schema: openAPIV3Schema: type: object diff --git a/build/charts/antrea/crds/networkpolicy.yaml b/build/charts/antrea/crds/networkpolicy.yaml index f9b281dd97a..abc84a58c1e 100644 --- a/build/charts/antrea/crds/networkpolicy.yaml +++ b/build/charts/antrea/crds/networkpolicy.yaml @@ -10,6 +10,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 NetworkPolicy is deprecated; use crd.antrea.io/v1beta1 NetworkPolicy" additionalPrinterColumns: - name: Tier type: string diff --git a/build/charts/antrea/crds/tier.yaml b/build/charts/antrea/crds/tier.yaml index ac36e9573f1..eb415e661a3 100644 --- a/build/charts/antrea/crds/tier.yaml +++ b/build/charts/antrea/crds/tier.yaml @@ -10,6 +10,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Tier is deprecated; use crd.antrea.io/v1beta1 Tier" additionalPrinterColumns: - name: Priority type: integer diff --git a/build/charts/antrea/crds/traceflow.yaml b/build/charts/antrea/crds/traceflow.yaml index 90b139ecb4f..72a1f99fa95 100644 --- a/build/charts/antrea/crds/traceflow.yaml +++ b/build/charts/antrea/crds/traceflow.yaml @@ -10,6 +10,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Traceflow is deprecated; use crd.antrea.io/v1beta1 Traceflow" additionalPrinterColumns: - jsonPath: .status.phase description: The phase of the Traceflow. diff --git a/build/yamls/antrea-aks.yml b/build/yamls/antrea-aks.yml index f4bc9bb2162..d26a1df10ff 100644 --- a/build/yamls/antrea-aks.yml +++ b/build/yamls/antrea-aks.yml @@ -314,6 +314,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 ClusterGroup is deprecated; use crd.antrea.io/v1beta1 ClusterGroup" schema: openAPIV3Schema: type: object @@ -576,6 +578,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ClusterNetworkPolicy is deprecated; use crd.antrea.io/v1beta1 ClusterNetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -2385,6 +2389,9 @@ spec: externalNode: type: string - name: v1alpha1 + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ExternalEntity is deprecated; use crd.antrea.io/v1alpha2 + ExternalEntity" served: false storage: false schema: @@ -2412,6 +2419,8 @@ spec: - name: v1alpha2 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha2 ExternalIPPool is deprecated; use crd.antrea.io/v1beta1 ExternalIPPool" schema: openAPIV3Schema: type: object @@ -2677,6 +2686,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 Group is deprecated; use crd.antrea.io/v1beta1 Group" schema: openAPIV3Schema: type: object @@ -3058,6 +3069,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 NetworkPolicy is deprecated; use crd.antrea.io/v1beta1 NetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -4476,6 +4489,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Tier is deprecated; use crd.antrea.io/v1beta1 Tier" additionalPrinterColumns: - name: Priority type: integer @@ -4547,6 +4562,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Traceflow is deprecated; use crd.antrea.io/v1beta1 Traceflow" additionalPrinterColumns: - jsonPath: .status.phase description: The phase of the Traceflow. diff --git a/build/yamls/antrea-crds.yml b/build/yamls/antrea-crds.yml index e0497dcf8b2..1139dcee1f4 100644 --- a/build/yamls/antrea-crds.yml +++ b/build/yamls/antrea-crds.yml @@ -309,6 +309,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 ClusterGroup is deprecated; use crd.antrea.io/v1beta1 ClusterGroup" schema: openAPIV3Schema: type: object @@ -569,6 +571,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ClusterNetworkPolicy is deprecated; use crd.antrea.io/v1beta1 ClusterNetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -2374,6 +2378,9 @@ spec: externalNode: type: string - name: v1alpha1 + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ExternalEntity is deprecated; use crd.antrea.io/v1alpha2 + ExternalEntity" served: false storage: false schema: @@ -2399,6 +2406,8 @@ spec: - name: v1alpha2 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha2 ExternalIPPool is deprecated; use crd.antrea.io/v1beta1 ExternalIPPool" schema: openAPIV3Schema: type: object @@ -2660,6 +2669,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 Group is deprecated; use crd.antrea.io/v1beta1 Group" schema: openAPIV3Schema: type: object @@ -3037,6 +3048,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 NetworkPolicy is deprecated; use crd.antrea.io/v1beta1 NetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -4451,6 +4464,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Tier is deprecated; use crd.antrea.io/v1beta1 Tier" additionalPrinterColumns: - name: Priority type: integer @@ -4520,6 +4535,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Traceflow is deprecated; use crd.antrea.io/v1beta1 Traceflow" additionalPrinterColumns: - jsonPath: .status.phase description: The phase of the Traceflow. diff --git a/build/yamls/antrea-eks.yml b/build/yamls/antrea-eks.yml index bec701d3056..790b0484c39 100644 --- a/build/yamls/antrea-eks.yml +++ b/build/yamls/antrea-eks.yml @@ -314,6 +314,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 ClusterGroup is deprecated; use crd.antrea.io/v1beta1 ClusterGroup" schema: openAPIV3Schema: type: object @@ -576,6 +578,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ClusterNetworkPolicy is deprecated; use crd.antrea.io/v1beta1 ClusterNetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -2385,6 +2389,9 @@ spec: externalNode: type: string - name: v1alpha1 + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ExternalEntity is deprecated; use crd.antrea.io/v1alpha2 + ExternalEntity" served: false storage: false schema: @@ -2412,6 +2419,8 @@ spec: - name: v1alpha2 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha2 ExternalIPPool is deprecated; use crd.antrea.io/v1beta1 ExternalIPPool" schema: openAPIV3Schema: type: object @@ -2677,6 +2686,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 Group is deprecated; use crd.antrea.io/v1beta1 Group" schema: openAPIV3Schema: type: object @@ -3058,6 +3069,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 NetworkPolicy is deprecated; use crd.antrea.io/v1beta1 NetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -4476,6 +4489,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Tier is deprecated; use crd.antrea.io/v1beta1 Tier" additionalPrinterColumns: - name: Priority type: integer @@ -4547,6 +4562,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Traceflow is deprecated; use crd.antrea.io/v1beta1 Traceflow" additionalPrinterColumns: - jsonPath: .status.phase description: The phase of the Traceflow. diff --git a/build/yamls/antrea-gke.yml b/build/yamls/antrea-gke.yml index a4ae810f7b0..13718bddfb6 100644 --- a/build/yamls/antrea-gke.yml +++ b/build/yamls/antrea-gke.yml @@ -314,6 +314,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 ClusterGroup is deprecated; use crd.antrea.io/v1beta1 ClusterGroup" schema: openAPIV3Schema: type: object @@ -576,6 +578,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ClusterNetworkPolicy is deprecated; use crd.antrea.io/v1beta1 ClusterNetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -2385,6 +2389,9 @@ spec: externalNode: type: string - name: v1alpha1 + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ExternalEntity is deprecated; use crd.antrea.io/v1alpha2 + ExternalEntity" served: false storage: false schema: @@ -2412,6 +2419,8 @@ spec: - name: v1alpha2 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha2 ExternalIPPool is deprecated; use crd.antrea.io/v1beta1 ExternalIPPool" schema: openAPIV3Schema: type: object @@ -2677,6 +2686,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 Group is deprecated; use crd.antrea.io/v1beta1 Group" schema: openAPIV3Schema: type: object @@ -3058,6 +3069,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 NetworkPolicy is deprecated; use crd.antrea.io/v1beta1 NetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -4476,6 +4489,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Tier is deprecated; use crd.antrea.io/v1beta1 Tier" additionalPrinterColumns: - name: Priority type: integer @@ -4547,6 +4562,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Traceflow is deprecated; use crd.antrea.io/v1beta1 Traceflow" additionalPrinterColumns: - jsonPath: .status.phase description: The phase of the Traceflow. diff --git a/build/yamls/antrea-ipsec.yml b/build/yamls/antrea-ipsec.yml index 393cb59da0a..6975d580669 100644 --- a/build/yamls/antrea-ipsec.yml +++ b/build/yamls/antrea-ipsec.yml @@ -314,6 +314,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 ClusterGroup is deprecated; use crd.antrea.io/v1beta1 ClusterGroup" schema: openAPIV3Schema: type: object @@ -576,6 +578,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ClusterNetworkPolicy is deprecated; use crd.antrea.io/v1beta1 ClusterNetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -2385,6 +2389,9 @@ spec: externalNode: type: string - name: v1alpha1 + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ExternalEntity is deprecated; use crd.antrea.io/v1alpha2 + ExternalEntity" served: false storage: false schema: @@ -2412,6 +2419,8 @@ spec: - name: v1alpha2 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha2 ExternalIPPool is deprecated; use crd.antrea.io/v1beta1 ExternalIPPool" schema: openAPIV3Schema: type: object @@ -2677,6 +2686,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 Group is deprecated; use crd.antrea.io/v1beta1 Group" schema: openAPIV3Schema: type: object @@ -3058,6 +3069,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 NetworkPolicy is deprecated; use crd.antrea.io/v1beta1 NetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -4476,6 +4489,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Tier is deprecated; use crd.antrea.io/v1beta1 Tier" additionalPrinterColumns: - name: Priority type: integer @@ -4547,6 +4562,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Traceflow is deprecated; use crd.antrea.io/v1beta1 Traceflow" additionalPrinterColumns: - jsonPath: .status.phase description: The phase of the Traceflow. diff --git a/build/yamls/antrea.yml b/build/yamls/antrea.yml index 2451670ca39..b1cb8edbc5e 100644 --- a/build/yamls/antrea.yml +++ b/build/yamls/antrea.yml @@ -314,6 +314,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 ClusterGroup is deprecated; use crd.antrea.io/v1beta1 ClusterGroup" schema: openAPIV3Schema: type: object @@ -576,6 +578,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ClusterNetworkPolicy is deprecated; use crd.antrea.io/v1beta1 ClusterNetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -2385,6 +2389,9 @@ spec: externalNode: type: string - name: v1alpha1 + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 ExternalEntity is deprecated; use crd.antrea.io/v1alpha2 + ExternalEntity" served: false storage: false schema: @@ -2412,6 +2419,8 @@ spec: - name: v1alpha2 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha2 ExternalIPPool is deprecated; use crd.antrea.io/v1beta1 ExternalIPPool" schema: openAPIV3Schema: type: object @@ -2677,6 +2686,8 @@ spec: - name: v1alpha3 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha3 Group is deprecated; use crd.antrea.io/v1beta1 Group" schema: openAPIV3Schema: type: object @@ -3058,6 +3069,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 NetworkPolicy is deprecated; use crd.antrea.io/v1beta1 NetworkPolicy" additionalPrinterColumns: - name: Tier type: string @@ -4476,6 +4489,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Tier is deprecated; use crd.antrea.io/v1beta1 Tier" additionalPrinterColumns: - name: Priority type: integer @@ -4547,6 +4562,8 @@ spec: - name: v1alpha1 served: true storage: false + deprecated: true + deprecationWarning: "crd.antrea.io/v1alpha1 Traceflow is deprecated; use crd.antrea.io/v1beta1 Traceflow" additionalPrinterColumns: - jsonPath: .status.phase description: The phase of the Traceflow. diff --git a/pkg/apiserver/handlers/webhook/convert_crd.go b/pkg/apiserver/handlers/webhook/convert_crd.go index 930789bd525..eec3d16baa1 100644 --- a/pkg/apiserver/handlers/webhook/convert_crd.go +++ b/pkg/apiserver/handlers/webhook/convert_crd.go @@ -45,6 +45,7 @@ func statusSucceed() metav1.Status { // doConversionV1beta1 converts the requested objects in the v1beta1 ConversionRequest using the given conversion function and // returns a conversion response. Failures are reported with the Reason in the conversion response. +// Deprecated: apiextensions/v1beta1 is deprecated, use apiextensions/v1 instead func doConversionV1beta1(convertRequest *v1beta1.ConversionRequest, convert convertFunc) *v1beta1.ConversionResponse { var convertedObjects []runtime.RawExtension for _, obj := range convertRequest.Objects {