-
Notifications
You must be signed in to change notification settings - Fork 299
OPNET-783: network: Add BGP VIP management support #3047
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
Open
mkowalski
wants to merge
3
commits into
openshift:master
Choose a base branch
from
mkowalski:bgp-vip-management
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| {{ if .BGPVIPManagement }} | ||
| # RBAC for the frr-k8s static pod on control plane nodes (BGP VIP | ||
| # management). The static pod authenticates with the node kubeconfig, whose | ||
| # identity is the MCO node-bootstrapper ServiceAccount. | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: frr-k8s-static-pod | ||
| rules: | ||
| - apiGroups: | ||
| - frrk8s.metallb.io | ||
| resources: | ||
| - frrconfigurations | ||
| - frrk8sconfigurations | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| # No delete: stale state objects are removed by frr-k8s's status cleaner. | ||
| - apiGroups: | ||
| - frrk8s.metallb.io | ||
| resources: | ||
| - frrnodestates | ||
| - bgpsessionstates | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - create | ||
| - update | ||
| - patch | ||
| - apiGroups: | ||
| - frrk8s.metallb.io | ||
| resources: | ||
| - frrnodestates/status | ||
| - bgpsessionstates/status | ||
| verbs: | ||
| - get | ||
| - update | ||
| - patch | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - nodes | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: frr-k8s-static-pod | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: frr-k8s-static-pod | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: node-bootstrapper | ||
| namespace: openshift-machine-config-operator | ||
| --- | ||
| # Read-only subset of the DaemonSet SA's Role in 002-rbac.yaml. | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: frr-k8s-static-pod | ||
| namespace: openshift-frr-k8s | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - secrets | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - pods | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: frr-k8s-static-pod | ||
| namespace: openshift-frr-k8s | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: frr-k8s-static-pod | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: node-bootstrapper | ||
| namespace: openshift-machine-config-operator | ||
| {{ end }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # BGP-based VIP management | ||
|
|
||
| Feature gate: `BGPBasedVIPManagement` (DevPreviewNoUpgrade). BareMetal | ||
| platform only, and only when the Infrastructure CR reports | ||
| `status.platformStatus.baremetal.vipManagement: BGP`. Without all three, | ||
| everything below is inert and frr-k8s behaves exactly as before. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| The FRR additional routing capability provider | ||
| (`network.operator.openshift.io/cluster`: | ||
| `spec.additionalRoutingCapabilities.providers: [FRR]`) is a hard prerequisite - it ships the FRRConfiguration CRD; when BGP | ||
| VIP management is active without it, rendering fails explicitly. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| Enhancement: openshift/enhancements#1982. | ||
|
|
||
| ## What CNO does | ||
|
|
||
| When active, CNO renders a single cluster-wide `FRRConfiguration` | ||
| (`openshift-frr-k8s/bgp-vip`) from the installer-generated `bgp-vip-config` | ||
| ConfigMap: | ||
|
|
||
| - The CR spec carries the BGP **sessions** (neighbors, optional BFD). | ||
| - VIP **advertisement** is in `rawConfig`: `redistribute table-direct 198` | ||
| filtered to exactly the API/ingress VIP prefixes, plus per-neighbor egress | ||
| permits. kube-vip (rendered by MCO) installs a VIP route into kernel table | ||
| 198 only while that node's backend health check passes, so each node | ||
| advertises a VIP only while it can serve it; withdrawal is automatic. | ||
| Advertisement cannot use the CRD's `prefixes`/`toAdvertise` surface: it | ||
| renders unconditional `network` statements and cannot express redistributed | ||
| routes (native support proposed in metallb/frr-k8s#469). | ||
|
|
||
| ## Placement | ||
|
|
||
| Control plane nodes run an MCO-rendered frr-k8s **static pod** (needed at | ||
| bootstrap, before any workload can schedule). The frr-k8s DaemonSet therefore | ||
| avoids masters by role under BGP VIP management; on compact/SNO topologies it | ||
| correctly matches zero nodes. Workers keep the DaemonSet and advertise the | ||
| ingress VIP when they host healthy routers. | ||
|
|
||
| ## RBAC | ||
|
|
||
| The static pod authenticates with the node kubeconfig (the MCO | ||
| node-bootstrapper ServiceAccount). `003-static-pod-rbac.yaml` grants it the | ||
| reads the frr-k8s controller's informers need and write access to | ||
| `FRRNodeState`/`BGPSessionState`. Rendered only under BGP VIP management. | ||
| Per-node write scoping is not expressible in RBAC; a ValidatingAdmissionPolicy | ||
| is planned follow-up. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.