From 165e23b72c04643c39fb318af38822a54b59c8dd Mon Sep 17 00:00:00 2001 From: Tomofumi Hayashi Date: Tue, 27 Aug 2019 16:52:58 +0900 Subject: [PATCH] Support gateway in NetworkSelectionElement Changes config JSON from gateway to default-route, adds Readme, fixes lint Co-authored-by: dougbtv --- doc/how-to-use.md | 66 ++++++++++++++++++++++++++++++++++++++++++ k8sclient/k8sclient.go | 16 ++++++++++ multus/multus.go | 9 ++++++ netutils/netutils.go | 62 +++++++++++++++++++++++++++++++++++++++ types/conf.go | 28 ++++++++++++++++++ types/types.go | 7 ++++- 6 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 netutils/netutils.go diff --git a/doc/how-to-use.md b/doc/how-to-use.md index a67c3522d..f9edbc2ca 100644 --- a/doc/how-to-use.md +++ b/doc/how-to-use.md @@ -469,6 +469,72 @@ $ kubectl exec -it pod-case-06 -- ip -d address | macvlan1 | macvlan interface (macvlan-conf-1) | | net2 | macvlan interface (macvlan-conf-2) | +## Specifying a default route for a specific attachment + +Typically, the default route for a pod will route traffic over the `eth0` and therefore over the cluster-wide default network. You may wish to specify that a different network attachment will have the default route. + +You can achieve this by using the JSON formatted annotation and specifying a `default-route` key. + +*NOTE*: It's important that you consider that this may impact some functionality of getting traffic to route over the cluster-wide default network. + +For example, we have a this configuration for macvlan: + +``` +cat <