diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 031ebb4bc..1466979cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,11 @@ repos: - repo: local hooks: + - id: kustomize-docs + name: kustomize-docs + language: system + require_serial: true + entry: docs/kustomize_to_docs.sh - id: gotidy name: gotidy language: system diff --git a/docs/assemblies/proc_creating-a-set-of-data-plane-nodes.adoc b/docs/assemblies/proc_creating-a-set-of-data-plane-nodes.adoc index 66ed4d4cd..dab7fb9d6 100644 --- a/docs/assemblies/proc_creating-a-set-of-data-plane-nodes.adoc +++ b/docs/assemblies/proc_creating-a-set-of-data-plane-nodes.adoc @@ -8,31 +8,19 @@ Create an `OpenStackDataPlaneNodeSet` CR for each logical grouping of nodes in y .Procedure -. Copy the https://kustomize.io/[kustomize] examples on your workstation: - - git clone -n --depth=1 --filter=tree:0 \ - https://github.com/openstack-k8s-operators/dataplane-operator - cd dataplane-operator - git sparse-checkout set --no-cone examples - git checkout - cd examples - -. Use kustomize to create the `OpenStackDataPlaneDeployment` and `OpenStackDataPlaneNodeSet` CRs: - - * Pre-provisioned nodes: - - oc kustomize --load-restrictor LoadRestrictionsNone preprovisioned > openstack-edpm.yaml - - * Bare metal nodes: - - oc kustomize --load-restrictor LoadRestrictionsNone baremetal > openstack-edpm.yaml - +. Create an `OpenStackDataPlaneNodeSet` CR and save it to a file named `openstack-edpm.yaml` on your workstation: + -[NOTE] -==== -If desired, update the `values.yaml` file with values from your environment and add other kustomizations as needed before generating the CRs. Alternatively, the generated CRS can be directly edited before being applied. -==== +---- +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneNodeSet +metadata: + name: openstack-edpm-ipam +spec: + ... +---- + +* xref:ref_example-OpenStackDataPlaneNodeSet-CR-for-preprovisioned-nodes_dataplane[Example `OpenStackDataPlaneNodeSet` CR for pre-provisioned nodes] +* xref:ref_example-OpenStackDataPlaneNodeSet-CR-for-bare-metal-nodes_dataplane[Example `OpenStackDataPlaneNodeSet` CR for bare metal nodes] . The sample `OpenStackDataPlaneNodeSet` CR is connected to `cell1` by default. If you added additional Compute cells to the control plane and you want to connect the node set to one of the other cells, then you must create a custom service for the node set that includes the `Secret` CR for the cell: @@ -310,7 +298,7 @@ endif::[] . Save the `openstack-edpm.yaml` definition file. -. Create and <> the data plane resources: +. Create the data plane resources: + ---- $ oc create -f openstack-edpm.yaml diff --git a/docs/assemblies/proc_deploying-the-data-plane.adoc b/docs/assemblies/proc_deploying-the-data-plane.adoc index 337dc4e44..15d05659a 100644 --- a/docs/assemblies/proc_deploying-the-data-plane.adoc +++ b/docs/assemblies/proc_deploying-the-data-plane.adoc @@ -6,9 +6,7 @@ You use the `OpenStackDataPlaneDeployment` CRD to configure the services on the .Procedure -. Complete the steps from <> procedure, ensuring that you have a file named `openstack-edpm.yaml` on your workstation. - -. Optional: Update `nodeSets` to include all the `OpenStackDataPlaneNodeSet` CRs that you want to deploy: +. Create an `OpenStackDataPlaneDeployment` CR and save it to a file named `openstack-edpm-deploy.yaml` on your workstation. + ---- apiVersion: dataplane.openstack.org/v1beta1 @@ -25,10 +23,12 @@ spec: + * Replace `` with the names of the `OpenStackDataPlaneNodeSet` CRs that you want to include in your data plane deployment. +. Save the `openstack-edpm-deploy.yaml` deployment file. + . Deploy the data plane: + ---- -$ oc create -f openstack-edpm.yaml +$ oc create -f openstack-edpm-deploy.yaml ---- + You can view the Ansible logs while the deployment executes: diff --git a/docs/assemblies/ref_example-OpenStackDataPlaneNodeSet-CR-for-bare-metal-nodes.adoc b/docs/assemblies/ref_example-OpenStackDataPlaneNodeSet-CR-for-bare-metal-nodes.adoc index 00b38529d..3a39807e4 100644 --- a/docs/assemblies/ref_example-OpenStackDataPlaneNodeSet-CR-for-bare-metal-nodes.adoc +++ b/docs/assemblies/ref_example-OpenStackDataPlaneNodeSet-CR-for-bare-metal-nodes.adoc @@ -9,119 +9,103 @@ apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneNodeSet metadata: name: openstack-edpm-ipam + namespace: openstack spec: - env: <1> + baremetalSetTemplate: #<1> + bmhLabelSelector: + app: openstack + cloudUserName: cloud-admin + ctlplaneInterface: enp1s0 + env: #<2> - name: ANSIBLE_FORCE_COLOR value: "True" - services: <2> + networkAttachments: #<3> + - ctlplane + nodeTemplate: #<4> + ansible: + ansibleUser: cloud-admin #<5> + ansibleVars: #<6> + edpm_network_config_template: | #<7> + --- + {% 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 %} + edpm_nodes_validation_validate_controllers_icmp: false + edpm_nodes_validation_validate_gateway_icmp: false + edpm_sshd_allowed_ranges: + - 192.168.111.0/24 + enable_debug: false + gather_facts: false + neutron_physical_bridge_name: br-ex + neutron_public_interface_name: eth0 + ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret #<8> + networks: #<9> + - defaultRoute: true + name: ctlplane + subnetName: subnet1 + - name: internalapi + subnetName: subnet1 + - name: storage + subnetName: subnet1 + - name: tenant + subnetName: subnet1 + nodes: + edpm-compute-0: #<10> + hostName: edpm-compute-0 + preProvisioned: false + services: #<11> + - bootstrap + - download-cache - configure-network - validate-network - install-os - configure-os + - ssh-known-hosts - run-os + - reboot-os + - install-certs - ovn + - neutron-metadata - libvirt - nova - telemetry - baremetalSetTemplate: <3> - bmhLabelSelector: - app: openstack - ctlplaneInterface: enp1s0 - cloudUserName: cloud-admin - nodes: - edpm-compute-0: <4> - hostName: edpm-compute-0 - networkAttachments: <5> - - ctlplane - nodeTemplate: <6> - ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret <7> - networks: <8> - - name: CtlPlane - subnetName: subnet1 - defaultRoute: true - - name: InternalApi - subnetName: subnet1 - - name: Storage - subnetName: subnet1 - - name: Tenant - subnetName: subnet1 - managementNetwork: ctlplane - ansible: - ansibleUser: cloud-admin <9> - ansiblePort: 22 - ansibleVars: <10> - service_net_map: - nova_api_network: internal_api - nova_libvirt_network: internal_api - edpm_chrony_ntp_servers: - - pool.ntp.org - edpm_network_config_hide_sensitive_logs: false - edpm_network_config_template: | <11> - --- - {% 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_subnet_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 %} - edpm_network_config_hide_sensitive_logs: false - # These vars are for the network config templates themselves and are - # considered EDPM network defaults. - neutron_physical_bridge_name: br-ex - neutron_public_interface_name: eth0 - role_networks: - - InternalApi - - Storage - - Tenant - networks_lower: - External: external - InternalApi: internal_api - Storage: storage - Tenant: tenant - # edpm_nodes_validation - edpm_nodes_validation_validate_controllers_icmp: false - edpm_nodes_validation_validate_gateway_icmp: false - gather_facts: false - enable_debug: false - # edpm firewall, change the allowed CIDR if needed - edpm_sshd_configure_firewall: true - edpm_sshd_allowed_ranges: ['192.168.122.0/24'] - # SELinux module - edpm_selinux_mode: enforcing ---- -<1> Optional: A list of environment variables to pass to the pod. -<2> The services that are deployed on the data plane nodes in this `OpenStackDataPlaneNodeSet` CR. -<3> Configure the bare metal template for bare metal nodes that must be provisioned when creating the resource. -<4> The node definition reference, for example, `edpm-compute-0`. Each node in the node set must have a node definition. -<5> The networks the `ansibleee-runner` connects to, specified as a list of `netattach` resource names. -<6> The common configuration to apply to all nodes in this set of nodes. -<7> The name of the secret that you created in xref:proc_creating-the-SSH-key-secrets_{context}[Creating the SSH key secrets]. -<8> Networks for the bare metal nodes. -<9> The user associated with the secret you created in xref:proc_creating-the-SSH-key-secrets_{context}[Creating the SSH key secrets]. -<10> The Ansible variables that customize the set of nodes. For a complete list of Ansible variables, see https://openstack-k8s-operators.github.io/edpm-ansible/. -<11> The network configuration template to apply to nodes in the set. For sample templates, see https://github.com/openstack-k8s-operators/edpm-ansible/tree/main/roles/edpm_network_config/templates. +<1> Configure the bare metal template for bare metal nodes that must be provisioned when creating the resource. +<2> Optional: A list of environment variables to pass to the pod. +<3> The networks the `ansibleee-runner` connects to, specified as a list of `netattach` resource names. +<4> The common configuration to apply to all nodes in this set of nodes. +<5> The user associated with the secret you created in xref:proc_creating-the-SSH-key-secrets_{context}[Creating the SSH key secrets]. +<6> The Ansible variables that customize the set of nodes. For a complete list of Ansible variables, see https://openstack-k8s-operators.github.io/edpm-ansible/. +<7> The network configuration template to apply to nodes in the set. For sample templates, see https://github.com/openstack-k8s-operators/edpm-ansible/tree/main/roles/edpm_network_config/templates. +<8> The name of the secret that you created in xref:proc_creating-the-SSH-key-secrets_{context}[Creating the SSH key secrets]. +<9> Networks for the bare metal nodes. +<10> The node definition reference, for example, `edpm-compute-0`. Each node in the node set must have a node definition. +<11> The services that are deployed on the data plane nodes in this `OpenStackDataPlaneNodeSet` CR. diff --git a/docs/assemblies/ref_example-OpenStackDataPlaneNodeSet-CR-for-preprovisioned-nodes.adoc b/docs/assemblies/ref_example-OpenStackDataPlaneNodeSet-CR-for-preprovisioned-nodes.adoc index e17706df2..0b02f01fd 100644 --- a/docs/assemblies/ref_example-OpenStackDataPlaneNodeSet-CR-for-preprovisioned-nodes.adoc +++ b/docs/assemblies/ref_example-OpenStackDataPlaneNodeSet-CR-for-preprovisioned-nodes.adoc @@ -9,132 +9,101 @@ apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneNodeSet metadata: name: openstack-edpm-ipam + namespace: openstack spec: - env: <1> + env: #<1> - name: ANSIBLE_FORCE_COLOR value: "True" - preProvisioned: true <2> - services: <3> + networkAttachments: #<2> + - ctlplane + nodeTemplate: #<3> + ansible: + ansibleUser: cloud-admin #<4> + ansibleVars: #<5> + edpm_network_config_template: | #<6> + --- + {% 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 %} + edpm_nodes_validation_validate_controllers_icmp: false + edpm_nodes_validation_validate_gateway_icmp: false + edpm_sshd_allowed_ranges: + - 192.168.122.0/24 + enable_debug: false + gather_facts: false + neutron_physical_bridge_name: br-ex + neutron_public_interface_name: eth0 + ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret #<7> + nodes: + edpm-compute-0: #<8> + ansible: + ansibleHost: 192.168.122.100 + hostName: edpm-compute-0 + networks: + - defaultRoute: true + fixedIP: 192.168.122.100 + name: ctlplane + subnetName: subnet1 + - name: internalapi + subnetName: subnet1 + - name: storage + subnetName: subnet1 + - name: tenant + subnetName: subnet1 + preProvisioned: true #<9> + services: #<10> + - bootstrap + - download-cache - configure-network - validate-network - install-os - configure-os + - ssh-known-hosts - run-os + - reboot-os + - install-certs - ovn + - neutron-metadata - libvirt - nova - telemetry - nodes: - edpm-compute-0: <4> - hostName: edpm-compute-0 - ansible: - ansibleHost: 192.168.122.100 - networks: - - name: CtlPlane - subnetName: subnet1 - defaultRoute: true - fixedIP: 192.168.122.100 - - name: InternalApi - subnetName: subnet1 - - name: Storage - subnetName: subnet1 - - name: Tenant - subnetName: subnet1 - edpm-compute-1: - hostName: edpm-compute-1 - ansible: - ansibleHost: 192.168.122.101 - networks: - - name: CtlPlane - subnetName: subnet1 - defaultRoute: true - fixedIP: 192.168.122.101 - - name: InternalApi - subnetName: subnet1 - - name: Storage - subnetName: subnet1 - - name: Tenant - subnetName: subnet1 - networkAttachments: <5> - - ctlplane - nodeTemplate: <6> - ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret <7> - managementNetwork: ctlplane - ansible: - ansibleUser: cloud-admin <8> - ansiblePort: 22 - ansibleVars: <9> - service_net_map: - nova_api_network: internal_api - nova_libvirt_network: internal_api - edpm_chrony_ntp_servers: - - pool.ntp.org - edpm_network_config_template: | <10> - --- - {% 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_subnet_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 %} - edpm_network_config_hide_sensitive_logs: false - # These vars are for the network config templates themselves and are - # considered EDPM network defaults. - neutron_physical_bridge_name: br-ex - neutron_public_interface_name: eth0 - role_networks: - - InternalApi - - Storage - - Tenant - networks_lower: - External: external - InternalApi: internal_api - Storage: storage - Tenant: tenant - # edpm_nodes_validation - edpm_nodes_validation_validate_controllers_icmp: false - edpm_nodes_validation_validate_gateway_icmp: false - gather_facts: false - enable_debug: false - # edpm firewall, change the allowed CIDR if needed - edpm_sshd_configure_firewall: true - edpm_sshd_allowed_ranges: ['192.168.122.0/24'] - # SELinux module - edpm_selinux_mode: enforcing ---- <1> Optional: A list of environment variables to pass to the pod. -<2> Specify if the nodes in this set are pre-provisioned, or if they must be provisioned when creating the resource. -//For information on how to configure your `OpenStackDataPlane` CR to provision bare metal nodes, see Provisioning bare metal nodes. -<3> The services that are deployed on the data plane nodes in this `OpenStackDataPlaneNodeSet` CR. -<4> The node definition reference, for example, `edpm-compute-0`. Each node in the node set must have a node definition. -<5> The networks the `ansibleee-runner` connects to, specified as a list of `netattach` resource names. -<6> The common configuration to apply to all nodes in this set of nodes. +<2> The networks the `ansibleee-runner` connects to, specified as a list of `netattach` resource names. +<3> The common configuration to apply to all nodes in this set of nodes. +<4> The user associated with the secret you created in xref:proc_creating-the-SSH-key-secrets_{context}[Creating the SSH key secrets]. +<5> The Ansible variables that customize the set of nodes. For a complete list of Ansible variables, see https://openstack-k8s-operators.github.io/edpm-ansible/. +<6> The network configuration template to apply to nodes in the set. For sample templates, see https://github.com/openstack-k8s-operators/edpm-ansible/tree/main/roles/edpm_network_config/templates. <7> The name of the secret that you created in xref:proc_creating-the-SSH-key-secrets_{context}[Creating the SSH key secrets]. -<8> The user associated with the secret you created in xref:proc_creating-the-SSH-key-secrets_{context}[Creating the SSH key secrets]. -<9> The Ansible variables that customize the set of nodes. For a complete list of Ansible variables, see https://openstack-k8s-operators.github.io/edpm-ansible/. -<10> The network configuration template to apply to nodes in the set. For sample templates, see https://github.com/openstack-k8s-operators/edpm-ansible/tree/main/roles/edpm_network_config/templates. +<8> The node definition reference, for example, `edpm-compute-0`. Each node in the node set must have a node definition. +<9> Specify if the nodes in this set are pre-provisioned, or if they must be provisioned when creating the resource. +//For information on how to configure your `OpenStackDataPlane` CR to provision bare metal nodes, see Provisioning bare metal nodes. +<10> The services that are deployed on the data plane nodes in this `OpenStackDataPlaneNodeSet` CR. diff --git a/docs/kustomize_to_docs.sh b/docs/kustomize_to_docs.sh new file mode 100755 index 000000000..e1de123ba --- /dev/null +++ b/docs/kustomize_to_docs.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +set -ex pipefail + +BAREMETAL=docs/assemblies/ref_example-OpenStackDataPlaneNodeSet-CR-for-bare-metal-nodes.adoc +FOOTER=$(sed '0,/----/d' $BAREMETAL | sed -e '0,/----/d') +sed -i '/----/q' $BAREMETAL +sed -i 's/preprovisioned/baremetal/' examples/no_vars_from/kustomization.yaml +oc kustomize --load-restrictor LoadRestrictionsNone examples/no_vars_from | yq ' select(.kind == "OpenStackDataPlaneNodeSet")' >> $BAREMETAL +sed -i 's/\/baremetal/\/preprovisioned/' examples/no_vars_from/kustomization.yaml +echo -e "----\n$FOOTER" >> $BAREMETAL + +COUNT=1 +CALLOUTS=( + "baremetalSetTemplate" + "env" + "networkAttachments" + "nodeTemplate" + "ansibleUser" + "ansibleVars" + "edpm_network_config_template" + "ansibleSSHPrivateKeySecret" + "networks" + "edpm-compute-0" + "services" +) +for callout in "${CALLOUTS[@]}" +do + sed -i "/$callout:/ s/$/ #<$COUNT>/" $BAREMETAL + COUNT=$((COUNT + 1)) +done + + +PREPROVISIONED=docs/assemblies/ref_example-OpenStackDataPlaneNodeSet-CR-for-preprovisioned-nodes.adoc +FOOTER=$(sed '0,/----/d' $PREPROVISIONED | sed -e '0,/----/d') +sed -i '/----/q' $PREPROVISIONED +oc kustomize --load-restrictor LoadRestrictionsNone examples/no_vars_from | yq ' select(.kind == "OpenStackDataPlaneNodeSet")' >> $PREPROVISIONED +echo -e "----\n$FOOTER" >> $PREPROVISIONED + +COUNT=1 +CALLOUTS=( + "env" + "networkAttachments" + "nodeTemplate" + "ansibleUser" + "ansibleVars" + "edpm_network_config_template" + "ansibleSSHPrivateKeySecret" + "edpm-compute-0" + "preProvisioned" + "services" +) +for callout in "${CALLOUTS[@]}" +do + sed -i "/$callout:/ s/$/ #<$COUNT>/" $PREPROVISIONED + COUNT=$((COUNT + 1)) +done diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 000000000..f44f7f276 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,6 @@ +# Kustomize examples + +Requires [OpenShift CLI](https://docs.openshift.com/container-platform/4.14/cli_reference/openshift_cli/getting-started-cli.html#installing-openshift-cli) (oc) 4.14 or higher +``` +oc kustomize --load-restrictor LoadRestrictionsNone examples/ +``` diff --git a/examples/no_vars_from/kustomization.yaml b/examples/no_vars_from/kustomization.yaml new file mode 100644 index 000000000..89f8450ee --- /dev/null +++ b/examples/no_vars_from/kustomization.yaml @@ -0,0 +1,53 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +components: +- ../preprovisioned # for baremetal nodes, replace with baremetal + +replacements: +# OpenStackDataPlaneNodeSet customizations +- source: + kind: ConfigMap + name: neutron-edpm + fieldPath: data.physical_bridge_name + targets: + - select: + kind: OpenStackDataPlaneNodeSet + fieldPaths: + - spec.nodeTemplate.ansible.ansibleVars.neutron_physical_bridge_name + options: + create: true +- source: + kind: ConfigMap + name: neutron-edpm + fieldPath: data.public_interface_name + targets: + - select: + kind: OpenStackDataPlaneNodeSet + fieldPaths: + - spec.nodeTemplate.ansible.ansibleVars.neutron_public_interface_name + options: + create: true +- source: + kind: ConfigMap + name: network-config-template + fieldPath: data.network_config_template + targets: + - select: + kind: OpenStackDataPlaneNodeSet + fieldPaths: + - spec.nodeTemplate.ansible.ansibleVars.edpm_network_config_template + options: + create: true + + +patches: +- target: + kind: OpenStackDataPlaneNodeSet + name: openstack-edpm + patch: |- + - op: remove + path: /spec/nodeTemplate/ansible/ansibleVarsFrom + - op: add + path: /spec/nodeTemplate/ansible/ansibleUser + value: cloud-admin diff --git a/examples/preprovisioned/kustomization.yaml b/examples/preprovisioned/kustomization.yaml index 8772b2ffe..585eb787e 100644 --- a/examples/preprovisioned/kustomization.yaml +++ b/examples/preprovisioned/kustomization.yaml @@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1alpha1 kind: Component namespace: openstack +nameSuffix: -ipam components: - ../base