Skip to content

Commit

Permalink
update apis to v2beta2
Browse files Browse the repository at this point in the history
Signed-off-by: Cyclinder Kuo <[email protected]>
  • Loading branch information
cyclinder committed Jan 26, 2025
1 parent fd55a2a commit b2a80b9
Show file tree
Hide file tree
Showing 77 changed files with 491 additions and 1,776 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ spec:
items:
type: string
type: array
hostRPFilter:
default: 0
description: 'HostRPFilter is used for coordiantor to help set the
rp_filter parameters of the node. NOTE: This field is considered
deprecated in the future. the rp_filter of the node should be configured
by spiderpool-agent rather than coordinator plugin. Configurable
values: <negative number>/0/1/2, -1 means leave it as it is. the
default value is 0.'
type: integer
hostRuleTable:
default: 500
description: HostRuleTable specifies the table number of the routing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,6 @@ spec:
type: array
subnet:
type: string
vlan:
description: 'DEPRECATED: Vlan is deprecated.'
format: int64
maximum: 4094
minimum: 0
type: integer
required:
- subnet
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,6 @@ spec:
items:
type: string
type: array
hostRPFilter:
default: 0
description: 'HostRPFilter is used for coordiantor to help set
the rp_filter parameters of the node. NOTE: This field is considered
deprecated in the future. the rp_filter of the node should be
configured by spiderpool-agent rather than coordinator plugin.
Configurable values: <negative number>/0/1/2, -1 means leave
it as it is. the default value is 0.'
type: integer
hostRuleTable:
default: 500
description: HostRuleTable specifies the table number of the routing
Expand Down Expand Up @@ -161,8 +152,9 @@ spec:
type: boolean
ibsriov:
properties:
ibKubernetesEnabled:
enableIbKubernetes:
default: false
description: Enforces ib-sriov-cni to work with ib-kubernetes.
type: boolean
ippools:
description: SpiderpoolPools could specify the IPAM spiderpool
Expand All @@ -179,20 +171,31 @@ spec:
type: object
linkState:
default: enable
description: 'Enforces link state for the VF. Allowed values:
auto, enable, disable.'
enum:
- auto
- enable
- disable
type: string
pkey:
description: infiniBand pkey for VF, this field is used by ib-kubernetes
to add pkey with guid to InfiniBand subnet manager client e.g.
Mellanox UFM, OpenSM
type: string
rdmaIsolation:
default: true
description: rdmaIsolation enablw RDMA CNI plugin is intended
to be run as a chained CNI plugin. it ensures isolation of RDMA
traffic from other workloads in the system by moving the associated
RDMA interfaces of the provided network interface to the container's
network namespace path.
type: boolean
resourceName:
description: The SR-IOV RDMA resource name of the SpiderMultusConfig.
the SR-IOV RDMA resource is often reported to kubelet by the
sriov-device-plugin.
type: string
required:
- resourceName
type: object
ipoib:
properties:
Expand All @@ -210,11 +213,14 @@ spec:
type: array
type: object
master:
description: name of the host interface to create the link from.
type: string
type: object
ipvlan:
properties:
bond:
description: Optional bond configuration for the CNI. It must
not be nil if the multiple master interfaces are specified.
properties:
mode:
format: int32
Expand All @@ -229,10 +235,6 @@ spec:
- mode
- name
type: object
enableRdma:
default: false
description: enable share rdma for ipvlan
type: boolean
ippools:
description: SpiderpoolPools could specify the IPAM spiderpool
CNI configuration default IPv4&IPv6 pools.
Expand All @@ -247,15 +249,23 @@ spec:
type: array
type: object
master:
description: The master interface(s) for the CNI configuration.
At least one master interface must be specified. If multiple
master interfaces are specified, the spiderpool will create
a bond device with the bondConfig by the ifacer plugin.
items:
type: string
type: array
rdmaResourceName:
description: Resource name of the rdma device-plugin, If it's
empty and enableRdma is true, the value will be auto set by
operator. and the user can also set this value manually.
description: The RDMA resource name of the nic. the RDMA resource
is often reported to kubelet by the k8s-rdma-shared-dev-plugin.
when it is not empty and spiderpool podResourceInject feature
is enabled, spiderpool can automatically inject it into the
container's resources via webhook.
type: string
vlanID:
description: 'The VLAN ID for the CNI configuration, optional
and must be within the specified range: [0.4096).'
format: int32
maximum: 4094
minimum: 0
Expand All @@ -266,6 +276,8 @@ spec:
macvlan:
properties:
bond:
description: Optional bond configuration for the CNI. It must
not be nil if the multiple master interfaces are specified.
properties:
mode:
format: int32
Expand All @@ -280,10 +292,6 @@ spec:
- mode
- name
type: object
enableRdma:
default: false
description: enable share rdma for macvlan
type: boolean
ippools:
description: SpiderpoolPools could specify the IPAM spiderpool
CNI configuration default IPv4&IPv6 pools.
Expand All @@ -298,15 +306,23 @@ spec:
type: array
type: object
master:
description: The master interface(s) for the CNI configuration.
At least one master interface must be specified. If multiple
master interfaces are specified, the spiderpool will create
a bond device with the bondConfig by the ifacer plugin.
items:
type: string
type: array
rdmaResourceName:
description: Resource name of the rdma device-plugin, If it's
empty and enableRdma is true, the value will be auto set by
operator. and the user can also set this value manually.
description: The RDMA resource name of the nic. the RDMA resource
is often reported to kubelet by the k8s-rdma-shared-dev-plugin.
when it is not empty and spiderpool podResourceInject feature
is enabled, spiderpool can automatically inject it into the
container's resources via webhook.
type: string
vlanID:
description: 'The VLAN ID for the CNI configuration, optional
and must be within the specified range: [0.4096).'
format: int32
maximum: 4094
minimum: 0
Expand Down Expand Up @@ -359,9 +375,6 @@ spec:
type: object
sriov:
properties:
enableRdma:
default: false
type: boolean
ippools:
description: SpiderpoolPools could specify the IPAM spiderpool
CNI configuration default IPv4&IPv6 pools.
Expand All @@ -376,20 +389,32 @@ spec:
type: array
type: object
maxTxRateMbps:
description: Mbps, 0 = disable rate limiting
minimum: 0
type: integer
minTxRateMbps:
minimum: 0
type: integer
rdmaIsolation:
default: false
description: rdmaIsolation enable RDMA CNI plugin is intended
to be run as a chained CNI plugin. it ensures isolation of RDMA
traffic from other workloads in the system by moving the associated
RDMA interfaces of the provided network interface to the container's
network namespace path.
type: boolean
resourceName:
description: The SR-IOV RDMA resource name of the SpiderMultusConfig.
the SR-IOV RDMA resource is often reported to kubelet by the
sriov-device-plugin.
type: string
vlanID:
description: 'The VLAN ID for the CNI configuration, optional
and must be within the specified range: [0.4096).'
format: int32
maximum: 4094
minimum: 0
type: integer
required:
- resourceName
type: object
type: object
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ spec:
type: array
subnet:
type: string
vlan:
description: 'DEPRECATED: Vlan is deprecated.'
format: int64
maximum: 4094
minimum: 0
type: integer
required:
- subnet
type: object
Expand Down
15 changes: 12 additions & 3 deletions cmd/spiderpool-agent/cmd/crd_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,30 @@ func newCRDManager() (ctrl.Manager, error) {

if err := mgr.GetFieldIndexer().IndexField(agentContext.InnerCtx, &spiderpoolv2beta1.SpiderIPPool{}, constant.SpecDefaultField, func(raw client.Object) []string {
ipPool := raw.(*spiderpoolv2beta1.SpiderIPPool)
return []string{strconv.FormatBool(*ipPool.Spec.Default)}
if ipPool.Spec.Default != nil {
return []string{strconv.FormatBool(*ipPool.Spec.Default)}
}
return []string{}
}); err != nil {
return nil, err
}

if err := mgr.GetFieldIndexer().IndexField(agentContext.InnerCtx, &spiderpoolv2beta1.SpiderIPPool{}, constant.SpecIPVersionField, func(raw client.Object) []string {
ipPool := raw.(*spiderpoolv2beta1.SpiderIPPool)
return []string{strconv.FormatInt(*ipPool.Spec.IPVersion, 10)}
if ipPool.Spec.IPVersion != nil {
return []string{strconv.FormatInt(*ipPool.Spec.IPVersion, 10)}
}
return []string{}
}); err != nil {
return nil, err
}

if err := mgr.GetFieldIndexer().IndexField(agentContext.InnerCtx, &spiderpoolv2beta1.SpiderReservedIP{}, constant.SpecIPVersionField, func(raw client.Object) []string {
reservedIP := raw.(*spiderpoolv2beta1.SpiderReservedIP)
return []string{strconv.FormatInt(*reservedIP.Spec.IPVersion, 10)}
if reservedIP.Spec.IPVersion != nil {
return []string{strconv.FormatInt(*reservedIP.Spec.IPVersion, 10)}
}
return []string{}
}); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/spiderpool-agent/cmd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func DaemonMain() {

logger.Info("Begin to initialize spiderpool-agent runtime manager")
mgr, err := newCRDManager()
if nil != err {
if err != nil {
logger.Fatal(err.Error())
}
agentContext.CRDManager = mgr
Expand Down
5 changes: 0 additions & 5 deletions cmd/spiderpool-controller/cmd/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ func (c *CoreClient) clean(validate, mutating string) error {
jobResult = multierror.Append(jobResult, err)
}

// Clean up SpiderClaimParameter resources of spiderpool
if err := c.cleanSpiderpoolResources(ctx, &spiderpoolv2beta1.SpiderClaimParameterList{}, constant.KindSpiderClaimParameter); err != nil {
jobResult = multierror.Append(jobResult, err)
}

// Delete all crds of spiderpool or sriov-network-operator
if err := c.cleanCRDs(ctx); err != nil {
jobResult = multierror.Append(jobResult, err)
Expand Down
Loading

0 comments on commit b2a80b9

Please sign in to comment.