Skip to content

Commit

Permalink
Add clusterset-ip deploy option
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Pantelis <[email protected]>
  • Loading branch information
tpantelis committed Sep 27, 2024
1 parent d3f6e3f commit 52e3225
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ jobs:
extra-toggles: lighthouse
- extra-toggles: load-balancer
- extra-toggles: prometheus
- deploytool: operator
extra-toggles: lighthouse clusterset-ip
steps:
- name: Reclaim space on GHA host (if the job needs it)
if: ${{ contains('ovn', matrix.extra-toggles) }}
Expand Down
6 changes: 5 additions & 1 deletion Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEBUG_PRINT ?= true
PARALLEL ?= true
PROVIDER ?= kind
TIMEOUT ?= 5m
export AIR_GAPPED DEBUG_PRINT OVERLAPPING PARALLEL PLUGIN PRELOAD_IMAGES PROVIDER SETTINGS TEST_ARGS TIMEOUT
export AIR_GAPPED DEBUG_PRINT OVERLAPPING PARALLEL PLUGIN PRELOAD_IMAGES PROVIDER SETTINGS TEST_ARGS TIMEOUT USE_CLUSTERSET_IP

# Specific to `deploy`
CABLE_DRIVER ?= libreswan
Expand Down Expand Up @@ -98,6 +98,10 @@ DEPLOYTOOL = ocm
LIGHTHOUSE = true
endif

ifneq (,$(filter clusterset-ip,$(_using)))
USE_CLUSTERSET_IP = true
endif

# Force running E2E with `subctl verify`
ifneq (,$(filter subctl-verify,$(_using)))
TESTDIR = non-existent-dir
Expand Down
12 changes: 11 additions & 1 deletion scripts/shared/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -em

source "${SCRIPTS_DIR}/lib/utils"
print_env CABLE_DRIVER DEPLOYTOOL OVERLAPPING IMAGE_TAG LIGHTHOUSE PARALLEL PLUGIN PRELOAD_IMAGES SETTINGS TIMEOUT
print_env CABLE_DRIVER DEPLOYTOOL OVERLAPPING IMAGE_TAG LIGHTHOUSE PARALLEL PLUGIN PRELOAD_IMAGES SETTINGS TIMEOUT USE_CLUSTERSET_IP
source "${SCRIPTS_DIR}/lib/debug_functions"
source "${SCRIPTS_DIR}/lib/deploy_funcs"

Expand Down Expand Up @@ -108,6 +108,15 @@ function declare_global_cidrs() {
done
}

function declare_clusterset_ip_cidrs() {
declare -gA clusterset_ip_CIDRs

for cluster in "${clusters[@]}"; do
# shellcheck disable=SC2034
clusterset_ip_CIDRs[$cluster]="243.254.${cluster_number[$cluster]}.0/24"
done
}

# This is a workaround and can be removed once we switch the CNI from kindnet to a different one.
# In order to support health-check and hostNetwork use-cases, submariner requires an IPaddress from the podCIDR
# for each node in the cluster. Normally, most of the CNIs create a cniInterface on the host and assign an IP
Expand All @@ -132,6 +141,7 @@ function schedule_dummy_pod() {
load_settings
declare_cidrs
[[ "$OVERLAPPING" != "true" ]] || declare_global_cidrs
[[ "$USE_CLUSTERSET_IP" != "true" ]] || declare_clusterset_ip_cidrs
declare_kubeconfig

# Always import nettest image on kind, to be able to test connectivity and other things
Expand Down
2 changes: 2 additions & 0 deletions scripts/shared/lib/deploy_helm
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ function helm_install_subm() {
--set submariner.clusterCidr="${cluster_CIDRs[$cluster]}" \
--set submariner.serviceCidr="${service_CIDRs[$cluster]}" \
--set submariner.globalCidr="${global_CIDRs[$cluster]}" \
--set submariner.clustersetIpCidr="${clusterset_ip_CIDRs[$cluster]}" \
--set submariner.clustersetIpEnabled="${USE_CLUSTERSET_IP}" \
--set serviceAccounts.globalnet.create="${OVERLAPPING}" \
--set serviceAccounts.lighthouseAgent.create="${LIGHTHOUSE}" \
--set serviceAccounts.lighthouseCoreDns.create="${LIGHTHOUSE}" \
Expand Down
1 change: 1 addition & 0 deletions scripts/shared/lib/deploy_operator
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function deploytool_prereqs() {
function setup_broker() {
local extra_flags=()
[[ "${OVERLAPPING}" = true ]] && extra_flags+=(--globalnet)
[[ "${USE_CLUSTERSET_IP}" = true ]] && extra_flags+=(--enable-clusterset-ip)
if [[ "${LIGHTHOUSE}" == true ]]; then
extra_flags+=(--components 'service-discovery,connectivity')
else
Expand Down
1 change: 1 addition & 0 deletions scripts/shared/resources/bundle/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ spec:
defaultGlobalnetClusterSize: 8192
globalnetEnabled: ${OVERLAPPING}
globalnetCIDRRange: 169.254.0.0/16
clustersetIPEnabled: ${USE_CLUSTERSET_IP}
2 changes: 2 additions & 0 deletions scripts/shared/resources/bundle/submariner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ spec:
serviceCIDR: "${service_CIDRs[$cluster]}"
clusterCIDR: "${cluster_CIDRs[$cluster]}"
globalCIDR: "${global_CIDRs[$cluster]}"
clustersetIPEnabled: ${USE_CLUSTERSET_IP}
clustersetIPCIDR: "${clusterset_ip_CIDRs[$cluster]}"
clusterID: "${cluster}"
debug: false
natEnabled: false
Expand Down

0 comments on commit 52e3225

Please sign in to comment.