We should add the Packet CCM to Lokomotive clusters deployed to Packet.
The CCM handles, for example, node changes and is gonna be needed to use the peer autodiscovery feature of MetalLB once it gets merged (we're currently using a patched version of MetalLB to have the feature).
When implemented, it will also hit #478 :disappointed:
Keep in mind this comment about things needed to bootstrap the CCM, since it'll probably apply to the Packet CCM too.
Looking into this
https://github.com/packethost/packet-ccm#bgp
The Packet CCM enables BGP for the project and enables it on all nodes as they come up.
@knrt10 FYI ^. We should verify that users can still decide not to enable BGP for a worker pool.
Current status:
v1.1.0 for packet-ccm is buggy and it does not contain MetalLb in the release. It is expected to be fixed in a week.I tried manually deploying ccm with current master. We had to deploy Lokomotive's MetalLb component for ccm to work. ccm watches and picks up the configMap config from metallb-system namespace. The problems that I faced are:
failed to update and sync nodes: failed to get metallb config map: could not parse config: yaml: unmarshal errors:
line 1: field peer-autodiscovery not found in type metallb.ConfigFile
These things should be fixed, once packet-ccm fix in their patch release
@knrt10 FYI ^. We should verify that users can still decide not to enable BGP for a worker pool.
Created #1178 to avoid regressing on this.
Also, I think this task will be blocked by https://github.com/packethost/packet-ccm/issues/100.
Next up is a e2e test for MetalLB-compatible labels on the nodes. We should ensure that metallb.lokomotive.io/peer-address and metallb.lokomotive.io/src-address labels are properly set on the nodes with BGP enabled. The source of the label is irrelevant (whether it comes from Ignition or CCM).
From https://github.com/packethost/packet-ccm/issues/100#issuecomment-724439586
Why can you not do it now? The bgp speakers are enabled in the loadbalancers.yaml deployment manifest. Can you not just modify the daemonset, updating its selectors, to control where the speakers are deployed?
@johananl are there some implications of enabling BGP session on all servers and controlling which nodes handle the traffic only by node selector on MetalLB speakers?
@johananl are there some implications of enabling BGP session on all servers and controlling which nodes handle the traffic only by node selector on MetalLB speakers?
One thing I see is, that as a compromised node, I can start BGP client myself and then capture the traffic. But on the other hand, with compromised node, I can label the Node object myself and still capture the traffic if I want.
One thing I see is, that as a compromised node, I can start BGP client myself and then capture the traffic. But on the other hand, with compromised node, I can label the Node object myself and still capture the traffic if I want.
We could use restricted labels like role, to for example mark those nodes with ingress role, but we do not have the ability to do it right now.
@invidian what you said is correct, enabling BGP expands the attack surface of a cluster, especially since we aren't using BGP authentication (although BGP authentication is a fairly weak security mechanism and in any case you should always protect a peer with a network access list, which Equinix does AFAIK).
One thing I see is, that as a compromised node, I can start BGP client myself and then capture the traffic. But on the other hand, with compromised node, I can label the Node object myself and still capture the traffic if I want.
Not necessarily. I can see cases where I have access to a low-privileged pod which can't do damage via the k8s API but can still initiate BGP connections to the ToR switch. A possible mitigation for that is to block outbound network access on TCP 179 when a node isn't supposed to run BGP.
Another small side effect is that with BGP enabled the Equinix ToR switches continually try to establish a BGP session with the nodes, which means some infrequent network spam on TCP 179.
Status update about the PR #1155:
disable_bgp = false, I added lokomotive.alpha.kinvolk.io/bgp-enabled label to nodes, so only nodes with lokomotive.alpha.kinvolk.io/bgp-enabled=true will have BGP enabled by CCMlokomotive.alpha.kinvolk.io/bgp-enabled=true label has actually BGP session created on Packet API. This will ensure that we don't break this functionality when migrating from Terraform-managed BGP session to CCM management.Next update:
Most helpful comment
Keep in mind this comment about things needed to bootstrap the CCM, since it'll probably apply to the Packet CCM too.