10 Commits

Author SHA1 Message Date
Doug Smith
adfb270991 Merge pull request #1341 from dougbtv/net-attach-def-client-v174
Updates net-attach-def client library to v1.7.4
2024-10-01 09:36:43 -04:00
dougbtv
b171bb702b Updates net-attach-def client library to v1.7.4
Which improves backwards compatibility for network-status in latest updates to the client library, especially related to Calico.

See also: https://github.com/k8snetworkplumbingwg/network-attachment-definition-client/pull/72
2024-09-30 15:57:48 -04:00
Doug Smith
f1e887e239 Merge pull request #1336 from dougbtv/net-attach-def-client-v173
Bumps net-attach-def client to v1.7.3
2024-09-13 12:03:57 -04:00
dougbtv
100766d1a4 Bumps net-attach-def client to v1.7.3
Previous version didn't account for accounts for the sandox interfaces when reporting the interfaces in the network-status annotation when calculating the default:true interface
2024-09-13 09:56:52 -04:00
Doug Smith
e074c2a56b Merge pull request #1335 from dougbtv/net-attach-def-client-v172
Bumps net-attach-def client library to v1.7.2
2024-09-12 13:35:46 -04:00
dougbtv
38d03eb816 Bumps net-attach-def client library to v1.7.2
This fixes the default:true for multiple interface returns from CNI for cluster default network, where all interfaces in that return were marked as default:true in the network-status
2024-09-12 11:25:26 -04:00
Doug Smith
b554c96160 Merge pull request #1334 from dougbtv/disable-dra-e2e-temporarily
Disabled DRA test temporarily
2024-09-12 10:55:16 -04:00
dougbtv
92ff1b1ee8 Disabled DRA test temporarily 2024-09-12 10:06:17 -04:00
Doug Smith
31e77aafab Merge pull request #1321 from ah8ad3/update-install-readme
Doc: change install from file to url in readme, how-to-use
2024-08-29 09:41:23 -04:00
Ahmad Zolfaghari
dec0607a94 doc: change install from file to url in readme, how-to-use
Signed-off-by: Ahmad Zolfaghari <ah8ad3@gmail.com>
2024-08-09 16:32:07 +03:30
7 changed files with 21 additions and 14 deletions

View File

@@ -85,9 +85,9 @@ jobs:
working-directory: ./e2e working-directory: ./e2e
run: ./test-default-route1.sh run: ./test-default-route1.sh
- name: Test DRA integration # - name: Test DRA integration
working-directory: ./e2e # working-directory: ./e2e
run: ./test-dra-integration.sh # run: ./test-dra-integration.sh
- name: Export kind logs - name: Export kind logs
if: always() if: always()

View File

@@ -24,10 +24,10 @@ Here's an illustration of the network interfaces attached to a pod, as provision
The quickstart installation method for Multus requires that you have first installed a Kubernetes CNI plugin to serve as your pod-to-pod network, which we refer to as your "default network" (a network interface that every pod will be created with). Each network attachment created by Multus will be in addition to this default network interface. For more detail on installing a default network CNI plugin, refer to our [quick-start guide](docs/quickstart.md). The quickstart installation method for Multus requires that you have first installed a Kubernetes CNI plugin to serve as your pod-to-pod network, which we refer to as your "default network" (a network interface that every pod will be created with). Each network attachment created by Multus will be in addition to this default network interface. For more detail on installing a default network CNI plugin, refer to our [quick-start guide](docs/quickstart.md).
Clone this GitHub repository, and apply a daemonset which installs Multus using `kubectl`. From the root directory of the clone, apply the daemonset YAML file: To use latest features try command below which applies a daemonset and installs thick Multus using `kubectl`:
``` ```
cat ./deployments/multus-daemonset-thick.yml | kubectl apply -f - kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset-thick.yml
``` ```
This will configure your systems to be ready to use Multus CNI, but, to get started with adding additional interfaces to your pods, refer to our complete [quick-start guide](docs/quickstart.md) This will configure your systems to be ready to use Multus CNI, but, to get started with adding additional interfaces to your pods, refer to our complete [quick-start guide](docs/quickstart.md)
@@ -39,7 +39,7 @@ With the multus 4.0 release, we introduce a new client/server-style plugin deplo
We recommend using the thick plugin in most environments, but if you wish to run the thin plugin, or are in a resource-constrained environment, you may do so with: We recommend using the thick plugin in most environments, but if you wish to run the thin plugin, or are in a resource-constrained environment, you may do so with:
``` ```
cat ./deployments/multus-daemonset.yml | kubectl apply -f - kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset.yml
``` ```
## Additional Installation Options ## Additional Installation Options

View File

@@ -19,13 +19,13 @@ You may acquire the Multus binary via compilation (see the [developer guide](dev
*Via Daemonset method* *Via Daemonset method*
As a [quickstart](quickstart.md), you may apply these YAML files (included in the clone of this repository). Run this command (typically you would run this on the master, or wherever you have access to the `kubectl` command to manage your cluster). As a [quickstart](quickstart.md), you may apply these YAML files. Run this command (typically you would run this on the master, or wherever you have access to the `kubectl` command to manage your cluster).
cat ./deployments/multus-daemonset.yml | kubectl apply -f - # thin deployment kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset.yml # thin deployment
or or
cat ./deployments/multus-daemonset-thick.yml | kubectl apply -f - # thick (client/server) deployment kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset-thick.yml # thick (client/server) deployment
If you need more comprehensive detail, continue along with this guide, otherwise, you may wish to either [follow the quickstart guide]() or skip to the ['Create network attachment definition'](#create-network-attachment-definition) section. If you need more comprehensive detail, continue along with this guide, otherwise, you may wish to either [follow the quickstart guide]() or skip to the ['Create network attachment definition'](#create-network-attachment-definition) section.

2
go.mod
View File

@@ -8,7 +8,7 @@ require (
github.com/containernetworking/plugins v1.1.0 github.com/containernetworking/plugins v1.1.0
github.com/fsnotify/fsnotify v1.6.0 github.com/fsnotify/fsnotify v1.6.0
github.com/go-logr/logr v1.3.0 // indirect github.com/go-logr/logr v1.3.0 // indirect
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.1 github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.4
github.com/onsi/ginkgo/v2 v2.13.2 github.com/onsi/ginkgo/v2 v2.13.2
github.com/onsi/gomega v1.30.0 github.com/onsi/gomega v1.30.0
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect

4
go.sum
View File

@@ -825,8 +825,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.1 h1:n4FpoJ6aGDx8ULfya/C4ycrMDuPZlf7AtPyrT4+rIP4= github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.4 h1:vn0d/47rWzEHpDl3Ac7MiD9DfKK3gNBezI5khPKE7AQ=
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.1/go.mod h1:CM7HAH5PNuIsqjMN0fGc1ydM74Uj+0VZFhob620nklw= github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.4/go.mod h1:CM7HAH5PNuIsqjMN0fGc1ydM74Uj+0VZFhob620nklw=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=

View File

@@ -136,6 +136,11 @@ func CreateNetworkStatuses(r cnitypes.Result, networkName string, defaultNetwork
return nil, fmt.Errorf("error converting the type.Result to cni100.Result: %v", err) return nil, fmt.Errorf("error converting the type.Result to cni100.Result: %v", err)
} }
if len(result.Interfaces) == 1 {
networkStatus, err := CreateNetworkStatus(r, networkName, defaultNetwork, dev)
return []*v1.NetworkStatus{networkStatus}, err
}
// Discover default routes upfront and reuse them if necessary. // Discover default routes upfront and reuse them if necessary.
var useDefaultRoute []string var useDefaultRoute []string
for _, route := range result.Routes { for _, route := range result.Routes {
@@ -149,11 +154,12 @@ func CreateNetworkStatuses(r cnitypes.Result, networkName string, defaultNetwork
// Initialize NetworkStatus for each container interface (e.g. with sandbox present) // Initialize NetworkStatus for each container interface (e.g. with sandbox present)
indexOfFoundPodInterface := 0 indexOfFoundPodInterface := 0
foundFirstSandboxIface := false
for i, iface := range result.Interfaces { for i, iface := range result.Interfaces {
if iface.Sandbox != "" { if iface.Sandbox != "" {
ns := &v1.NetworkStatus{ ns := &v1.NetworkStatus{
Name: networkName, Name: networkName,
Default: defaultNetwork, Default: defaultNetwork && !foundFirstSandboxIface,
Interface: iface.Name, Interface: iface.Name,
Mac: iface.Mac, Mac: iface.Mac,
Mtu: iface.Mtu, Mtu: iface.Mtu,
@@ -166,6 +172,7 @@ func CreateNetworkStatuses(r cnitypes.Result, networkName string, defaultNetwork
// Map original index to the new slice index // Map original index to the new slice index
indexMap[i] = indexOfFoundPodInterface indexMap[i] = indexOfFoundPodInterface
indexOfFoundPodInterface++ indexOfFoundPodInterface++
foundFirstSandboxIface = true
} }
} }

2
vendor/modules.txt vendored
View File

@@ -114,7 +114,7 @@ github.com/josharian/intern
# github.com/json-iterator/go v1.1.12 # github.com/json-iterator/go v1.1.12
## explicit; go 1.12 ## explicit; go 1.12
github.com/json-iterator/go github.com/json-iterator/go
# github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.1 # github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.4
## explicit; go 1.21 ## explicit; go 1.21
github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io
github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1 github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1