From 060f72d65ca921c1727dd232953b9e1904e44ff0 Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Thu, 31 Aug 2023 20:43:51 -0400 Subject: [PATCH 1/5] OPNET-329: add DualStackIPv6Primary for vSphere OPNET-198 added IPv6-primary dual stack --- .../ovn-conf-vsphere-dualstack-commands.sh | 13 +++++++++++-- .../ovn-conf-vsphere-dualstack-ref.yaml | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-commands.sh b/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-commands.sh index 689bb1943c4c2..83d3c7472030f 100644 --- a/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-commands.sh +++ b/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-commands.sh @@ -5,8 +5,8 @@ set -o pipefail echo "saving ipv4 vip configuration" -API_VIP=$(/tmp/yq e '.platform.vsphere.apiVIP' ${SHARED_DIR}/install-config.yaml) -INGRESS_VIP=$(/tmp/yq e '.platform.vsphere.ingressVIP' ${SHARED_DIR}/install-config.yaml) +API_VIP=$(/tmp/yq e '.platform.vsphere.apiVIP' "${SHARED_DIR}/install-config.yaml") +INGRESS_VIP=$(/tmp/yq e '.platform.vsphere.ingressVIP' "${SHARED_DIR}/install-config.yaml") export API_VIP export INGRESS_VIP @@ -35,3 +35,12 @@ networking: - 172.30.0.0/16 - fd65:172:16::/112 EOF + +if [[ "${IP_FAMILIES}" == "DualStackIPv6Primary" ]]; then + echo Swapping IP addresses + /tmp/yq e --inplace '.platform.vsphere.apiVIPs = (.platform.vsphere.apiVIPs | reverse)' ${SHARED_DIR}/install-config.yaml + /tmp/yq e --inplace '.platform.vsphere.ingressVIPs = (.platform.vsphere.ingressVIPs | reverse)' ${SHARED_DIR}/install-config.yaml + /tmp/yq e --inplace '.networking.machineNetwork = (.networking.machineNetwork | reverse)' "${SHARED_DIR}/install-config.yaml" + /tmp/yq e --inplace '.networking.clusterNetwork = (.networking.clusterNetwork | reverse)' "${SHARED_DIR}/install-config.yaml" + /tmp/yq e --inplace '.networking.serviceNetwork = (.networking.serviceNetwork | reverse)' "${SHARED_DIR}/install-config.yaml" +fi diff --git a/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-ref.yaml b/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-ref.yaml index 86e96ee72919c..da7532f3475c4 100644 --- a/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-ref.yaml +++ b/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-ref.yaml @@ -9,5 +9,8 @@ ref: requests: cpu: 10m memory: 100Mi + env: + - name: IP_FAMILIES + default: "DualStackIPv6Primary" documentation: |- The ovn dualstack conf step adds the configuration for dualstack to set of manifests for installation From f2ebcebf95de643bac14917ee6fa9038c338cdc3 Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Thu, 7 Sep 2023 19:50:58 -0400 Subject: [PATCH 2/5] dualstack default --- .../conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-ref.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-ref.yaml b/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-ref.yaml index da7532f3475c4..0347cdc2d0673 100644 --- a/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-ref.yaml +++ b/ci-operator/step-registry/ovn/conf/vsphere-dualstack/ovn-conf-vsphere-dualstack-ref.yaml @@ -11,6 +11,6 @@ ref: memory: 100Mi env: - name: IP_FAMILIES - default: "DualStackIPv6Primary" + default: "DualStack" documentation: |- The ovn dualstack conf step adds the configuration for dualstack to set of manifests for installation From f113db6252fe897b8b32aaa6a76402c2ab2ab1de Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Thu, 7 Sep 2023 19:51:53 -0400 Subject: [PATCH 3/5] set cluster-infrastructure vshpere internal cidr --- .../install/ipi-install-install-commands.sh | 29 +++++++++++++++++++ .../install/ipi-install-install-ref.yaml | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh index 5e6fede17b8b8..a50acdcf4cb85 100755 --- a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh +++ b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh @@ -395,6 +395,31 @@ EOF done } +function vsphere_internal_network() { + local dir=${1} + + + PATCH="${SHARED_DIR}/nodeNetworking-internal.yaml.patch" + cat > "${PATCH}" << EOF +spec: + platformSpec: + vsphere: + nodeNetworking: + internal: + networkSubnetCidr: + - "$MACHINE_NETWORK" + external: + networkSubnetCidr: + - "$MACHINE_NETWORK" +EOF + + yq-go m -x -i $dir/manifests/cluster-infrastructure-02-config.yml "${PATCH}" + + cat $dir/manifests/cluster-infrastructure-02-config.yml +} + + + # inject_spot_instance_config is an AWS specific option that enables the use of AWS spot instances for worker nodes function inject_spot_instance_config() { local dir=${1} @@ -528,6 +553,9 @@ dir=/tmp/installer mkdir "${dir}/" cp "${SHARED_DIR}/install-config.yaml" "${dir}/" +MACHINE_NETWORK=$(yq-go r "${SHARED_DIR}/install-config.yaml" 'networking.machineNetwork[0].cidr') +echo ".machineNetwork[0].cidr = ${MACHINE_NETWORK}" + echo "install-config.yaml" echo "-------------------" cat ${SHARED_DIR}/install-config.yaml | grep -v "password\|username\|pullSecret" | tee ${ARTIFACT_DIR}/install-config.yaml @@ -544,6 +572,7 @@ wait "$!" # Platform specific manifests adjustments case "${CLUSTER_TYPE}" in +vsphere) vsphere_internal_network ${dir} ;; azure4|azure-arm64) inject_boot_diagnostics ${dir} ;; aws|aws-arm64|aws-usgov) if [[ "${SPOT_INSTANCES:-}" == 'true' ]]; then diff --git a/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml b/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml index bf20554c9ade3..5e2fdfa30ea60 100644 --- a/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml +++ b/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml @@ -1,6 +1,6 @@ ref: as: ipi-install-install - from: installer + from: upi-installer grace_period: 10m commands: ipi-install-install-commands.sh cli: latest From d85d3e8ab39e631fca26f4b5fb58109b15b074fd Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Mon, 11 Sep 2023 19:44:56 -0400 Subject: [PATCH 4/5] exclude IPv6 --- .../ipi/install/install/ipi-install-install-commands.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh index a50acdcf4cb85..866e2c5802efb 100755 --- a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh +++ b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh @@ -408,11 +408,16 @@ spec: internal: networkSubnetCidr: - "$MACHINE_NETWORK" + excludeNetworkSubnetCidr: + - "$EXCLUDE_MACHINE_NETWORK" external: networkSubnetCidr: - "$MACHINE_NETWORK" + excludeNetworkSubnetCidr: + - "$EXCLUDE_MACHINE_NETWORK" EOF + yq-go m -x -i $dir/manifests/cluster-infrastructure-02-config.yml "${PATCH}" cat $dir/manifests/cluster-infrastructure-02-config.yml @@ -555,6 +560,7 @@ cp "${SHARED_DIR}/install-config.yaml" "${dir}/" MACHINE_NETWORK=$(yq-go r "${SHARED_DIR}/install-config.yaml" 'networking.machineNetwork[0].cidr') echo ".machineNetwork[0].cidr = ${MACHINE_NETWORK}" +EXCLUDE_MACHINE_NETWORK=$(yq-go r "${SHARED_DIR}/install-config.yaml" 'networking.machineNetwork[1].cidr') echo "install-config.yaml" echo "-------------------" From a6d7497a0a19aee5726827a242d3157abd66b39c Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Mon, 11 Sep 2023 22:54:51 -0400 Subject: [PATCH 5/5] experiment with both addresses --- .../install/ipi-install-install-commands.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh index 866e2c5802efb..21be2bf0c319c 100755 --- a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh +++ b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh @@ -407,14 +407,12 @@ spec: nodeNetworking: internal: networkSubnetCidr: - - "$MACHINE_NETWORK" - excludeNetworkSubnetCidr: - - "$EXCLUDE_MACHINE_NETWORK" + - "$MACHINE_NETWORK_0" + - "$MACHINE_NETWORK_1" external: networkSubnetCidr: - - "$MACHINE_NETWORK" - excludeNetworkSubnetCidr: - - "$EXCLUDE_MACHINE_NETWORK" + - "$MACHINE_NETWORK_0" + - "$MACHINE_NETWORK_1" EOF @@ -558,9 +556,8 @@ dir=/tmp/installer mkdir "${dir}/" cp "${SHARED_DIR}/install-config.yaml" "${dir}/" -MACHINE_NETWORK=$(yq-go r "${SHARED_DIR}/install-config.yaml" 'networking.machineNetwork[0].cidr') -echo ".machineNetwork[0].cidr = ${MACHINE_NETWORK}" -EXCLUDE_MACHINE_NETWORK=$(yq-go r "${SHARED_DIR}/install-config.yaml" 'networking.machineNetwork[1].cidr') +MACHINE_NETWORK_0=$(yq-go r "${SHARED_DIR}/install-config.yaml" 'networking.machineNetwork[0].cidr') +MACHINE_NETWORK_1=$(yq-go r "${SHARED_DIR}/install-config.yaml" 'networking.machineNetwork[1].cidr') echo "install-config.yaml" echo "-------------------"