-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance and efficiency improvements in daemon/server mode #1154
Commits on Sep 13, 2023
-
k8sclient: make InClusterK8sClient() call GetK8sClient()
We want the in-cluster client that the multus server uses to use the same client config (QPS, protobuf, grpc, etc) as the regular client. Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fff8519 - Browse repository at this point
Copy the full SHA fff8519View commit details -
Multus is a pretty critical piece of infrastructure, so it shouldn't be subject to the same lower QPS limits as most components are. Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 752f28c - Browse repository at this point
Copy the full SHA 752f28cView commit details -
server: make CmdAdd/Del/Check struct member functions
Then we can just use the Server struct kube client and exec rather than passing them through the function parameters. Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6b8d24c - Browse repository at this point
Copy the full SHA 6b8d24cView commit details -
vendor: add client-go and more apimachinery modules
We'll need these for the next commit. Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7c68481 - Browse repository at this point
Copy the full SHA 7c68481View commit details -
daemon: remove unused done channel
Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1605ffc - Browse repository at this point
Copy the full SHA 1605ffcView commit details -
Move server start code to a common function that both regular and test code can use. Also shut down the server from the testcases. Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cec1a53 - Browse repository at this point
Copy the full SHA cec1a53View commit details
Commits on Sep 14, 2023
-
server: use a shared informer pod cache rather than direct apiserver …
…access When running in server mode we can use a shared informer to listen for Pod events from the apiserver, and grab pod info from that cache rather than doing direct apiserver requests each time. This reduces apiserver load and retry latency, since multus can poll the local cache more frequently than it should do direct apiserver requests. Oddly static pods don't show up in the informer by the timeout and require a direct apiserver request. Since static pods are not common and are typically long-running, it should not be a big issue to fall back to direct apiserver access for them. Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 50c0357 - Browse repository at this point
Copy the full SHA 50c0357View commit details -
server/config: simplify ConfigManager creation
A couple of the setup variables for NewManager*() are already in the multus config that it gets passed, so use those instead of passing explicitly. Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4ade856 - Browse repository at this point
Copy the full SHA 4ade856View commit details -
server/config: consolidate ConfigManager start and fsnotify watching
Simplify setup by moving the post-creation operations like GenerateConfig() and PersistMultusConfig() into a new Start() function that also begins watching the configuration directory. This better encapsulates the manager functionality in the object. We can also get rid of the done channel passed to the config manager and just use the existing WaitGroup to determine when to exit the daemon main(). Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8539a47 - Browse repository at this point
Copy the full SHA 8539a47View commit details -
server/config: fix MonitorPluginConfiguration test
The test was comparing the same configuration to itself, since nothing in the changed CNI configuration is used in the written multus configuration. Instead make sure the updated CNI config contains something that will be reflected in the written multus configuration, and while we're there use a more robust way to wait for the config to be written via gomega.Eventually(). Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c2add82 - Browse repository at this point
Copy the full SHA c2add82View commit details -
server/config: un-export some functions no longer used outside the mo…
…dule Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fb4f4aa - Browse repository at this point
Copy the full SHA fb4f4aaView commit details -
server/config: use filepath.Join()
Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b0df7dd - Browse repository at this point
Copy the full SHA b0df7ddView commit details -
server: don't set CNI config readinessindicatorfile when using Config…
…Manager For whatever reason calling os.Stat() on the readiness indicator file from CmdAdd()/CmdDel() when multus is running in server mode and is containerized often returns "file not found", which triggers the polling behavior of GetReadinessIndicatorFile(). This greatly delays CNI operations that should be pretty quick. Even if an exponential backoff is used, os.Stat() can still return "file not found" multiple times, even though the file clearly exists. But it turns out we don't need to check the readiness file in server mode when running with MultusConfigFile == "auto". In this mode the server starts the ConfigManager which (a) waits until the file exists and (b) fsnotify watches the readiness and (c) exits the daemon immediately if the file is deleted or moved. This means we can assume that while the daemon is running and the server is handling CNI requests that the readiness file exists; otherwise the daemon would have exited. Thus CmdAdd/CmdDel don't need to run a lot of possibly failing os.Stat() calls in the CNI hot paths. Signed-off-by: Dan Williams <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d9c06e9 - Browse repository at this point
Copy the full SHA d9c06e9View commit details