Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/v1/agent/models/ipam_add_args.go

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

2 changes: 2 additions & 0 deletions api/v1/agent/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ definitions:
type: string
cleanGateway:
type: boolean
matchMasterSubnet:
type: boolean
required:
- containerID
- ifName
Expand Down
6 changes: 6 additions & 0 deletions api/v1/agent/server/embedded_spec.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 @@ -159,6 +159,14 @@ spec:
items:
type: string
type: array
matchMasterSubnet:
default: false
description: enable IPAM to check if the IPPools of the pod
if matched the master subnet
enum:
- true
- false
type: boolean
type: object
linkState:
default: enable
Expand Down Expand Up @@ -202,6 +210,14 @@ spec:
items:
type: string
type: array
matchMasterSubnet:
default: false
description: enable IPAM to check if the IPPools of the pod
if matched the master subnet
enum:
- true
- false
type: boolean
type: object
master:
description: name of the host interface to create the link from.
Expand Down Expand Up @@ -238,6 +254,14 @@ spec:
items:
type: string
type: array
matchMasterSubnet:
default: false
description: enable IPAM to check if the IPPools of the pod
if matched the master subnet
enum:
- true
- false
type: boolean
type: object
master:
description: The master interface(s) for the CNI configuration.
Expand Down Expand Up @@ -295,6 +319,14 @@ spec:
items:
type: string
type: array
matchMasterSubnet:
default: false
description: enable IPAM to check if the IPPools of the pod
if matched the master subnet
enum:
- true
- false
type: boolean
type: object
master:
description: The master interface(s) for the CNI configuration.
Expand Down Expand Up @@ -340,6 +372,14 @@ spec:
items:
type: string
type: array
matchMasterSubnet:
default: false
description: enable IPAM to check if the IPPools of the pod
if matched the master subnet
enum:
- true
- false
type: boolean
type: object
trunk:
items:
Expand Down Expand Up @@ -378,6 +418,14 @@ spec:
items:
type: string
type: array
matchMasterSubnet:
default: false
description: enable IPAM to check if the IPPools of the pod
if matched the master subnet
enum:
- true
- false
type: boolean
type: object
maxTxRateMbps:
description: Mbps, 0 = disable rate limiting
Expand Down
8 changes: 2 additions & 6 deletions charts/spiderpool/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,9 @@ spec:
{{- end }}
{{- end }}
volumeMounts:
{{- if .Values.spiderpoolAgent.prometheus.enabledRdmaMetric }}
- name: host-ns
mountPath: /var/run
mountPropagation: Bidirectional
{{- end }}
- name: config-path
mountPath: /tmp/spiderpool/config-map
readOnly: true
Expand Down Expand Up @@ -315,12 +313,10 @@ spec:
path: {{ dir .Values.global.ipamUNIXSocketHostPath }}
type: DirectoryOrCreate
# multus
{{- if .Values.spiderpoolAgent.prometheus.enabledRdmaMetric }}
- name: host-ns
hostPath:
path: /var/run
{{- end }}
{{- if .Values.multus.multusCNI.install }}
{{- if .Values.multus.multusCNI.install }}
- name: cni
hostPath:
path: /etc/cni/net.d
Expand All @@ -337,7 +333,7 @@ spec:
items:
- key: entrypoint.sh
path: entrypoint.sh
{{- end }}
{{- end }}
{{- if .Values.spiderpoolAgent.extraVolumeMounts }}
{{- include "tplvalues.render" ( dict "value" .Values.spiderpoolAgent.extraVolumeMounts "context" $ ) | nindent 6 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions cmd/spiderpool-agent/cmd/crd_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
controllerruntimelog "sigs.k8s.io/controller-runtime/pkg/log"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

netv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
"github.com/spidernet-io/spiderpool/pkg/constant"
spiderpoolv2beta1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v2beta1"
)
Expand All @@ -26,6 +27,7 @@ func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(spiderpoolv2beta1.AddToScheme(scheme))
utilruntime.Must(kubevirtv1.AddToScheme(scheme))
utilruntime.Must(netv1.AddToScheme(scheme))
}

func newCRDManager() (ctrl.Manager, error) {
Expand Down
1 change: 1 addition & 0 deletions cmd/spiderpool/cmd/cni_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type IPAMConfig struct {
DefaultIPv4IPPool []string `json:"default_ipv4_ippool,omitempty"`
DefaultIPv6IPPool []string `json:"default_ipv6_ippool,omitempty"`
CleanGateway bool `json:"clean_gateway,omitempty"`
MatchMasterSubnet bool `json:"match_master_subnet,omitempty"`

IPAMUnixSocketPath string `json:"ipam_unix_socket_path,omitempty"`
}
Expand Down
1 change: 1 addition & 0 deletions cmd/spiderpool/cmd/command_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ func CmdAdd(args *skel.CmdArgs) (err error) {
DefaultIPV4IPPool: conf.IPAM.DefaultIPv4IPPool,
DefaultIPV6IPPool: conf.IPAM.DefaultIPv6IPPool,
CleanGateway: conf.IPAM.CleanGateway,
MatchMasterSubnet: conf.IPAM.MatchMasterSubnet,
})

logger.Debug("Send IPAM request")
Expand Down
Binary file added docs/images/ai-different-zone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions docs/reference/crd-spidermultusconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ This is the SpiderReservedIP spec for users to configure.

#### SpiderpoolPools

| Field | Description | Schema | Validation |
|-------|-----------------------------------------------------|-----------------|------------|
| ipv4 | the default IPv4 IPPools in your CNI configurations | list of strings | optional |
| ipv6 | the default IPv6 IPPools in your CNI configurations | list of strings | optional |
| Field | Description | Schema | Validation |
|-----------------------|--------------------------------------------------------|-----------------|------------|
| ipv4 | the default IPv4 IPPools in your CNI configurations | list of strings | optional |
| ipv6 | the default IPv6 IPPools in your CNI configurations | list of strings | optional |
| matchMasterSubnet | whether to match the master subnet, only for sriov-cni | bool | optional |
Loading
Loading