Skip to content

Commit 88e97a0

Browse files
authored
Merge branch 'main' into add_worker_unidelta_ipv6
2 parents 52f9c6c + d60373f commit 88e97a0

File tree

10 files changed

+129
-51
lines changed

10 files changed

+129
-51
lines changed
Lines changed: 62 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,81 @@
11
# Common Design Pitfalls
22

3-
This document lists common pitfalls that have been observed in the process of creating
4-
and modifying VAs and DTs.
3+
This document lists common pitfalls that have been observed in the process of
4+
creating and modifying VAs and DTs.
55

66
## Accidental OpenStackControlPlane Overwrites
77

8-
In general, it is a best practice to keep all kustomizations (`patches`, `replacements`, etc)
9-
for a particular resource in one `kustomization.yaml` file. Sometimes, however, it is
10-
necessary to only perform a subset of `OpenStackControlPlane` kustomizations at a certain stage
11-
of the deployment process. For instance, you might not want to kustomize an `OpenStackControlPlane`
12-
CR with certain data during its initial creation stage because that data is not yet available
13-
for use. Thus it would make sense to have a later stage and `kustomization.yaml` file to
14-
add those kustomzations once the requisite data is available (perhaps during the data plane
15-
deployment stage).
16-
17-
**What is crucial to keep in mind is that any kustomizations to a resource in an earlier stage
18-
will be lost/overwritten in later stages where that same resource is modified _if_ those stages
19-
do not reference the same `kustomization.yaml` that the earlier stage utilized.** Thus it is
20-
best to have a base `kustomization.yaml` for a given resource for all kustomizations common to
21-
all stages -- and all those stages should thus reference that `kustomization.yaml`. Then, if
22-
later stages need specific changes for that resource, a separate `kustomization.yaml` can be also
23-
used to apply those additional kustomizations beyond the base ones. This approach is also
24-
preferred to creating two somewhat-or-mostly duplicate `kustomization.yaml`s, one for the earlier
25-
stage and one for a later stage. Keeping things DRY by using a common base will make future
26-
potential changes to the `kustomization.yaml`s less prone to error, as changes to the common file
27-
will automatically be picked up by all deployment stages.
28-
29-
As an illustrative example of the best practice mentioned above, consider the following directory
30-
structure:
8+
In general, it is a best practice to keep all kustomizations (`patches`,
9+
`replacements`, etc) for a particular resource in one `kustomization.yaml`
10+
file.
11+
12+
In some cases it is necessary to only perform a subset of
13+
`OpenStackControlPlane` kustomizations at a certain stage of the deployment
14+
process. For instance, you might not want to kustomize an
15+
`OpenStackControlPlane` CR with certain data during its initial creation stage
16+
because that data is not yet available for use. In the case of a multi-stage
17+
deployment, it would make sense to have a separate `kustomization.yaml` file to
18+
add those kustomizations once the requisite data is available (perhaps during
19+
the data plane deployment stage).
20+
21+
**What is crucial to keep in mind is that any kustomizations to a resource in
22+
an earlier stage will be lost/overwritten in later stages where that same
23+
resource is modified _if_ those stages do not reference the same
24+
`kustomization.yaml` that the earlier stage utilized.**
25+
26+
It is best to have a base `kustomization.yaml` for a given resource for all
27+
kustomizations common to all stages -- and all those stages should reference
28+
that `kustomization.yaml`. If later stages need specific changes for that
29+
resource, a separate `kustomization.yaml` can used to apply those additional
30+
kustomizations beyond the base ones.
31+
32+
The use of common base files is preferred to creating two nearly-identical
33+
`kustomization.yaml` files; one for the earlier stage and one for a later
34+
stage. Keeping things DRY by using a common base will make future potential
35+
changes to the `kustomization.yaml` files less prone to error, as changes to
36+
the common file will automatically be picked up by all deployment stages.
37+
38+
As an illustrative example of the best practice mentioned above, consider the
39+
following directory structure:
3140

3241
```
3342
some_dt_or_va/control_plane/kustomization.yaml
3443
some_dt_or_va/data_plane/kustomization.yaml
3544
```
3645

37-
If the `data_plane/kustomization.yaml` needs to modify the `OpenStackControlPlane`, then it should
38-
reference `../control_plane/kustomization.yaml` as a `Component` and then add additional `replacements`
39-
and/or `patches` as needed. If it were to instead reference this repo's [lib/control-plane](../../lib/control-plane)
40-
directory as its base `OpenStackControlPlane` `Component`, then the `../control_plane/kustomization.yaml`
41-
kustomizations would be lost, since the `OpenStackControlPlane` CR would be generated and applied without
42-
them.
46+
If the `data_plane/kustomization.yaml` needs to modify the
47+
`OpenStackControlPlane`, then it should reference
48+
`../control_plane/kustomization.yaml` as a `Component` and then add additional
49+
`replacements` and/or `patches` as needed.
50+
51+
If it were to instead reference this repositories
52+
[lib/control-plane](../../lib/control-plane) directory as its base
53+
`OpenStackControlPlane` `Component`, then the
54+
`../control_plane/kustomization.yaml` kustomizations would be lost, since the
55+
`OpenStackControlPlane` CR would be generated and applied without them.
4356

44-
It also follows in this scenario that, as mentioned above, the `OpenStackControlPlane` kustomizations for
45-
its initial creation stage should be located in one and only one `kustomization.yaml`. Thus you would
46-
want to avoid something like this...
57+
The kustomizations for an `OpenStackControlPlane` resource should be within a
58+
single `kustomization.yaml` that contains the kustomizations for the initial
59+
creation stage. You want to avoid the use of multiple files, such as creating
60+
an additional sub-directory within the same base directory containing the
61+
configuration. The following would be an example to avoid:
4762

4863
```
4964
some_dt_or_va/control_plane/kustomization.yaml
5065
some_dt_or_va/control_plane/some_subdir/kustomization.yaml
5166
some_dt_or_va/data_plane/kustomization.yaml
5267
```
5368

54-
..._if_ `some_dt_or_va/control_plane/some_subdir/kustomization.yaml` has further kustomizations to the
55-
`OpenStackControlPlane` beyond `some_dt_or_va/control_plane/kustomization.yaml`. (It would be fine, for
56-
instance, if that subdirectory was modifying some other resource like `NodeNetworkConfigurationPolicy`).
57-
The reason for this is again that, if later stages do not want to accidentally overwrite earlier
58-
`OpenStackControlPlane` kustomizations, those later stages will need to reference both
59-
`../control_plane/kustomization.yaml` and `../control_plane/some_subdir/kustomization.yaml` in the case
60-
that those stages are modifying the `OpenStackControlPlane`. It would be better for the two directories
61-
to be collapsed into one, such that a single `kustomization.yaml` can be referenced as a `Component` to
62-
include all the previous stage's kustomizations and not inadvertently overwrite them.
69+
In some cases having an additional nested directory may be valid, in the case a
70+
subdirectory was modifying some other resource like
71+
`NodeNetworkConfigurationPolicy`.
72+
73+
If later stages do not want to accidentally overwrite earlier
74+
`OpenStackControlPlane` kustomizations, those later stages need to reference
75+
both `../control_plane/kustomization.yaml` and
76+
`../control_plane/some_subdir/kustomization.yaml` so that those stages are
77+
modifying the `OpenStackControlPlane`.
78+
79+
It would be better for the two directories to be collapsed into one, such that
80+
a single `kustomization.yaml` can be referenced as a `Component` to include all
81+
the previous stage's kustomizations and not inadvertently overwrite them.

dt/dcn/edpm-post-ceph/nodeset/kustomization.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ replacements:
9090
- spec.neutron.template.customServiceConfig
9191
options:
9292
create: true
93+
- source:
94+
kind: ConfigMap
95+
name: service-values
96+
fieldPath: data.ovn.template.ovnController.external-ids
97+
targets:
98+
- select:
99+
kind: OpenStackControlPlane
100+
fieldPaths:
101+
- spec.ovn.template.ovnController.external-ids
102+
options:
103+
create: true
93104
- source:
94105
kind: ConfigMap
95106
name: service-values

dt/osasinfra/edpm-post-ceph/nodeset/kustomization.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,3 +310,39 @@ replacements:
310310
- spec.ovn.template.ovnController.nicMappings
311311
options:
312312
create: true
313+
314+
- source:
315+
kind: ConfigMap
316+
name: service-values
317+
fieldPath: data.telemetry.enabled
318+
targets:
319+
- select:
320+
kind: OpenStackControlPlane
321+
fieldPaths:
322+
- spec.telemetry.enabled
323+
options:
324+
create: true
325+
326+
- source:
327+
kind: ConfigMap
328+
name: service-values
329+
fieldPath: data.telemetry.metricStorage.enabled
330+
targets:
331+
- select:
332+
kind: OpenStackControlPlane
333+
fieldPaths:
334+
- spec.telemetry.template.metricStorage.enabled
335+
options:
336+
create: true
337+
338+
- source:
339+
kind: ConfigMap
340+
name: service-values
341+
fieldPath: data.telemetry.ceilometer.enabled
342+
targets:
343+
- select:
344+
kind: OpenStackControlPlane
345+
fieldPaths:
346+
- spec.telemetry.template.ceilometer.enabled
347+
options:
348+
create: true

examples/dt/bmo01/control-plane/nncp/values.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ metadata:
99
data:
1010
openstack-operator-image: "quay.io/openstack-k8s-operators/openstack-operator-index:latest"
1111

12-
ocp:
13-
cluster_network_cidr: 192.168.16.0/20
14-
service_network_cidr: 172.30.0.0/16
15-
1612
node_0:
1713
name: master-0
1814
internalapi_ip: 172.17.0.10

examples/dt/dcn/edpm-pre-ceph/nodeset/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ data:
8888
gather_facts: false
8989
neutron_physical_bridge_name: br-ctl
9090
neutron_public_interface_name: eth0
91+
edpm_enable_chassis_gw: false
92+
edpm_ovn_availability_zones: []
9193
edpm_ceph_hci_pre_enabled_services:
9294
- ceph_mon
9395
- ceph_mgr

examples/dt/dcn/service-values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,15 @@ data:
223223
network_vlan_ranges = datacentre:1:1000,leaf1:1:1000,leaf2:1:1000
224224
[neutron]
225225
physnets = datacentre,leaf1,leaf2
226+
ovn:
227+
template:
228+
ovnController:
229+
external-ids:
230+
availability-zones: []
231+
enable-chassis-as-gateway: true
232+
ovn-bridge: br-int
233+
ovn-encap-type: geneve
234+
system-id: random
226235
nova:
227236
customServiceConfig: |
228237
[DEFAULT]

examples/dt/osasinfra/control-plane.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Assumptions
44

55
- A storage class called `local-storage` should already exist.
6+
- Cluster observability operator is already deployed.
67

78
## Initialize
89

examples/dt/osasinfra/service-values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,10 @@ data:
113113
nicMappings:
114114
datacentre: ocpbr
115115
octavia: octbr
116+
117+
telemetry:
118+
enabled: true
119+
metricStorage:
120+
enabled: true
121+
ceilometer:
122+
enabled: true

examples/dt/osasinfra/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ data:
1515
- neutron-metadata
1616
- libvirt
1717
- nova
18+
- telemetry
1819
ceph:
1920
conf: CHANGEME_CEPH_CONF
2021
keyring: CHANGEME_CEPH_KEYRING

examples/dt/uni01alpha/control-plane/nncp/values.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ metadata:
99
data:
1010
openstack-operator-image: "quay.io/openstack-k8s-operators/openstack-operator-index:latest"
1111

12-
ocp:
13-
cluster_network_cidr: 192.168.16.0/20
14-
service_network_cidr: 172.30.0.0/16
15-
1612
node_0:
1713
name: master-0
1814
internalapi_ip: 172.17.0.10

0 commit comments

Comments
 (0)