Commit 9c6a40a
committed
Add OVN RBAC support with per-node ovn-controller certificates
Enable OVN role-based access control (RBAC) on the Southbound database
so that ovn-controller nodes can only modify their own chassis rows.
When the openstack-operator provides an RBAC issuer name (from a
dedicated rootca-ovn-rbac CA, see patch [1]), this patch:
* Creates per-node cert-manager Certificate CRs for each ovn-controller
pod, with CN set to a deterministic UUID5 system-id derived from the
node name (ComputeSystemID). This CN must match the chassis
system-id for RBAC to authorize operations.
* Copies the RBAC client cert/key into /etc/openvswitch/ on each node
via the config job, and switches ovn-controller to use these dedicated
paths instead of the shared OVN DB cert.
* Mounts the RBAC CA certificate into ovsdbserver-sb pods and builds a
combined CA bundle (regular CA + RBAC CA) so the SB database can
verify ovn-controller client certificates.
* Sets role=ovn-controller on the SB DB connection (port 6642) to enforce RBAC.
* Creates a second SB DB listener on port 16642 with full (unrestricted)
access, used by ovn-northd.
* Updates inactivity probe handling in setup.sh and runtime-config.sh to
iterate over all connections, since SB now has two listeners.
* ovn-controller POD now waits for the Northd to be ready before start,
it is done to avoid race condition when ovn-controller POD could be
started before Northd would populate RBAC rules in the SB DB and that
could cause issues with connection of the ovn-controller to the SB DB.
* remove OVS DaemonSet readiness gate in the ovncontroller controller -
it was there to make sure that local ovsdb is up so that config job
would be able to store config values in it. But init scripts are
already waiting actively for the ovsdb to become active before it
anything else will be done. This check is also causing deadlock with
deploying ovs and ovn-controller PODs now with RBAC enabled as
ovn-controller needs to have certificates ready to start and create
br-int brigde. That can't be done if the config job is not started and
config job couldn't be started because ovncontroller controller was
waiting for the OVS DaemonSet to be ready.
* Remove OVS DaemonSet readiness gate from the ovncontroller controller -
the gate ensured that the local ovsdb was running before the config job
attempted to store configuration values. However, the init scripts
already poll for ovsdb availability before doing anything else, making
the gate redundant.
With RBAC enabled, this gate also causes a deadlock: ovn-controller
needs its RBAC certificates to start and create the br-int bridge, but
those certificates are deployed by the config job, which cannot run
until the OVS DaemonSet is ready — and the OVS DaemonSet cannot become
ready without br-int.
[1] openstack-k8s-operators/openstack-operator#1906
Related: #OSPRH-1921
Closes: #OSPRH-1922
Assisted-by: claude-opus-4.6
Signed-off-by: Slawek Kaplonski <skaplons@redhat.com>1 parent d009c70 commit 9c6a40a
31 files changed
Lines changed: 867 additions & 43 deletions
File tree
- api
- bases
- v1beta1
- cmd
- config
- crd/bases
- rbac
- internal
- common
- controller
- ovncontroller
- ovndbcluster
- templates
- ovncontroller
- bin
- config
- ovndbcluster
- bin
- config
- test/functional
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
441 | 446 | | |
442 | 447 | | |
443 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
75 | 96 | | |
76 | 97 | | |
77 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
127 | 134 | | |
128 | 135 | | |
129 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
174 | 178 | | |
175 | 179 | | |
176 | 180 | | |
| |||
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
242 | 258 | | |
243 | 259 | | |
244 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
441 | 446 | | |
442 | 447 | | |
443 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
68 | 88 | | |
69 | 89 | | |
70 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | | - | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| |||
0 commit comments