Skip to content

Commit

Permalink
fix mutlus auto-generated cni files && opt coordinator cni config filed
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclinder committed Jul 14, 2023
1 parent 954b539 commit 9f7e839
Show file tree
Hide file tree
Showing 43 changed files with 1,997 additions and 233 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-nightly-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ jobs:
- name: create an issue
uses: dacbd/[email protected]
with:
token: ${{ secrets.WELAN_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
title: "Night CI ${{ ENV.TIMESTAMP }}: Failed"
body: |
action url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Expand Down
34 changes: 17 additions & 17 deletions api/v1/agent/models/coordinator_config.go

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

10 changes: 5 additions & 5 deletions api/v1/agent/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,17 @@ definitions:
description: Coordinator config
type: object
properties:
tuneMode:
mode:
type: string
podCIDR:
overlayPodCIDR:
type: array
items:
type: string
serviceCIDR:
type: array
items:
type: string
extraCIDR:
hijackCIDR:
type: array
items:
type: string
Expand All @@ -329,8 +329,8 @@ definitions:
detectGateway:
type: boolean
required:
- tuneMode
- podCIDR
- mode
- overlayPodCIDR
- serviceCIDR
- tunePodRoutes
GetCoordinatorArgs:
Expand Down
28 changes: 14 additions & 14 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.

8 changes: 5 additions & 3 deletions charts/spiderpool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ helm install spiderpool spiderpool/spiderpool --wait --namespace kube-system \
| `global.commonAnnotations` | Annotations to add to all deployed objects | `{}` |
| `global.commonLabels` | Labels to add to all deployed objects | `{}` |
| `global.ipamBinHostPath` | the host path of the IPAM plugin directory. | `/opt/cni/bin` |
| `global.cniConfHostPath` | the host path of the cni config directory | `/etc/cni/net.d` |
| `global.ipamUNIXSocketHostPath` | the host path of unix domain socket for ipam plugin | `/var/run/spidernet/spiderpool.sock` |
| `global.configName` | the configmap name | `spiderpool-conf` |

Expand Down Expand Up @@ -135,11 +136,12 @@ helm install spiderpool spiderpool/spiderpool --wait --namespace kube-system \
| ------------------------------ | ------------------------------------------------------------------------- | ---------- |
| `coordinator.enabled` | enable SpiderCoordinator | `true` |
| `coordinator.name` | the name of the default SpiderCoordinator CR | `default` |
| `coordinator.tuneMode` | optional network mode, ["underlay", "overlay", "disabled"] | `underlay` |
| `coordinator.mode` | optional network mode, ["underlay", "overlay", "disabled"] | `underlay` |
| `coordinator.podCIDRType` | Pod CIDR type that should be collected, [ "cluster", "calico", "cilium" ] | `cluster` |
| `coordinator.detectGateway` | detect the reachability of the gateway | `true` |
| `coordinator.detectIPConflict` | detect IP address conflicts | `true` |
| `coordinator.detectGateway` | detect the reachability of the gateway | `false` |
| `coordinator.detectIPConflict` | detect IP address conflicts | `false` |
| `coordinator.tunePodRoutes` | tune Pod routes | `true` |
| `coordinator.hijackCIDR` | Additional subnets that need to be hijacked to the host forward | `[]` |


### multus parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
detectIPConflict:
default: false
type: boolean
extraCIDR:
hijackCIDR:
items:
type: string
type: array
Expand All @@ -55,19 +55,19 @@ spec:
hostRuleTable:
default: 500
type: integer
podCIDRType:
type: string
podDefaultRouteNIC:
type: string
podMACPrefix:
type: string
tuneMode:
mode:
default: underlay
enum:
- underlay
- overlay
- disabled
type: string
podCIDRType:
type: string
podDefaultRouteNIC:
type: string
podMACPrefix:
type: string
tunePodRoutes:
default: true
type: boolean
Expand All @@ -77,12 +77,12 @@ spec:
status:
description: CoordinationStatus defines the observed state of SpiderCoordinator.
properties:
phase:
type: string
podCIDR:
overlayPodCIDR:
items:
type: string
type: array
phase:
type: string
serviceCIDR:
items:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ spec:
description: Spec is the specification of the MultusCNIConfig
properties:
cniType:
description: macvlan、ipvlan、sriov、custom
description: calico、cilium-cni、flannel、weave-net、kube-ovn、macvlan、ipvlan、sriov、custom
enum:
- calico
- cilium-cni
- flannel
- weave-net
- kube-ovn
- macvlan
- ipvlan
- sriov
Expand All @@ -55,7 +60,7 @@ spec:
detectIPConflict:
default: false
type: boolean
extraCIDR:
hijackCIDR:
items:
type: string
type: array
Expand All @@ -65,19 +70,19 @@ spec:
hostRuleTable:
default: 500
type: integer
podCIDRType:
type: string
podDefaultRouteNIC:
type: string
podMACPrefix:
type: string
tuneMode:
mode:
default: underlay
enum:
- underlay
- overlay
- disabled
type: string
podCIDRType:
type: string
podDefaultRouteNIC:
type: string
podMACPrefix:
type: string
tunePodRoutes:
default: true
type: boolean
Expand Down
22 changes: 19 additions & 3 deletions charts/spiderpool/templates/multus-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,14 @@ spec:
imagePullPolicy: {{ .Values.multus.multusCNI.image.pullPolicy}}
image: {{ include "spiderpool.multus.image" . | quote }}
command:
- "cp"
- "/usr/src/multus-cni/bin/multus"
- "/host/opt/cni/bin/multus"
- "/bin/sh"
- "-c"
- |
cp /usr/src/multus-cni/bin/multus /host/opt/cni/bin/multus
# TODO: We can revert the changes if https://github.com/k8snetworkplumbingwg/multus-cni/pull/1119 merged.
{{- if eq .Values.multus.multusCNI.defaultCniCRName "" }}
cp /host/etc/cni/net.d/*.conf* /host/etc/cni/multus/net.d/
{{- end }}
resources:
requests:
cpu: "10m"
Expand All @@ -230,6 +235,12 @@ spec:
- name: cnibin
mountPath: /host/opt/cni/bin
mountPropagation: Bidirectional
{{- if eq .Values.multus.multusCNI.defaultCniCRName "" }}
- mountPath: /host/etc/cni/net.d
name: cni
- mountPath: /host/etc/cni/multus/net.d
name: multus-cni-dir
{{- end }}
terminationGracePeriodSeconds: 10
volumes:
- name: cni
Expand All @@ -245,6 +256,11 @@ spec:
items:
- key: cni-conf.json
path: 00-multus.conf
{{- else }}
- hostPath:
path: /etc/cni/multus/net.d
type: DirectoryOrCreate
name: multus-cni-dir
{{- end }}
{{- if .Values.multus.multusCNI.extraVolumeMounts }}
{{- include "tplvalues.render" ( dict "value" .Values.multus.multusCNI.extraVolumeMounts "context" $ ) | nindent 8 }}
Expand Down
Loading

0 comments on commit 9f7e839

Please sign in to comment.