From eead82d7137fd84d0c52fc5729bb0032279a87d1 Mon Sep 17 00:00:00 2001 From: ehila Date: Mon, 11 Nov 2024 21:46:12 -0500 Subject: [PATCH] feat: initial arbiter node addition added support for creating install for clusters with arbiter nodes added arbiter flavor to allow using smaller compute sizes for testing --- common.sh | 5 +++++ config_example.sh | 21 +++++++++++++++++++++ ocp_install_env.sh | 15 +++++++++++++++ utils.sh | 19 ++++++++++++++++--- vm_setup_vars.yml | 9 +++++++++ 5 files changed, 66 insertions(+), 3 deletions(-) diff --git a/common.sh b/common.sh index d7d909f55..110c56030 100644 --- a/common.sh +++ b/common.sh @@ -271,6 +271,7 @@ export CONTAINER_RUNTIME="podman" export NUM_MASTERS=${NUM_MASTERS:-"3"} export NUM_WORKERS=${NUM_WORKERS:-"2"} +export ENABLE_ARBITER=${ENABLE_ARBITER:-} export NUM_EXTRA_WORKERS=${NUM_EXTRA_WORKERS:-"0"} export EXTRA_WORKERS_ONLINE_STATUS=${EXTRA_WORKERS_ONLINE_STATUS:-"true"} export EXTRA_WORKERS_NAMESPACE=${EXTRA_WORKERS_NAMESPACE:-"openshift-machine-api"} @@ -285,6 +286,10 @@ export MASTER_MEMORY=${MASTER_MEMORY:-16384} export MASTER_DISK=${MASTER_DISK:-50} export MASTER_VCPU=${MASTER_VCPU:-8} +export ARBITER_MEMORY=${ARBITER_MEMORY:-8192} +export ARBITER_DISK=${ARBITER_DISK:-50} +export ARBITER_VCPU=${ARBITER_VCPU:-4} + export WORKER_MEMORY=${WORKER_MEMORY:-8192} export WORKER_DISK=${WORKER_DISK:-50} export WORKER_VCPU=${WORKER_VCPU:-4} diff --git a/config_example.sh b/config_example.sh index eefa0ff27..c6432e31e 100755 --- a/config_example.sh +++ b/config_example.sh @@ -452,6 +452,16 @@ set -x # #export NODES_PLATFORM=baremetal +# ENABLE_ARBITER - +# Set to any non zero length string value to enable the creation of an arbiter node. +# Arbiter nodes take the place of a master node but run only critical containers to maintain HA for the cluster, +# it is a TechPreview feature so `export FEATURE_SET="TechPreviewNoUpgrade"` must be set. +# +# Furthermore, since an Arbiter node takes the place of a master node the NUM_MASTERS count +# must be set to `export NUM_MASTERS=2` and not the default `3` to avoid even number etcd members. +# +#export ENABLE_ARBITER=1 + # MASTER_HOSTNAME_FORMAT - # Set a custom hostname format for masters. This is a format string that should # include one %d field, which will be replaced with the number of the node. @@ -476,6 +486,17 @@ set -x #export MASTER_DISK=40 #export MASTER_VCPU=8 +# ARBITER_MEMORY, ARBITER_DISK, ARBITER_VCPU - +# Change VM resources for arbiters +## Defaults: +## ARBITER_DISK=50 +## ARBITER_MEMORY=8192 +## ARBITER_VCPU=4 +# +#export ARBITER_MEMORY=8192 +#export ARBITER_DISK=50 +#export ARBITER_VCPU=2 + # WORKER_HOSTNAME_FORMAT - # Set a custom hostname format for workers. This is a format string that should # include one %d field, which will be replaced with the number of the node. diff --git a/ocp_install_env.sh b/ocp_install_env.sh index 8682fbccd..0161eac56 100644 --- a/ocp_install_env.sh +++ b/ocp_install_env.sh @@ -181,6 +181,20 @@ EOF fi } +function arbiterStanza() { + if [[ ! -z "${ENABLE_ARBITER:-}" ]]; then +cat <