Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Update kustomize examples
Browse files Browse the repository at this point in the history
Renaming values to make easier to compose i.e.  replace components with other scenarios

Signed-off-by: Fabricio Aguiar <[email protected]>
  • Loading branch information
fao89 committed Mar 19, 2024
1 parent 60b12bf commit 45f3444
Show file tree
Hide file tree
Showing 32 changed files with 170 additions and 106 deletions.
8 changes: 4 additions & 4 deletions examples/baremetal/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ replacements:
# OpenStackDataPlaneNodeSet customizations
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-baremetal-values
fieldPath: data.nodeset.nodetemplate.ansible.vars.edpm_sshd_allowed_ranges
targets:
- select:
Expand All @@ -25,7 +25,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-baremetal-values
fieldPath: data.nodeset.baremetalsettemplate
targets:
- select:
Expand All @@ -36,7 +36,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-baremetal-values
fieldPath: data.preProvisioned
targets:
- select:
Expand All @@ -47,7 +47,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-baremetal-values
fieldPath: data.nodeset.nodetemplate.networks
targets:
- select:
Expand Down
2 changes: 1 addition & 1 deletion examples/baremetal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: DataPlaneConfig
metadata:
name: edpm-values
name: edpm-baremetal-values
annotations:
config.kubernetes.io/local-config: "true"
data:
Expand Down
31 changes: 31 additions & 0 deletions examples/base/files/nic-config.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
{% set mtu_list = [ctlplane_mtu] %}
{% for network in role_networks %}
{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }}
{%- endfor %}
{% set min_viable_mtu = mtu_list | max %}
network_config:
- type: ovs_bridge
name: {{ neutron_physical_bridge_name }}
mtu: {{ min_viable_mtu }}
use_dhcp: false
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }}
routes: {{ ctlplane_host_routes }}
members:
- type: interface
name: nic1
mtu: {{ min_viable_mtu }}
# force the MAC address of the bridge to this interface
primary: true
{% for network in role_networks %}
- type: vlan
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
addresses:
- ip_netmask:
{{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }}
routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }}
{% endfor %}
15 changes: 13 additions & 2 deletions examples/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@ kind: Component
resources:
- crs/openstackdataplanenodeset.yaml
- crs/openstackdataplanedeployment.yaml
- vars/nic-config.yaml
- vars/neutron.yaml

namespace: openstack

configMapGenerator:
- name: network-config-template
files:
- network_config_template=files/nic-config.j2
options:
disableNameSuffixHash: true
- name: neutron-edpm
literals:
- physical_bridge_name=br-ex
- public_interface_name=eth0
options:
disableNameSuffixHash: true

configurations:
- config/nodesetname.yaml
- config/varsfromname.yaml
7 changes: 0 additions & 7 deletions examples/base/vars/neutron.yaml

This file was deleted.

37 changes: 0 additions & 37 deletions examples/base/vars/nic-config.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions examples/bgp/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Component
namespace: openstack

components:
- ../base
- ../preprovisioned # for baremetal nodes, replace with baremetal

resources:
- values.yaml
Expand All @@ -13,7 +13,7 @@ replacements:
# OpenStackDataPlaneNodeSet customizations
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-bgp-values
fieldPath: data.nodeset.nodetemplate.ansible.vars
targets:
- select:
Expand All @@ -24,7 +24,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-bgp-values
fieldPath: data.nodeset.services
targets:
- select:
Expand Down
2 changes: 1 addition & 1 deletion examples/bgp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: DataPlaneConfig
metadata:
name: edpm-values
name: edpm-bgp-values
annotations:
config.kubernetes.io/local-config: "true"
data:
Expand Down
6 changes: 3 additions & 3 deletions examples/bgp_ovn_cluster/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Component
namespace: openstack

components:
- ../base
- ../preprovisioned # for baremetal nodes, replace with baremetal

resources:
- values.yaml
Expand All @@ -13,7 +13,7 @@ replacements:
# OpenStackDataPlaneNodeSet customizations
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-bgp-ovn-cluster-values
fieldPath: data.nodeset.nodetemplate.ansible.vars
targets:
- select:
Expand All @@ -24,7 +24,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-bgp-ovn-cluster-values
fieldPath: data.nodeset.services
targets:
- select:
Expand Down
2 changes: 1 addition & 1 deletion examples/bgp_ovn_cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: DataPlaneConfig
metadata:
name: edpm-values
name: edpm-bgp-ovn-cluster-values
annotations:
config.kubernetes.io/local-config: "true"
data:
Expand Down
6 changes: 3 additions & 3 deletions examples/ceph/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace: openstack
nameSuffix: -ceph

components:
- ../base
- ../preprovisioned # for baremetal nodes, replace with baremetal

resources:
- values.yaml
Expand All @@ -14,7 +14,7 @@ replacements:
# OpenStackDataPlaneNodeSet customizations
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-ceph-values
fieldPath: data.nodeset.services
targets:
- select:
Expand All @@ -25,7 +25,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-ceph-values
fieldPath: data.nodetemplate.extramounts
targets:
- select:
Expand Down
2 changes: 1 addition & 1 deletion examples/ceph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: DataPlaneConfig
metadata:
name: edpm-values
name: edpm-ceph-values
annotations:
config.kubernetes.io/local-config: "true"
data:
Expand Down
12 changes: 6 additions & 6 deletions examples/customnetworks/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace: openstack
nameSuffix: -custom-network

components:
- ../base
- ../preprovisioned # for baremetal nodes, replace with baremetal

resources:
- values.yaml
Expand All @@ -14,7 +14,7 @@ replacements:
# OpenStackDataPlaneNodeSet customizations
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-custom-networks-values
fieldPath: data.nodeset.nodetemplate.ansible.vars.neutron_public_interface_name
targets:
- select:
Expand All @@ -25,7 +25,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-custom-networks-values
fieldPath: data.nodeset.nodetemplate.ansible.vars.ctlplane_dns_nameservers
targets:
- select:
Expand All @@ -36,7 +36,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-custom-networks-values
fieldPath: data.nodeset.nodetemplate.ansible.vars.edpm_ovn_dbs
targets:
- select:
Expand All @@ -47,7 +47,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-custom-networks-values
fieldPath: data.nodeset.nodetemplate.ansible.vars.edpm_sshd_allowed_ranges
targets:
- select:
Expand All @@ -58,7 +58,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-custom-networks-values
fieldPath: data.nodeset.nodes
targets:
- select:
Expand Down
2 changes: 1 addition & 1 deletion examples/customnetworks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: DataPlaneConfig
metadata:
name: edpm-values
name: edpm-custom-networks-values
annotations:
config.kubernetes.io/local-config: "true"
data:
Expand Down
8 changes: 4 additions & 4 deletions examples/networker/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace: openstack
nameSuffix: -networker

components:
- ../base
- ../preprovisioned # for baremetal nodes, replace with baremetal

resources:
- values.yaml
Expand All @@ -14,7 +14,7 @@ replacements:
# OpenStackDataPlaneNodeSet customizations
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-networker-values
fieldPath: data.nodeset.nodetemplate.ansible.vars.edpm_enable_chassis_gw
targets:
- select:
Expand All @@ -25,7 +25,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-networker-values
fieldPath: data.nodeset.services
targets:
- select:
Expand All @@ -36,7 +36,7 @@ replacements:
create: true
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-networker-values
fieldPath: data.nodeset.nodes
targets:
- select:
Expand Down
2 changes: 1 addition & 1 deletion examples/networker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: DataPlaneConfig
metadata:
name: edpm-values
name: edpm-networker-values
annotations:
config.kubernetes.io/local-config: "true"
data:
Expand Down
4 changes: 2 additions & 2 deletions examples/nmstate/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Component
namespace: openstack

components:
- ../base
- ../preprovisioned # for baremetal nodes, replace with baremetal

resources:
- values.yaml
Expand All @@ -13,7 +13,7 @@ replacements:
# OpenStackDataPlaneNodeSet customizations
- source:
kind: DataPlaneConfig
name: edpm-values
name: edpm-nmstate-values
fieldPath: data.nodeset.nodetemplate.ansible.vars
targets:
- select:
Expand Down
2 changes: 1 addition & 1 deletion examples/nmstate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: DataPlaneConfig
metadata:
name: edpm-values
name: edpm-nmstate-values
annotations:
config.kubernetes.io/local-config: "true"
data:
Expand Down
Loading

0 comments on commit 45f3444

Please sign in to comment.