k8s: networkmanager leaves the pod network's interfaces unmanaged
This commit is contained in:
parent
e0b3c0a644
commit
0998c82555
1 changed files with 52 additions and 1 deletions
|
|
@ -58,6 +58,16 @@ let
|
|||
}
|
||||
);
|
||||
|
||||
# The node with NetworkManager on, a host that has no node with it on, and
|
||||
# (below, `joined`) an agent with it on. `allLocal` is the node with it off.
|
||||
networkManagerOn = {
|
||||
networking.networkmanager.enable = true;
|
||||
};
|
||||
nodeWithNm = hiveWith [ networkManagerOn ] (
|
||||
lib.recursiveUpdate { deploy.hive-controller.enable = true; } nodeSettings
|
||||
);
|
||||
noClusterWithNm = hiveWith [ networkManagerOn ] { deploy.hive-controller.enable = false; };
|
||||
|
||||
# Two hives on a store host with the node: the policy of each differs by the
|
||||
# join token. Shares nothing of `onCluster`'s controller, which lists the
|
||||
# hives.
|
||||
|
|
@ -81,7 +91,7 @@ let
|
|||
# A host that joins that cluster: an agent with the store identity its join
|
||||
# token is read under. The only fixture without `deploy.k8s.enable`, which
|
||||
# is what it claims about.
|
||||
joined = hiveWith [ semiSpreadWg ] {
|
||||
joined = hiveWith [ semiSpreadWg networkManagerOn ] {
|
||||
deploy.k8s.join.server = "192.168.1.10";
|
||||
deploy.k8s.address = "192.168.1.11";
|
||||
deploy.hive-controller.tls = {
|
||||
|
|
@ -461,6 +471,28 @@ let
|
|||
&& refuses "overlap the hive bridge"
|
||||
&& refuses "overlap each other";
|
||||
}
|
||||
{
|
||||
# NetworkManager rewrites the routes of the interfaces the CNI makes, so
|
||||
# it is told to leave `cni0`, flannel's devices and the pods' veth ends
|
||||
# alone, on the node and on an agent. The literals are spelled here, not
|
||||
# read from the module. Each absence arm has its presence control: the
|
||||
# node and the agent have the list, so the lookup finds it where it is.
|
||||
name = "NetworkManager leaves the pod network's interfaces unmanaged on a node and on an agent, and is untouched where it is off or where there is no cluster";
|
||||
ok =
|
||||
let
|
||||
expected = [
|
||||
"interface-name:cni0"
|
||||
"interface-name:flannel*"
|
||||
"interface-name:veth*"
|
||||
];
|
||||
in
|
||||
nodeWithNm.networking.networkmanager.unmanaged == expected
|
||||
&& joined.networking.networkmanager.unmanaged == expected
|
||||
&& !allLocal.networking.networkmanager.enable
|
||||
&& allLocal.networking.networkmanager.unmanaged == [ ]
|
||||
&& noClusterWithNm.networking.networkmanager.enable
|
||||
&& noClusterWithNm.networking.networkmanager.unmanaged == [ ];
|
||||
}
|
||||
{
|
||||
# An agent takes the backend from its server, and `--flannel-backend` is
|
||||
# a server flag that an agent refuses, so the agent's flags carry none.
|
||||
|
|
|
|||
Loading…
Reference in a new issue