From 1d2c61ee7da84a04a16087bc6f61c6200180b995 Mon Sep 17 00:00:00 2001 From: Sebastian Wicki Date: Mon, 28 Aug 2023 18:10:38 +0200 Subject: [PATCH] ipam: Remove cluster-pool-v2beta fields from CiliumNode CRD They are no longer used. Signed-off-by: Sebastian Wicki --- pkg/ipam/option/option.go | 3 -- pkg/ipam/types/types.go | 19 ----------- pkg/ipam/types/zz_generated.deepequal.go | 6 ---- .../cilium.io/client/crds/v2/ciliumnodes.yaml | 19 ----------- plugins/cilium-cni/types/types_test.go | 32 ------------------- 5 files changed, 79 deletions(-) diff --git a/pkg/ipam/option/option.go b/pkg/ipam/option/option.go index 2d82d82bce4fe..6f30091723e60 100644 --- a/pkg/ipam/option/option.go +++ b/pkg/ipam/option/option.go @@ -23,9 +23,6 @@ const ( // option.IPAM IPAMClusterPool = "cluster-pool" - // IPAMClusterPoolV2 is the value to select cluster pool version 2 - IPAMClusterPoolV2 = "cluster-pool-v2beta" - // IPAMMultiPool is the value to select the multi pool IPAM mode IPAMMultiPool = "multi-pool" diff --git a/pkg/ipam/types/types.go b/pkg/ipam/types/types.go index 58ce46c145075..dd9fa513621cb 100644 --- a/pkg/ipam/types/types.go +++ b/pkg/ipam/types/types.go @@ -157,25 +157,6 @@ type IPAMSpec struct { // // +kubebuilder:validation:Minimum=0 MaxAboveWatermark int `json:"max-above-watermark,omitempty"` - - // PodCIDRAllocationThreshold defines the minimum number of free IPs which - // must be available to this node via its pod CIDR pool. If the total number - // of IP addresses in the pod CIDR pool is less than this value, the pod - // CIDRs currently in-use by this node will be marked as depleted and - // cilium-operator will allocate a new pod CIDR to this node. - // This value effectively defines the buffer of IP addresses available - // immediately without requiring cilium-operator to get involved. - // - // +kubebuilder:validation:Minimum=0 - PodCIDRAllocationThreshold int `json:"pod-cidr-allocation-threshold,omitempty"` - - // PodCIDRReleaseThreshold defines the maximum number of free IPs which may - // be available to this node via its pod CIDR pool. While the total number - // of free IP addresses in the pod CIDR pool is larger than this value, - // cilium-agent will attempt to release currently unused pod CIDRs. - // - // +kubebuilder:validation:Minimum=0 - PodCIDRReleaseThreshold int `json:"pod-cidr-release-threshold,omitempty"` } // IPReleaseStatus defines the valid states in IP release handshake diff --git a/pkg/ipam/types/zz_generated.deepequal.go b/pkg/ipam/types/zz_generated.deepequal.go index b27fd1c459a08..9749444d65bfd 100644 --- a/pkg/ipam/types/zz_generated.deepequal.go +++ b/pkg/ipam/types/zz_generated.deepequal.go @@ -204,12 +204,6 @@ func (in *IPAMSpec) DeepEqual(other *IPAMSpec) bool { if in.MaxAboveWatermark != other.MaxAboveWatermark { return false } - if in.PodCIDRAllocationThreshold != other.PodCIDRAllocationThreshold { - return false - } - if in.PodCIDRReleaseThreshold != other.PodCIDRReleaseThreshold { - return false - } return true } diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodes.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodes.yaml index 2faf75f73c950..d29eb17c01a43 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodes.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodes.yaml @@ -285,25 +285,6 @@ spec: logic takes over to continue allocating IPs. minimum: 0 type: integer - pod-cidr-allocation-threshold: - description: PodCIDRAllocationThreshold defines the minimum number - of free IPs which must be available to this node via its pod - CIDR pool. If the total number of IP addresses in the pod CIDR - pool is less than this value, the pod CIDRs currently in-use - by this node will be marked as depleted and cilium-operator - will allocate a new pod CIDR to this node. This value effectively - defines the buffer of IP addresses available immediately without - requiring cilium-operator to get involved. - minimum: 0 - type: integer - pod-cidr-release-threshold: - description: PodCIDRReleaseThreshold defines the maximum number - of free IPs which may be available to this node via its pod - CIDR pool. While the total number of free IP addresses in the - pod CIDR pool is larger than this value, cilium-agent will attempt - to release currently unused pod CIDRs. - minimum: 0 - type: integer podCIDRs: description: PodCIDRs is the list of CIDRs available to the node for allocation. When an IP is used, the IP will be added to diff --git a/plugins/cilium-cni/types/types_test.go b/plugins/cilium-cni/types/types_test.go index 18ffe0b8de06d..741b64b3338f3 100644 --- a/plugins/cilium-cni/types/types_test.go +++ b/plugins/cilium-cni/types/types_test.go @@ -268,38 +268,6 @@ func (t *CNITypesSuite) TestReadCNIConfAzurev2WithPlugins(c *check.C) { testConfRead(c, confFile1, &netConf1) } -func (t *CNITypesSuite) TestReadCNIConfClusterPoolV2(c *check.C) { - confFile1 := ` -{ - "cniVersion":"0.3.1", - "name":"cilium", - "plugins": [ - { - "cniVersion":"0.3.1", - "type":"cilium-cni", - "ipam": { - "pod-cidr-allocation-threshold": 10, - "pod-cidr-release-threshold": 20 - } - } - ] -} -` - netConf1 := NetConf{ - NetConf: cnitypes.NetConf{ - CNIVersion: "0.3.1", - Type: "cilium-cni", - }, - IPAM: IPAM{ - IPAMSpec: ipamTypes.IPAMSpec{ - PodCIDRAllocationThreshold: 10, - PodCIDRReleaseThreshold: 20, - }, - }, - } - testConfRead(c, confFile1, &netConf1) -} - func (t *CNITypesSuite) TestReadCNIConfIPAMType(c *check.C) { confFile := ` {