diff --git a/README.md b/README.md index 407fce54d..8e45bff0a 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,8 @@ CLUSTER_NAME=clustername DNS_VIP="1.1.1.1" # Set your default network type, `OpenShiftSDN` or `OVNKubernetes`, defaults to `OpenShiftSDN` NETWORK_TYPE="OpenShiftSDN" +# Boolean to use OVNKubernetes local gateway mode. defaults to `false` which is shared mode +OVN_LOCAL_GATEWAY_MODE=false # Set to the subnet in use on the external (baremetal) network EXTERNAL_SUBNET_V4="192.168.111.0/24" # Provide additional master/worker ignition configuration, will be diff --git a/assets/templates/cluster-network-00-gateway-mode.yaml.optional b/assets/templates/cluster-network-00-gateway-mode.yaml.optional new file mode 100644 index 000000000..08738fbe9 --- /dev/null +++ b/assets/templates/cluster-network-00-gateway-mode.yaml.optional @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: gateway-mode-config + namespace: openshift-network-operator +data: + mode: local +immutable: true \ No newline at end of file diff --git a/utils.sh b/utils.sh index c25470c7a..b128f016c 100644 --- a/utils.sh +++ b/utils.sh @@ -14,6 +14,11 @@ function generate_assets() { done } +function local_gateway_mode(){ + ASSESTS_DIR=$1 + cp assets/templates/cluster-network-00-gateway-mode.yaml.optional assets/generated/cluster-network-00-gateway-mode.yaml +} + function custom_ntp(){ ASSESTS_DIR=$1 # TODO - consider adding NTP server config to install-config.yaml instead @@ -55,6 +60,9 @@ function create_cluster() { mkdir -p ${assets_dir}/openshift generate_assets custom_ntp ${assets_dir}/openshift + if [[ "${OVN_LOCAL_GATEWAY_MODE}" == "true" ]] && [[ "${NETWORK_TYPE}" == "OVNKubernetes" ]]; then + local_gateway_mode ${assets_dir}/openshift + fi generate_metal3_config find assets/generated -name '*.yaml' -exec cp -f {} ${assets_dir}/openshift \;